proc,service: export declaration line of variables

Adds a field, DeclLine, to Variable containing the declaration line
number of the variable.
This commit is contained in:
aarzilli
2018-06-28 11:23:39 +02:00
committed by Derek Parker
parent 9a216211d3
commit 5cd86b1587
3 changed files with 5 additions and 0 deletions

View File

@ -103,6 +103,7 @@ type Variable struct {
Unreadable error
LocationExpr string // location expression
DeclLine int64 // line number of this variable's declaration
}
type LoadConfig struct {
@ -836,6 +837,7 @@ func (scope *EvalScope) extractVarInfoFromEntry(varEntry *dwarf.Entry) (*Variabl
v := scope.newVariable(n, uintptr(addr), t, mem)
v.LocationExpr = descr
v.DeclLine, _ = entry.Val(dwarf.AttrDeclLine).(int64)
if err != nil {
v.Unreadable = err
}