提交 5cd86b15 编写于 作者: A aarzilli 提交者: Derek Parker

proc,service: export declaration line of variables

Adds a field, DeclLine, to Variable containing the declaration line
number of the variable.
上级 9a216211
...@@ -103,6 +103,7 @@ type Variable struct { ...@@ -103,6 +103,7 @@ type Variable struct {
Unreadable error Unreadable error
LocationExpr string // location expression LocationExpr string // location expression
DeclLine int64 // line number of this variable's declaration
} }
type LoadConfig struct { type LoadConfig struct {
...@@ -836,6 +837,7 @@ func (scope *EvalScope) extractVarInfoFromEntry(varEntry *dwarf.Entry) (*Variabl ...@@ -836,6 +837,7 @@ func (scope *EvalScope) extractVarInfoFromEntry(varEntry *dwarf.Entry) (*Variabl
v := scope.newVariable(n, uintptr(addr), t, mem) v := scope.newVariable(n, uintptr(addr), t, mem)
v.LocationExpr = descr v.LocationExpr = descr
v.DeclLine, _ = entry.Val(dwarf.AttrDeclLine).(int64)
if err != nil { if err != nil {
v.Unreadable = err v.Unreadable = err
} }
......
...@@ -123,6 +123,7 @@ func ConvertVar(v *proc.Variable) *Variable { ...@@ -123,6 +123,7 @@ func ConvertVar(v *proc.Variable) *Variable {
Base: v.Base, Base: v.Base,
LocationExpr: v.LocationExpr, LocationExpr: v.LocationExpr,
DeclLine: v.DeclLine,
} }
r.Type = prettyTypeName(v.DwarfType) r.Type = prettyTypeName(v.DwarfType)
......
...@@ -227,6 +227,8 @@ type Variable struct { ...@@ -227,6 +227,8 @@ type Variable struct {
// LocationExpr describes the location expression of this variable's address // LocationExpr describes the location expression of this variable's address
LocationExpr string LocationExpr string
// DeclLine is the line number of this variable's declaration
DeclLine int64
} }
// LoadConfig describes how to load values from target's memory // LoadConfig describes how to load values from target's memory
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册