Skip to content

Commit

Permalink
fixup! Show pprof labels in the threads request
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanhaller committed Sep 17, 2023
1 parent d8525fd commit 93d379b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions service/dap/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -1800,21 +1800,21 @@ func (s *Session) onThreadsRequest(request *dap.ThreadsRequest) {
if g.Thread != nil && g.Thread.ThreadID() != 0 {
thread = fmt.Sprintf(" (Thread %d)", g.Thread.ThreadID())
}
labels := ""
var labels strings.Builder
if len(g.Labels()) > 0 {
var keys []string
for k := range g.Labels() {
keys = append(keys, k)
}
sort.Strings(keys)
for _, k := range keys {
labels += fmt.Sprintf(" %s=%s", k, g.Labels()[k])
fmt.Fprintf(&labels, " %s=%s", k, g.Labels()[k])
}
}
// File name and line number are communicated via `stackTrace`
// so no need to include them here.
loc := g.UserCurrent()
threads[i].Name = fmt.Sprintf("%s[Go %d%s] %s%s", selected, g.ID, labels, fnName(&loc), thread)
threads[i].Name = fmt.Sprintf("%s[Go %d%s] %s%s", selected, g.ID, labels.String(), fnName(&loc), thread)
threads[i].Id = int(g.ID)
}
}
Expand Down

0 comments on commit 93d379b

Please sign in to comment.