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
4716dad8
Commit
4716dad8
authored
Jan 31, 2017
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
retrieve sourcelocation and test against current
parent
2a181ebd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
21 deletions
+19
-21
localDecoder.js
src/solidity/localDecoder.js
+2
-2
SolidityLocals.js
src/ui/SolidityLocals.js
+17
-19
No files found.
src/solidity/localDecoder.js
View file @
4716dad8
'use strict'
function
solidityLocals
(
vmtraceIndex
,
internalTreeCall
,
stack
,
memory
,
storage
)
{
function
solidityLocals
(
vmtraceIndex
,
internalTreeCall
,
stack
,
memory
,
storage
,
currentSourceLocation
)
{
var
scope
=
internalTreeCall
.
findScope
(
vmtraceIndex
)
if
(
!
scope
)
{
var
error
=
{
'message'
:
'Can
\'
t display locals. reason: compilation result might not have been provided'
}
...
...
@@ -10,7 +10,7 @@ function solidityLocals (vmtraceIndex, internalTreeCall, stack, memory, storage)
memory
=
formatMemory
(
memory
)
for
(
var
local
in
scope
.
locals
)
{
let
variable
=
scope
.
locals
[
local
]
if
(
variable
.
stackDepth
<
stack
.
length
)
{
if
(
variable
.
stackDepth
<
stack
.
length
&&
variable
.
sourceLocation
.
start
<=
currentSourceLocation
.
start
)
{
locals
[
variable
.
name
]
=
variable
.
type
.
decodeFromStack
(
variable
.
stackDepth
,
stack
,
memory
,
storage
)
}
}
...
...
src/ui/SolidityLocals.js
View file @
4716dad8
...
...
@@ -38,26 +38,24 @@ class SolidityLocals {
if
(
this
.
parent
.
currentStepIndex
!==
index
)
return
this
.
traceManager
.
waterfall
([
this
.
traceManager
.
getStackAt
,
this
.
traceManager
.
getMemoryAt
],
index
,
(
error
,
result
)
=>
{
if
(
!
error
)
{
var
stack
=
result
[
0
].
value
var
memory
=
result
[
1
].
value
try
{
this
.
traceManager
.
getStorageAt
(
index
,
this
.
parent
.
tx
,
(
error
,
storage
)
=>
{
if
(
!
error
)
{
var
locals
=
localDecoder
.
solidityLocals
(
index
,
this
.
internalTreeCall
,
stack
,
memory
,
storage
)
this
.
basicPanel
.
update
(
locals
)
}
})
}
catch
(
e
)
{
warningDiv
.
innerHTML
=
e
.
message
this
.
parent
.
event
.
register
(
'sourceLocationChanged'
,
this
,
(
sourceLocation
)
=>
{
this
.
traceManager
.
waterfall
([
this
.
traceManager
.
getStackAt
,
this
.
traceManager
.
getMemoryAt
],
index
,
(
error
,
result
)
=>
{
if
(
!
error
)
{
var
stack
=
result
[
0
].
value
var
memory
=
result
[
1
].
value
try
{
var
locals
=
localDecoder
.
solidityLocals
(
index
,
this
.
internalTreeCall
,
stack
,
memory
,
sourceLocation
)
this
.
basicPanel
.
update
(
locals
)
}
catch
(
e
)
{
warningDiv
.
innerHTML
=
e
.
message
}
}
}
})
}
)
})
})
}
}
...
...
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