Skip to content

Commit

Permalink
handle demangling OSX names with underscore prefix
Browse files Browse the repository at this point in the history
Updates github ticket #477
  • Loading branch information
alk committed Jan 23, 2025
1 parent 997b0b7 commit 7dd4dbb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions internal/symbolizer/symbolizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,16 @@ func demangleSingleFunction(fn *profile.Function, options []demangle.Option) {
fn.Name = demangled
return
}

// OSX has all the symbols prefixed with extra '_' so lets try
// once more without it
if strings.HasPrefix(fn.SystemName, "_") {
if demangled := demangle.Filter(fn.SystemName[1:], o...); demangled != fn.SystemName {
fn.Name = demangled
return
}
}

// Could not demangle. Apply heuristics in case the name is
// already demangled.
name := fn.SystemName
Expand Down

0 comments on commit 7dd4dbb

Please sign in to comment.