jump to the start of the fn call

pull/7/head
yann300 7 years ago
parent e62acd8dc3
commit da0c0c7ce3
  1. 3
      src/ui/StepManager.js
  2. 2
      src/util/internalCallTree.js

@ -39,6 +39,9 @@ function StepManager (_parent, _traceManager) {
this.parent.vmDebugger.asmCode.event.register('show', () => {
this.solidityMode = false
})
if (this.parent.callTree.functionCallStack.length) {
this.jumpTo(this.parent.callTree.functionCallStack[0])
}
})
this.buttonNavigator = new ButtonNavigator(_parent, this.traceManager)

@ -57,6 +57,7 @@ class InternalCallTree {
/*
scopeStart: represent start of a new scope. Keys are index in the vmtrace, values are scopeId
*/
this.functionCallStack = []
this.scopeStarts = {}
this.variableDeclarationByFile = {}
this.functionDefinitionByFile = {}
@ -196,6 +197,7 @@ function includeVariableDeclaration (tree, step, sourceLocation, scopeId, newLoc
}
var functionDefinition = resolveFunctionDefinition(tree, step, previousSourceLocation)
if (functionDefinition && newLocation && traceHelper.isJumpDestInstruction(tree.traceManager.trace[step - 1])) {
tree.functionCallStack.push(step)
// means: the previous location was a function definition && JUMPDEST
// => we are at the beginning of the function and input/output are setup
tree.solidityProxy.contractNameAt(step, (error, contractName) => { // cached

Loading…
Cancel
Save