mirror of
https://github.com/go-delve/delve.git
synced 2025-10-30 02:07:58 +08:00
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:
@ -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
|
|||||||
|
|
||||||
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 {
|
|||||||
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 {
|
|||||||
|
|
||||||
// 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
|
||||||
|
|||||||
Reference in New Issue
Block a user