Skip to content

Commit

Permalink
fix: handle attr inline correctly
Browse files Browse the repository at this point in the history
Signed-off-by: Zxilly <[email protected]>
  • Loading branch information
Zxilly committed Jun 25, 2024
1 parent 1a254d5 commit 51a7d95
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions internal/dwarf/dwarf.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ func EntryShouldIgnore(entry *dwarf.Entry) bool {
inline := entry.Val(dwarf.AttrInline)
if inline != nil {
val, ok := inline.(int64)
return !ok || val != 0
if ok && val != 0 {
return true
}
}

var boolIgnores = []dwarf.Attr{
Expand Down Expand Up @@ -161,7 +163,7 @@ func EntryFileReader(cu *dwarf.Entry, d *dwarf.Data) func(entry *dwarf.Entry) st
if entry.Val(dwarf.AttrTrampoline) == nil {
fileIndexAny := entry.Val(dwarf.AttrDeclFile)
if fileIndexAny == nil {
slog.Debug(fmt.Sprintf("Failed to load DWARF function file as no field: %s", EntryPrettyPrint(entry)))
slog.Debug(fmt.Sprintf("Failed to load DWARF function file as no AttrDeclFile field: %s", EntryPrettyPrint(entry)))
return defaultName
}
fileIndex, ok := fileIndexAny.(int64)
Expand Down

0 comments on commit 51a7d95

Please sign in to comment.