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
22ac28fe
Commit
22ac28fe
authored
Jul 06, 2020
by
Iuri Matias
Committed by
aniket-engg
Aug 25, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor getCurrentCalledAddressAt
parent
2db6ff85
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
74 deletions
+15
-74
VmDebugger.js
libs/remix-debug/src/debugger/VmDebugger.js
+0
-1
solidityLocals.js
libs/remix-debug/src/debugger/solidityLocals.js
+1
-1
internalCallTree.js
libs/remix-debug/src/solidity-decoder/internalCallTree.js
+10
-11
traceManager.js
libs/remix-lib/src/trace/traceManager.js
+4
-61
No files found.
libs/remix-debug/src/debugger/VmDebugger.js
View file @
22ac28fe
...
@@ -111,7 +111,6 @@ class VmDebuggerLogic {
...
@@ -111,7 +111,6 @@ class VmDebuggerLogic {
}
}
})
})
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
log
(
error
)
}
}
this
.
_traceManager
.
getCurrentStep
(
index
,
(
error
,
step
)
=>
{
this
.
_traceManager
.
getCurrentStep
(
index
,
(
error
,
step
)
=>
{
...
...
libs/remix-debug/src/debugger/solidityLocals.js
View file @
22ac28fe
...
@@ -34,7 +34,7 @@ class DebuggerSolidityLocals {
...
@@ -34,7 +34,7 @@ class DebuggerSolidityLocals {
this
.
traceManager
.
waterfall
([
this
.
traceManager
.
waterfall
([
this
.
traceManager
.
getStackAt
,
this
.
traceManager
.
getStackAt
,
this
.
traceManager
.
getMemoryAt
,
this
.
traceManager
.
getMemoryAt
,
(
stepIndex
,
next
)
=>
{
function
getCurrentCalledAddressAt
(
stepIndex
,
next
)
{
try
{
try
{
const
address
=
this
.
traceManager
.
getCurrentCalledAddressAt
(
stepIndex
)
const
address
=
this
.
traceManager
.
getCurrentCalledAddressAt
(
stepIndex
)
next
(
null
,
address
)
next
(
null
,
address
)
...
...
libs/remix-debug/src/solidity-decoder/internalCallTree.js
View file @
22ac28fe
...
@@ -126,19 +126,18 @@ class InternalCallTree {
...
@@ -126,19 +126,18 @@ class InternalCallTree {
extractSourceLocation
(
step
)
{
extractSourceLocation
(
step
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
this
.
traceManager
.
getCurrentCalledAddressAt
(
step
,
(
error
,
address
)
=>
{
try
{
if
(
!
error
)
{
const
address
=
this
.
traceManager
.
getCurrentCalledAddressAt
(
step
)
try
{
try
{
this
.
sourceLocationTracker
.
getSourceLocationFromVMTraceIndex
(
address
,
step
,
this
.
solidityProxy
.
contracts
).
then
(
resolve
).
catch
((
error
)
=>
{
this
.
sourceLocationTracker
.
getSourceLocationFromVMTraceIndex
(
address
,
step
,
this
.
solidityProxy
.
contracts
).
then
(
resolve
).
catch
((
error
)
=>
{
return
reject
(
'InternalCallTree - Cannot retrieve sourcelocation for step '
+
step
+
' '
+
error
)
return
reject
(
'InternalCallTree - Cannot retrieve sourcelocation for step '
+
step
+
' '
+
error
)
})
})
}
catch
(
error
)
{
}
catch
(
error
)
{
return
reject
(
'InternalCallTree - Cannot retrieve address for step '
+
step
+
' '
+
error
)
}
}
else
{
return
reject
(
'InternalCallTree - Cannot retrieve address for step '
+
step
+
' '
+
error
)
return
reject
(
'InternalCallTree - Cannot retrieve address for step '
+
step
+
' '
+
error
)
}
}
})
}
catch
(
error
)
{
return
reject
(
'InternalCallTree - Cannot retrieve address for step '
+
step
+
' '
+
error
)
}
})
})
}
}
...
...
libs/remix-lib/src/trace/traceManager.js
View file @
22ac28fe
...
@@ -140,24 +140,10 @@ TraceManager.prototype.getStackAt = function (stepIndex, callback) {
...
@@ -140,24 +140,10 @@ TraceManager.prototype.getStackAt = function (stepIndex, callback) {
}
}
}
}
// TraceManager.prototype.getLastCallChangeSince = function (stepIndex, callback) {
// const check = this.checkRequestedStep(stepIndex)
// if (check) {
// return callback(check, null)
// }
// const callChange = util.findCall(stepIndex, this.traceCache.callsTree.call)
// if (callChange === null) {
// callback(null, 0)
// } else {
// callback(null, callChange)
// }
// }
TraceManager
.
prototype
.
getLastCallChangeSince
=
function
(
stepIndex
)
{
TraceManager
.
prototype
.
getLastCallChangeSince
=
function
(
stepIndex
)
{
try
{
try
{
this
.
checkRequestedStep
(
stepIndex
)
this
.
checkRequestedStep
(
stepIndex
)
}
catch
(
check
)
{
}
catch
(
check
)
{
// return callback(check, null)
throw
new
Error
(
check
)
throw
new
Error
(
check
)
}
}
...
@@ -168,59 +154,16 @@ TraceManager.prototype.getLastCallChangeSince = function (stepIndex) {
...
@@ -168,59 +154,16 @@ TraceManager.prototype.getLastCallChangeSince = function (stepIndex) {
return
callChange
return
callChange
}
}
// TraceManager.prototype.getCurrentCalledAddressAt = function (stepIndex, callback) {
TraceManager
.
prototype
.
getCurrentCalledAddressAt
=
function
(
stepIndex
)
{
// const check = this.checkRequestedStep(stepIndex)
// if (check) {
// return callback(check, null)
// }
// this.getLastCallChangeSince(stepIndex, function (error, resp) {
// if (error) {
// callback(error, null)
// } else {
// if (resp) {
// callback(null, resp.address)
// } else {
// callback('unable to get current called address. ' + stepIndex + ' does not match with a CALL')
// }
// }
// })
// }
// TraceManager.prototype.getCurrentCalledAddressAt = function (stepIndex) {
// const check = this.checkRequestedStep(stepIndex)
// if (check) {
// // return callback(check, null)
// throw new Error(check)
// }
// try {
// const resp = this.getLastCallChangeSince(stepIndex)
// if (!resp) {
// throw new Error('unable to get current called address. ' + stepIndex + ' does not match with a CALL')
// }
// return resp.address
// } catch (error) {
// throw new Error(error)
// }
// }
TraceManager
.
prototype
.
getCurrentCalledAddressAt
=
function
(
stepIndex
,
callback
)
{
try
{
try
{
this
.
checkRequestedStep
(
stepIndex
)
this
.
checkRequestedStep
(
stepIndex
)
}
catch
(
check
)
{
return
callback
(
check
,
null
)
}
try
{
const
resp
=
this
.
getLastCallChangeSince
(
stepIndex
)
const
resp
=
this
.
getLastCallChangeSince
(
stepIndex
)
if
(
!
resp
)
{
if
(
!
resp
)
{
// throw new Error('unable to get current called address. ' + stepIndex + ' does not match with a CALL')
throw
new
Error
(
'unable to get current called address. '
+
stepIndex
+
' does not match with a CALL'
)
callback
(
'unable to get current called address. '
+
stepIndex
+
' does not match with a CALL'
)
}
}
// return resp.address
return
resp
.
address
return
callback
(
null
,
resp
.
address
)
}
catch
(
error
)
{
}
catch
(
error
)
{
// throw new Error(error)
throw
new
Error
(
error
)
return
callback
(
error
)
}
}
}
}
...
...
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