mirror of
https://github.com/go-delve/delve.git
synced 2025-10-29 01:27:16 +08:00
proc: flag variables that have a 'fake' address (#1619)
Add variables flag to mark variables that are allocated on a register (and have no address) and variables that we read as result of a function call (and are allocated on a stack that no longer exists when we show them to the user).
This commit is contained in:
committed by
Derek Parker
parent
158fb7bfac
commit
29a058ee7e
@ -71,6 +71,12 @@ const (
|
||||
VariableArgument
|
||||
// VariableReturnArgument means this variable is a function return value
|
||||
VariableReturnArgument
|
||||
// VariableFakeAddress means the address of this variable is either fake
|
||||
// (i.e. the variable is partially or completely stored in a CPU register
|
||||
// and doesn't have a real address) or possibly no longer availabe (because
|
||||
// the variable is the return value of a function call and allocated on a
|
||||
// frame that no longer exists)
|
||||
VariableFakeAddress
|
||||
)
|
||||
|
||||
// Variable represents a variable. It contains the address, name,
|
||||
@ -1051,6 +1057,9 @@ func (scope *EvalScope) extractVarInfoFromEntry(varEntry *dwarf.Entry) (*Variabl
|
||||
}
|
||||
|
||||
v := scope.newVariable(n, uintptr(addr), t, mem)
|
||||
if pieces != nil {
|
||||
v.Flags |= VariableFakeAddress
|
||||
}
|
||||
v.LocationExpr = descr
|
||||
v.DeclLine, _ = entry.Val(dwarf.AttrDeclLine).(int64)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user