Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
2ab6293f
Commit
2ab6293f
authored
Sep 12, 2019
by
aniket-engg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
internal function call handling
parent
8fb07e0b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
3 deletions
+9
-3
internalCallTree.js
remix-debug/src/solidity-decoder/internalCallTree.js
+4
-0
traceManager.js
remix-lib/src/trace/traceManager.js
+1
-1
traceStepManager.js
remix-lib/src/trace/traceStepManager.js
+4
-2
No files found.
remix-debug/src/solidity-decoder/internalCallTree.js
View file @
2ab6293f
...
@@ -29,6 +29,7 @@ class InternalCallTree {
...
@@ -29,6 +29,7 @@ class InternalCallTree {
this
.
solidityProxy
=
solidityProxy
this
.
solidityProxy
=
solidityProxy
this
.
traceManager
=
traceManager
this
.
traceManager
=
traceManager
this
.
sourceLocationTracker
=
new
SourceLocationTracker
(
codeManager
)
this
.
sourceLocationTracker
=
new
SourceLocationTracker
(
codeManager
)
this
.
internalFunctionCalls
=
[]
debuggerEvent
.
register
(
'newTraceLoaded'
,
(
trace
)
=>
{
debuggerEvent
.
register
(
'newTraceLoaded'
,
(
trace
)
=>
{
this
.
reset
()
this
.
reset
()
if
(
!
this
.
solidityProxy
.
loaded
())
{
if
(
!
this
.
solidityProxy
.
loaded
())
{
...
@@ -157,6 +158,9 @@ async function buildTree (tree, step, scopeId, isExternalCall) {
...
@@ -157,6 +158,9 @@ async function buildTree (tree, step, scopeId, isExternalCall) {
// we are checking if we are jumping in a new CALL or in an internal function
// we are checking if we are jumping in a new CALL or in an internal function
if
(
isCallInstruction
||
sourceLocation
.
jump
===
'i'
)
{
if
(
isCallInstruction
||
sourceLocation
.
jump
===
'i'
)
{
try
{
try
{
if
(
sourceLocation
.
jump
===
'i'
)
{
this
.
internalFunctionCalls
.
push
(
step
)
}
var
externalCallResult
=
await
buildTree
(
tree
,
step
+
1
,
scopeId
===
''
?
subScope
.
toString
()
:
scopeId
+
'.'
+
subScope
,
isCallInstruction
)
var
externalCallResult
=
await
buildTree
(
tree
,
step
+
1
,
scopeId
===
''
?
subScope
.
toString
()
:
scopeId
+
'.'
+
subScope
,
isCallInstruction
)
if
(
externalCallResult
.
error
)
{
if
(
externalCallResult
.
error
)
{
return
{
outStep
:
step
,
error
:
'InternalCallTree - '
+
externalCallResult
.
error
}
return
{
outStep
:
step
,
error
:
'InternalCallTree - '
+
externalCallResult
.
error
}
...
...
remix-lib/src/trace/traceManager.js
View file @
2ab6293f
...
@@ -14,7 +14,7 @@ function TraceManager (options) {
...
@@ -14,7 +14,7 @@ function TraceManager (options) {
this
.
traceCache
=
new
TraceCache
()
this
.
traceCache
=
new
TraceCache
()
this
.
traceAnalyser
=
new
TraceAnalyser
(
this
.
traceCache
)
this
.
traceAnalyser
=
new
TraceAnalyser
(
this
.
traceCache
)
this
.
traceRetriever
=
new
TraceRetriever
({
web3
:
this
.
web3
})
this
.
traceRetriever
=
new
TraceRetriever
({
web3
:
this
.
web3
})
this
.
traceStepManager
=
new
TraceStepManager
(
this
.
traceAnalyser
)
this
.
traceStepManager
=
new
TraceStepManager
(
this
.
traceAnalyser
,
{
web3
:
this
.
web3
}
)
this
.
tx
this
.
tx
}
}
...
...
remix-lib/src/trace/traceStepManager.js
View file @
2ab6293f
'use strict'
'use strict'
var
traceHelper
=
require
(
'../helpers/traceHelper'
)
var
traceHelper
=
require
(
'../helpers/traceHelper'
)
var
Debugger
=
require
(
'../../../remix-debug'
).
EthDebugger
var
util
=
require
(
'../util'
)
var
util
=
require
(
'../util'
)
function
TraceStepManager
(
_traceAnalyser
)
{
function
TraceStepManager
(
_traceAnalyser
,
opts
)
{
this
.
traceAnalyser
=
_traceAnalyser
this
.
traceAnalyser
=
_traceAnalyser
this
.
debugger
=
new
Debugger
({
web3
:
opts
.
web3
})
}
}
TraceStepManager
.
prototype
.
isCallInstruction
=
function
(
index
)
{
TraceStepManager
.
prototype
.
isCallInstruction
=
function
(
index
)
{
...
@@ -27,7 +29,7 @@ TraceStepManager.prototype.findStepOverBack = function (currentStep) {
...
@@ -27,7 +29,7 @@ TraceStepManager.prototype.findStepOverBack = function (currentStep) {
}
}
TraceStepManager
.
prototype
.
findStepOverForward
=
function
(
currentStep
)
{
TraceStepManager
.
prototype
.
findStepOverForward
=
function
(
currentStep
)
{
if
(
this
.
isCallInstruction
(
currentStep
))
{
if
(
this
.
isCallInstruction
(
currentStep
)
||
this
.
debugger
.
callTree
.
internalFunctionCalls
.
includes
(
currentStep
)
)
{
var
call
=
util
.
findCall
(
currentStep
+
1
,
this
.
traceAnalyser
.
traceCache
.
callsTree
.
call
)
var
call
=
util
.
findCall
(
currentStep
+
1
,
this
.
traceAnalyser
.
traceCache
.
callsTree
.
call
)
return
call
.
return
+
1
<
this
.
traceAnalyser
.
trace
.
length
?
call
.
return
+
1
:
this
.
traceAnalyser
.
trace
.
length
-
1
return
call
.
return
+
1
<
this
.
traceAnalyser
.
trace
.
length
?
call
.
return
+
1
:
this
.
traceAnalyser
.
trace
.
length
-
1
}
else
{
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment