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
5f8b191a
Commit
5f8b191a
authored
Sep 08, 2018
by
Iuri Matias
Committed by
yann300
Nov 13, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor step detail
parent
de1e1b6c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
52 deletions
+23
-52
StepDetail.js
src/app/debugger/debuggerUI/vmDebugger/StepDetail.js
+23
-52
No files found.
src/app/debugger/debuggerUI/vmDebugger/StepDetail.js
View file @
5f8b191a
...
...
@@ -9,11 +9,25 @@ function StepDetail (_parentUI, _traceManager) {
this
.
basicPanel
=
new
DropdownPanel
(
'Step detail'
,
{
json
:
true
,
displayContentOnly
:
true
})
this
.
detail
=
initDetail
()
this
.
detail
=
{
'vm trace step'
:
'-'
,
'execution step'
:
'-'
,
'add memory'
:
''
,
'gas'
:
''
,
'remaining gas'
:
'-'
,
'loaded address'
:
'-'
}
this
.
view
this
.
init
()
}
StepDetail
.
prototype
.
reset
=
function
()
{
this
.
detail
=
{
'vm trace step'
:
'-'
,
'execution step'
:
'-'
,
'add memory'
:
''
,
'gas'
:
''
,
'remaining gas'
:
'-'
,
'loaded address'
:
'-'
}
this
.
basicPanel
.
update
(
this
.
detail
)
}
StepDetail
.
prototype
.
updateField
=
function
(
key
,
value
)
{
this
.
detail
[
key
]
=
value
this
.
basicPanel
.
update
(
this
.
detail
)
}
StepDetail
.
prototype
.
render
=
function
()
{
return
yo
`<div id='stepdetail' >
${
this
.
basicPanel
.
render
()}
</div>`
}
...
...
@@ -21,81 +35,38 @@ StepDetail.prototype.render = function () {
StepDetail
.
prototype
.
init
=
function
()
{
var
self
=
this
this
.
debugger
.
event
.
register
(
'traceUnloaded'
,
this
,
function
()
{
self
.
detail
=
initDetail
()
self
.
basicPanel
.
update
(
self
.
detail
)
self
.
reset
()
})
this
.
debugger
.
event
.
register
(
'newTraceLoaded'
,
this
,
function
()
{
self
.
detail
=
initDetail
()
self
.
basicPanel
.
update
(
self
.
detail
)
self
.
reset
()
})
this
.
parentUI
.
event
.
register
(
'indexChanged'
,
this
,
function
(
index
)
{
if
(
index
<
0
)
return
self
.
detail
[
'vm trace step'
]
=
index
self
.
updateField
(
'vm trace step'
,
index
)
self
.
traceManager
.
getCurrentStep
(
index
,
function
(
error
,
step
)
{
if
(
error
)
{
console
.
log
(
error
)
self
.
detail
[
'execution step'
]
=
'-'
}
else
{
self
.
detail
[
'execution step'
]
=
step
}
self
.
basicPanel
.
update
(
self
.
detail
)
self
.
updateField
(
'execution step'
,
(
error
?
'-'
:
step
))
})
self
.
traceManager
.
getMemExpand
(
index
,
function
(
error
,
addmem
)
{
if
(
error
)
{
console
.
log
(
error
)
self
.
detail
[
'add memory'
]
=
'-'
}
else
{
self
.
detail
[
'add memory'
]
=
addmem
}
self
.
basicPanel
.
update
(
self
.
detail
)
self
.
updateField
(
'add memory'
,
(
error
?
'-'
:
addmem
))
})
self
.
traceManager
.
getStepCost
(
index
,
function
(
error
,
gas
)
{
if
(
error
)
{
console
.
log
(
error
)
self
.
detail
.
gas
=
'-'
}
else
{
self
.
detail
.
gas
=
gas
}
self
.
basicPanel
.
update
(
self
.
detail
)
self
.
updateField
(
'gas'
,
(
error
?
'-'
:
gas
))
})
self
.
traceManager
.
getCurrentCalledAddressAt
(
index
,
function
(
error
,
address
)
{
if
(
error
)
{
console
.
log
(
error
)
self
.
detail
[
'loaded address'
]
=
'-'
}
else
{
self
.
detail
[
'loaded address'
]
=
address
}
self
.
basicPanel
.
update
(
self
.
detail
)
self
.
updateField
(
'loaded address'
,
(
error
?
'-'
:
address
))
})
self
.
traceManager
.
getRemainingGas
(
index
,
function
(
error
,
remaingas
)
{
if
(
error
)
{
console
.
log
(
error
)
self
.
detail
[
'remaining gas'
]
=
'-'
}
else
{
self
.
detail
[
'remaining gas'
]
=
remaingas
}
self
.
basicPanel
.
update
(
self
.
detail
)
self
.
updateField
(
'remaining gas'
,
(
error
?
'-'
:
remaingas
))
})
})
}
function
initDetail
()
{
return
{
'vm trace step'
:
'-'
,
'execution step'
:
'-'
,
'add memory'
:
''
,
'gas'
:
''
,
'remaining gas'
:
'-'
,
'loaded address'
:
'-'
}
}
module
.
exports
=
StepDetail
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