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
9e107f8b
Commit
9e107f8b
authored
Apr 14, 2016
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add assembly items
parent
81fb02da
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
163 additions
and
8 deletions
+163
-8
assemblyItemsBrowser.js
src/assemblyItemsBrowser.js
+154
-0
debugger.js
src/debugger.js
+3
-2
txBrowser.js
src/txBrowser.js
+1
-2
vmTraceBrowser.js
src/vmTraceBrowser.js
+2
-1
vmTraceManager.js
src/vmTraceManager.js
+1
-1
web3Admin.js
src/web3Admin.js
+2
-2
No files found.
src/assemblyItemsBrowser.js
0 → 100644
View file @
9e107f8b
var
React
=
require
(
'react'
);
module
.
exports
=
React
.
createClass
({
getInitialState
:
function
()
{
return
{
currentSelected
:
null
,
currentAddress
:
null
};
},
getDefaultProps
:
function
()
{
return
{
vmTrace
:
null
};
},
render
:
function
()
{
if
(
!
this
.
props
.
vmTrace
||
!
this
.
props
.
vmTrace
.
vmtrace
||
this
.
props
.
vmTrace
.
vmtrace
.
length
===
0
)
return
null
;
this
.
state
.
currentAddress
=
this
.
props
.
vmTrace
.
vmtrace
[
0
].
address
this
.
state
.
currentSelected
=
this
.
props
.
vmTrace
.
codesmap
[
this
.
state
.
currentAddress
][
this
.
props
.
vmTrace
.
vmtrace
[
0
].
pc
]
return
(
<
div
>
<
div
id
=
"action"
>
<
button
onClick
=
{
this
.
stepIntoBack
}
>
stepIntoBack
<
/button
>
<
button
onClick
=
{
this
.
stepOverBack
}
>
stepOverBack
<
/button
>
<
button
onClick
=
{
this
.
stepOverForward
}
>
stepOverForward
<
/button
>
<
button
onClick
=
{
this
.
stepIntoForward
}
>
stepIntoForward
<
/button
>
<
/div
>
<
div
>
<
select
size
=
"10"
ref
=
'itemsList'
value
=
{
this
.
state
.
currentSelected
}
>
{
this
.
renderAssemblyItems
()
}
<
/select
>
<
/div
>
<
/div
>
);
},
renderAssemblyItems
:
function
()
{
if
(
this
.
props
.
vmTrace
)
{
var
selectedItem
=
this
.
state
.
currentSelected
return
this
.
props
.
vmTrace
.
vmtrace
.
map
(
function
(
item
,
i
)
{
return
<
option
key
=
{
i
}
value
=
{
i
}
>
{
item
.
instname
}
<
/option>
;
});
}
},
stepIntoBack
:
function
()
{
this
.
moveSelection
(
-
1
)
},
stepOverBack
:
function
()
{
if
(
this
.
isReturnInstruction
(
this
.
state
.
currentSelected
-
1
))
this
.
stepOutBack
();
else
this
.
moveSelection
(
-
1
);
},
stepOverForward
:
function
()
{
if
(
this
.
isCallInstruction
(
this
.
state
.
currentSelected
))
this
.
stepOutForward
();
else
this
.
moveSelection
(
1
);
},
stepIntoForward
:
function
()
{
this
.
moveSelection
(
1
)
},
stepOverBack
:
function
()
{
if
(
this
.
isReturnInstruction
(
this
.
state
.
currentSelected
-
1
))
this
.
stepOutBack
();
else
this
.
moveSelection
(
-
1
);
},
stepOverForward
:
function
()
{
if
(
this
.
isCallInstruction
(
this
.
state
.
currentSelected
))
this
.
stepOutForward
();
else
this
.
moveSelection
(
1
);
},
isCallInstruction
:
function
(
index
)
{
var
state
=
this
.
props
.
vmTrace
.
vmtrace
[
index
];
return
state
.
instname
===
"CALL"
||
state
.
instname
===
"CREATE"
;
},
isReturnInstruction
:
function
(
index
)
{
var
state
=
this
.
props
.
vmTrace
.
vmtrace
[
index
];
return
state
.
instname
===
"RETURN"
},
stepOutBack
:
function
()
{
var
i
=
this
.
state
.
currentSelected
-
1
;
var
depth
=
0
;
while
(
--
i
>=
0
)
{
if
(
this
.
isCallInstruction
(
i
))
if
(
depth
==
0
)
break
;
else
depth
--
;
else
if
(
this
.
isReturnInstruction
(
i
))
depth
++
;
}
this
.
selectState
(
i
);
},
stepOutForward
:
function
()
{
var
i
=
this
.
state
.
currentSelected
;
var
depth
=
0
;
while
(
++
i
<
this
.
props
.
vmTrace
.
vmtrace
.
length
)
{
if
(
this
.
isReturnInstruction
(
i
))
if
(
depth
==
0
)
break
;
else
depth
--
;
else
if
(
this
.
isCallInstruction
(
i
))
depth
++
;
}
this
.
selectState
(
i
+
1
);
},
moveSelection
:
function
(
incr
)
{
this
.
selectState
(
this
.
state
.
currentSelected
+
incr
)
},
selectState
:
function
(
index
)
{
var
newIndex
=
this
.
props
.
vmTrace
.
codesmap
[
this
.
state
.
currentAddress
][
this
.
props
.
vmTrace
.
vmtrace
[
index
].
pc
]
this
.
state
.
currentSelected
=
index
this
.
refs
.
itemsList
.
value
=
this
.
state
.
currentSelected
if
(
this
.
props
.
vmTrace
.
vmtrace
[
index
].
address
&&
this
.
state
.
currentAddress
!==
this
.
props
.
vmTrace
.
vmtrace
[
index
].
address
)
this
.
state
.
currentAddress
=
this
.
props
.
vmTrace
.
vmtrace
[
index
].
address
},
})
src/debugger.js
View file @
9e107f8b
...
...
@@ -9,8 +9,9 @@ module.exports = React.createClass({
},
render
:
function
()
{
return
(
<
div
>
<
p
><
h1
>
Debugger
<
/h1></
p
>
return
(
<
div
>
<
h1
>
Debugger
<
/h1
>
<
TxBrowser
onNewTxRequested
=
{
this
.
retrieveVmTrace
}
/
>
<
VmTraceBrowser
vmTrace
=
{
this
.
state
.
vmTrace
}
/
>
<
/div
>
...
...
src/txBrowser.js
View file @
9e107f8b
...
...
@@ -11,7 +11,7 @@ module.exports = React.createClass({
submit
:
function
()
{
this
.
props
.
onNewTxRequested
(
this
.
state
.
blockNumber
,
parseInt
(
this
.
state
.
txNumber
)
,
"TmrjdiILLn0="
);
this
.
props
.
onNewTxRequested
(
this
.
state
.
blockNumber
,
parseInt
(
this
.
state
.
txNumber
));
},
updateBlockN
:
function
(
ev
)
{
...
...
@@ -23,7 +23,6 @@ module.exports = React.createClass({
},
render
:
function
()
{
return
(
<
div
>
<
div
><
h3
>
Transaction
details
<
/h3></
div
>
...
...
src/vmTraceBrowser.js
View file @
9e107f8b
var
React
=
require
(
'react'
);
var
AssemblyItemsBrowser
=
require
(
'./assemblyItemsBrowser'
);
module
.
exports
=
React
.
createClass
({
render
:
function
()
{
return
(
<
div
>
{
this
.
props
.
vmTrace
}
<
/div>
)
return
(
<
AssemblyItemsBrowser
vmTrace
=
{
this
.
props
.
vmTrace
}
/>
)
}
});
src/vmTraceManager.js
View file @
9e107f8b
module
.
exports
=
{
retrieveVmTrace
:
function
(
blockNumber
,
txNumber
)
{
return
web3
.
admin
.
vmTrace
(
blockNumber
,
parseInt
(
txNumber
)
,
"TmrjdiILLn0="
);
return
web3
.
admin
.
vmTrace
(
blockNumber
,
parseInt
(
txNumber
));
}
}
src/web3Admin.js
View file @
9e107f8b
...
...
@@ -58,8 +58,8 @@ module.exports = {
new
web3
.
_extend
.
Method
({
name
:
'vmTrace'
,
call
:
'admin_eth_vmTrace'
,
inputFormatter
:
[
null
,
null
,
null
],
params
:
3
inputFormatter
:
[
null
,
null
],
params
:
2
}),
],
properties
:
...
...
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