Skip to content

Commit

Permalink
proc: correctly extract name of functions that have been inlined
Browse files Browse the repository at this point in the history
If a function can be inlined it will appear as two entries in
debug_info. A DW_TAG_subprogram entry with DW_AT_inlined = true (that
will be used as the abstract origin) and a second DW_TAG_subprogram
entry with an abstract origin.
To retrieve the name of this second entry we must load its abstract
origin.
  • Loading branch information
aarzilli committed Nov 16, 2018
1 parent 4634cf8 commit 49237f8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/proc/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,13 @@ outer:
highpc = ranges[0][1] + bi.staticBase
}
name, ok2 := entry.Val(dwarf.AttrName).(string)
if !ok2 {
originOffset, hasAbstractOrigin := entry.Val(dwarf.AttrAbstractOrigin).(dwarf.Offset)
if hasAbstractOrigin {
name, ok2 = abstractOriginNameTable[originOffset]
}
}

var fn Function
if (ok1 == !inlined) && ok2 {
if inlined {
Expand Down

0 comments on commit 49237f8

Please sign in to comment.