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
1d56742b
Commit
1d56742b
authored
Dec 15, 2016
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add comments
parent
9c57922a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
internalCallTree.js
src/util/internalCallTree.js
+36
-0
No files found.
src/util/internalCallTree.js
View file @
1d56742b
...
...
@@ -5,7 +5,20 @@ var EventManager = require('../lib/eventManager')
var
decodeInfo
=
require
(
'../solidity/decodeInfo'
)
var
util
=
require
(
'../helpers/util'
)
/**
* Tree representing internal jump into function.
* Trigger `callTreeReady` event when tree is ready
*/
class
InternalCallTree
{
/**
* constructor
*
* @param {Object} debuggerEvent - event declared by the debugger (EthDebugger)
* @param {Object} traceManager - trace manager
* @param {Object} solidityProxy - solidity proxy
* @param {Object} codeManager - code manager
* @param {Object} opts - { includeLocalVariables }
*/
constructor
(
debuggerEvent
,
traceManager
,
solidityProxy
,
codeManager
,
opts
)
{
this
.
includeLocalVariables
=
opts
.
includeLocalVariables
this
.
event
=
new
EventManager
()
...
...
@@ -23,13 +36,28 @@ class InternalCallTree {
})
}
/**
* reset tree
*
*/
reset
()
{
/*
scopes: map of scopes defined by range in the vmtrace {firstStep, lastStep, locals}. Keys represent the level of deepness (scopeId)
*/
this
.
scopes
=
{}
/*
scopeStart: represent start of a new scope. Keys are index in the vmtrace, values are scopeId
*/
this
.
scopeStarts
=
{}
this
.
variableDeclarationByFile
=
{}
this
.
astWalker
=
new
AstWalker
()
}
/**
* find the scope given @arg vmTraceIndex
*
* @param {Int} vmtraceIndex - index on the vm trace
*/
findScope
(
vmtraceIndex
)
{
var
scopes
=
Object
.
keys
(
this
.
scopeStarts
)
if
(
!
scopes
.
length
)
{
...
...
@@ -48,6 +76,14 @@ class InternalCallTree {
}
}
/**
* build tree (called recursively)
*
* @param {Object} tree - instance of InternalCallTree
* @param {Int} step - index on the vm trace
* @param {String} scopeId - deepness of the current scope
* @param {Object} trace - vm trace
*/
function
buildTree
(
tree
,
step
,
scopeId
,
trace
)
{
let
subScope
=
1
tree
.
scopeStarts
[
step
]
=
scopeId
...
...
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