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
a2056a49
Commit
a2056a49
authored
Jul 19, 2020
by
Iuri Matias
Committed by
aniket-engg
Aug 25, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor getCallDataAt
parent
97a19aa2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
18 deletions
+19
-18
VmDebugger.js
libs/remix-debug/src/debugger/VmDebugger.js
+6
-6
traceManager.js
libs/remix-lib/src/trace/traceManager.js
+6
-4
traceManager.js
libs/remix-lib/test/traceManager.js
+7
-8
No files found.
libs/remix-debug/src/debugger/VmDebugger.js
View file @
a2056a49
...
...
@@ -60,14 +60,14 @@ class VmDebuggerLogic {
this
.
event
.
trigger
(
'functionsStackUpdate'
,
[
this
.
_callTree
.
retrieveFunctionsStack
(
index
)])
this
.
_traceManager
.
getCallDataAt
(
index
,
(
error
,
calldata
)
=>
{
if
(
error
)
{
// console.log(error)
this
.
event
.
trigger
(
'traceManagerCallDataUpdate'
,
[{}])
}
else
if
(
this
.
stepManager
.
currentStepIndex
===
index
)
{
try
{
const
calldata
=
this
.
_traceManager
.
getCallDataAt
(
index
)
if
(
this
.
stepManager
.
currentStepIndex
===
index
)
{
this
.
event
.
trigger
(
'traceManagerCallDataUpdate'
,
[
calldata
])
}
})
}
catch
(
error
)
{
this
.
event
.
trigger
(
'traceManagerCallDataUpdate'
,
[{}])
}
try
{
const
memory
=
this
.
_traceManager
.
getMemoryAt
(
index
)
...
...
libs/remix-lib/src/trace/traceManager.js
View file @
a2056a49
...
...
@@ -88,15 +88,17 @@ TraceManager.prototype.getAddresses = function () {
return
this
.
traceCache
.
addresses
}
TraceManager
.
prototype
.
getCallDataAt
=
function
(
stepIndex
,
callback
)
{
TraceManager
.
prototype
.
getCallDataAt
=
function
(
stepIndex
)
{
try
{
this
.
checkRequestedStep
(
stepIndex
)
}
catch
(
check
)
{
return
callback
(
check
,
null
)
throw
new
Error
(
check
)
}
const
callDataChange
=
util
.
findLowerBoundValue
(
stepIndex
,
this
.
traceCache
.
callDataChanges
)
if
(
callDataChange
===
null
)
return
callback
(
'no calldata found'
,
null
)
callback
(
null
,
[
this
.
traceCache
.
callsData
[
callDataChange
]])
if
(
callDataChange
===
null
)
{
throw
new
Error
(
'no calldata found'
)
}
return
[
this
.
traceCache
.
callsData
[
callDataChange
]]
}
TraceManager
.
prototype
.
buildCallPath
=
function
(
stepIndex
,
callback
)
{
...
...
libs/remix-lib/test/traceManager.js
View file @
a2056a49
...
...
@@ -61,14 +61,13 @@ tape('TraceManager', function (t) {
})
t
.
test
(
'TraceManager.getCallData'
,
function
(
st
)
{
traceManager
.
getCallDataAt
(
0
,
function
(
error
,
result
)
{
if
(
error
)
{
st
.
fail
(
error
)
}
else
{
st
.
ok
(
result
[
0
]
===
'0x60fe47b10000000000000000000000000000000000000000000000000000000000000038'
)
st
.
end
()
}
})
try
{
const
result
=
traceManager
.
getCallDataAt
(
0
)
st
.
ok
(
result
[
0
]
===
'0x60fe47b10000000000000000000000000000000000000000000000000000000000000038'
)
st
.
end
()
}
catch
(
error
)
{
st
.
fail
(
error
)
}
})
t
.
test
(
'TraceManager.getCallStackAt'
,
function
(
st
)
{
...
...
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