proc: use argument position for addr only when injecting function calls (#2181)
* proc: use argument position for addr only when injecting function calls We can not, in general, use the argument position to determine the address of a formal parameter, it will not work in presence of optimizations or inlining. In those cases formal arguments could be stored in registers. Fixes #2176 * Travis-CI: add ignorechecksum option to chocolatey command Looks like a configuration problem on chocolatey's end. Co-authored-by: a <a@kra>
This commit is contained in:
parent
2bd38fff90
commit
7e00666b9f
@ -51,6 +51,11 @@ type EvalScope struct {
|
||||
// The goroutine executing the expression evaluation shall signal that the
|
||||
// evaluation is complete by closing the continueRequest channel.
|
||||
callCtx *callContext
|
||||
|
||||
// If trustArgOrder is true function arguments that don't have an address
|
||||
// will have one assigned by looking at their position in the argument
|
||||
// list.
|
||||
trustArgOrder bool
|
||||
}
|
||||
|
||||
// ConvertEvalScope returns a new EvalScope in the context of the
|
||||
@ -208,7 +213,7 @@ func (scope *EvalScope) Locals() ([]*Variable, error) {
|
||||
return nil, errors.New("unable to find function context")
|
||||
}
|
||||
|
||||
trustArgOrder := scope.BinInfo.Producer() != "" && goversion.ProducerAfterOrEqual(scope.BinInfo.Producer(), 1, 12)
|
||||
trustArgOrder := scope.trustArgOrder && scope.BinInfo.Producer() != "" && goversion.ProducerAfterOrEqual(scope.BinInfo.Producer(), 1, 12) && scope.Fn != nil && (scope.PC == scope.Fn.Entry)
|
||||
|
||||
dwarfTree, err := scope.image().getDwarfTree(scope.Fn.offset)
|
||||
if err != nil {
|
||||
|
||||
@ -806,6 +806,7 @@ func funcCallStep(callScope *EvalScope, fncall *functionCallState, thread Thread
|
||||
|
||||
// pretend we are still inside the function we called
|
||||
fakeFunctionEntryScope(retScope, fncall.fn, int64(regs.SP()), regs.SP()-uint64(bi.Arch.PtrSize()))
|
||||
retScope.trustArgOrder = true
|
||||
|
||||
fncall.retvars, err = retScope.Locals()
|
||||
if err != nil {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user