diff --git a/libs/remix-debug/src/solidity-decoder/internalCallTree.js b/libs/remix-debug/src/solidity-decoder/internalCallTree.js index c760eb818e..5f84c48484 100644 --- a/libs/remix-debug/src/solidity-decoder/internalCallTree.js +++ b/libs/remix-debug/src/solidity-decoder/internalCallTree.js @@ -252,18 +252,18 @@ function includeVariableDeclaration (tree, step, sourceLocation, scopeId, newLoc try { const stack = tree.traceManager.getStackAt(step) var states = tree.solidityProxy.extractStatesDefinitions() - if (functionDefinition.parameters && functionDefinition.parameters.length) { - let inputs - let outputs - for (const element of functionDefinition.parameters) { - if (element.nodeType === 'ParameterList') { - if (!inputs) inputs = element - else { - outputs = element - break - } - } - } + if (functionDefinition.parameters) { + let inputs = functionDefinition.parameters + let outputs = functionDefinition.returnParameters + // for (const element of functionDefinition.parameters) { + // if (element.nodeType === 'ParameterList') { + // if (!inputs) inputs = element + // else { + // outputs = element + // break + // } + // } + // } // input params if (inputs) { functionDefinitionAndInputs.inputs = addParams(inputs, tree, scopeId, states, contractName, previousSourceLocation, stack.length, inputs.parameters.length, -1) @@ -335,6 +335,7 @@ function extractFunctionDefinitions (ast, astWalker) { function addParams (parameterList, tree, scopeId, states, contractName, sourceLocation, stackLength, stackPosition, dir) { let params = [] for (let inputParam in parameterList.parameters) { + console.log('parameterList.parameters------>', parameterList.parameters) const param = parameterList.parameters[inputParam] const stackDepth = stackLength + (dir * stackPosition) if (stackDepth >= 0) { diff --git a/libs/remix-debug/test/decoder/localsTests/int.js b/libs/remix-debug/test/decoder/localsTests/int.js index 7d7a3fb3fb..dbdf1f775b 100644 --- a/libs/remix-debug/test/decoder/localsTests/int.js +++ b/libs/remix-debug/test/decoder/localsTests/int.js @@ -44,7 +44,6 @@ module.exports = function (st, vm, privateKey, contractBytecode, compilationResu st.equals(functions1.length, 1) st.equals(functions2.length, 2) st.equals(functions3.length, 0) - st.equals(Object.keys(functions1[0])[0], 'functionDefinition') st.equals(Object.keys(functions1[0])[1], 'inputs') st.equals(functions1[0].inputs[0], 'foo') @@ -55,9 +54,9 @@ module.exports = function (st, vm, privateKey, contractBytecode, compilationResu st.equals(functions2[0].inputs[0], 'asd') st.equals(functions2[1].inputs[0], 'foo') - st.equals(functions1[0].functionDefinition.attributes.name, 'level11') - st.equals(functions2[0].functionDefinition.attributes.name, 'level12') - st.equals(functions2[1].functionDefinition.attributes.name, 'level11') + st.equals(functions1[0].functionDefinition.name, 'level11') + st.equals(functions2[0].functionDefinition.name, 'level12') + st.equals(functions2[1].functionDefinition.name, 'level11') st.equals(scopeStarts[0], '') st.equals(scopeStarts[13], '1') @@ -66,6 +65,7 @@ module.exports = function (st, vm, privateKey, contractBytecode, compilationResu st.equals(scopeStarts[136], '3') st.equals(scopeStarts[153], '4') st.equals(scopeStarts[166], '4.1') + console.log('----------->', scopes['']) st.equals(scopes[''].locals['ui8'].type.typeName, 'uint8') st.equals(scopes[''].locals['ui16'].type.typeName, 'uint16') st.equals(scopes[''].locals['ui32'].type.typeName, 'uint32')