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
d7b46729
Commit
d7b46729
authored
Apr 22, 2016
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ui changes
parent
62be477b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
58 additions
and
24 deletions
+58
-24
assemblyItemsBrowser.js
src/assemblyItemsBrowser.js
+29
-15
basicStyles.js
src/basicStyles.js
+4
-0
debugger.js
src/debugger.js
+8
-2
txBrowser.js
src/txBrowser.js
+11
-4
vmTraceManager.js
src/vmTraceManager.js
+5
-2
web3Admin.js
src/web3Admin.js
+1
-1
No files found.
src/assemblyItemsBrowser.js
View file @
d7b46729
...
@@ -20,7 +20,7 @@ module.exports = React.createClass({
...
@@ -20,7 +20,7 @@ module.exports = React.createClass({
currentStepInfo
:
null
,
currentStepInfo
:
null
,
codes
:
{},
// assembly items instructions list by contract addesses
codes
:
{},
// assembly items instructions list by contract addesses
instructionsIndexByBytesOffset
:
{},
// mapping between bytes offset and instructions index.
instructionsIndexByBytesOffset
:
{},
// mapping between bytes offset and instructions index.
levels
:
{}
callStack
:
{}
};
};
},
},
...
@@ -35,7 +35,7 @@ module.exports = React.createClass({
...
@@ -35,7 +35,7 @@ module.exports = React.createClass({
{
{
return
(
return
(
<
div
style
=
{
this
.
props
.
vmTrace
===
null
?
style
.
hidden
:
style
.
display
}
>
<
div
style
=
{
this
.
props
.
vmTrace
===
null
?
style
.
hidden
:
style
.
display
}
>
<
div
style
=
{
style
.
container
}
><
span
style
=
{
style
.
address
}
>
{
this
.
state
.
currentAddress
}
<
/span></
div
>
<
div
style
=
{
style
.
container
}
><
span
style
=
{
style
.
address
}
>
Current
code
:
{
this
.
state
.
currentAddress
}
<
/span></
div
>
<
div
style
=
{
style
.
container
}
>
<
div
style
=
{
style
.
container
}
>
<
button
onClick
=
{
this
.
stepIntoBack
}
disabled
=
{
this
.
checkButtonState
(
-
1
)
}
>
Step
Into
Back
<
/button
>
<
button
onClick
=
{
this
.
stepIntoBack
}
disabled
=
{
this
.
checkButtonState
(
-
1
)
}
>
Step
Into
Back
<
/button
>
...
@@ -142,29 +142,36 @@ module.exports = React.createClass({
...
@@ -142,29 +142,36 @@ module.exports = React.createClass({
componentWillReceiveProps
:
function
(
nextProps
)
componentWillReceiveProps
:
function
(
nextProps
)
{
{
if
(
!
nextProps
.
vmTrace
)
return
this
.
buildCallStack
(
nextProps
.
vmTrace
)
this
.
buildCallStack
(
nextProps
.
vmTrace
)
this
.
updateState
(
nextProps
,
0
)
this
.
updateState
(
nextProps
,
0
)
},
},
buildCallStack
:
function
(
vmTrace
)
buildCallStack
:
function
(
vmTrace
)
{
{
this
.
state
.
levels
=
{}
if
(
!
vmTrace
)
var
depth
=
0
return
var
c
urrentAddress
=
vmTrace
[
0
].
address
var
c
allStack
=
[]
var
callStack
=
[
currentAddress
]
var
depth
=
-
1
for
(
var
k
in
vmTrace
)
for
(
var
k
=
1
;
k
<
vmTrace
.
length
;
k
++
)
{
{
var
trace
=
vmTrace
[
k
]
var
trace
=
vmTrace
[
k
]
if
(
trace
.
depth
===
undefined
||
trace
.
depth
===
depth
)
continue
if
(
trace
.
depth
>
depth
)
if
(
trace
.
depth
>
depth
)
callStack
.
push
(
trace
.
address
)
// new context
callStack
.
push
(
trace
.
address
)
// new context
else
if
(
trace
.
depth
<
depth
)
else
if
(
trace
.
depth
<
depth
)
callStack
.
pop
()
// returning from context
callStack
.
pop
()
// returning from context
this
.
state
.
levels
[
trace
.
steps
]
=
callStack
depth
=
trace
.
depth
this
.
state
.
callStack
[
k
]
=
callStack
.
slice
(
0
)
}
}
},
},
updateState
:
function
(
props
,
vmTraceIndex
)
updateState
:
function
(
props
,
vmTraceIndex
)
{
{
if
(
!
props
.
vmTrace
)
return
var
previousState
=
this
.
state
.
currentSelected
var
previousState
=
this
.
state
.
currentSelected
var
stateChanges
=
{}
var
stateChanges
=
{}
...
@@ -184,8 +191,11 @@ module.exports = React.createClass({
...
@@ -184,8 +191,11 @@ module.exports = React.createClass({
stateChanges
[
"currentStack"
]
=
stack
stateChanges
[
"currentStack"
]
=
stack
}
}
if
(
this
.
state
.
levels
[
vmTraceIndex
])
var
callStackIndex
=
vmTraceIndex
stateChanges
[
"currentCallStack"
]
=
this
.
state
.
levels
[
vmTraceIndex
]
if
(
vmTraceIndex
<
previousState
)
callStackIndex
=
this
.
retrieveLastSeenProperty
(
vmTraceIndex
,
"depth"
,
props
.
vmTrace
)
if
(
this
.
state
.
callStack
[
callStackIndex
]
||
callStackIndex
===
0
)
stateChanges
[
"currentCallStack"
]
=
this
.
state
.
callStack
[
callStackIndex
]
var
storageIndex
=
vmTraceIndex
var
storageIndex
=
vmTraceIndex
if
(
vmTraceIndex
<
previousState
)
if
(
vmTraceIndex
<
previousState
)
...
@@ -199,8 +209,12 @@ module.exports = React.createClass({
...
@@ -199,8 +209,12 @@ module.exports = React.createClass({
if
(
props
.
vmTrace
[
memoryIndex
].
memory
||
memoryIndex
===
0
)
if
(
props
.
vmTrace
[
memoryIndex
].
memory
||
memoryIndex
===
0
)
stateChanges
[
"currentMemory"
]
=
this
.
formatMemory
(
props
.
vmTrace
[
memoryIndex
].
memory
,
16
)
stateChanges
[
"currentMemory"
]
=
this
.
formatMemory
(
props
.
vmTrace
[
memoryIndex
].
memory
,
16
)
if
(
props
.
vmTrace
[
vmTraceIndex
].
calldata
)
var
callDataIndex
=
vmTraceIndex
stateChanges
[
"currentCallData"
]
=
props
.
vmTrace
[
vmTraceIndex
].
calldata
if
(
vmTraceIndex
<
previousState
)
callDataIndex
=
this
.
retrieveLastSeenProperty
(
vmTraceIndex
,
"calldata"
,
props
.
vmTrace
)
if
(
props
.
vmTrace
[
vmTraceIndex
].
calldata
||
callDataIndex
===
0
)
stateChanges
[
"currentCallData"
]
=
[
props
.
vmTrace
[
callDataIndex
].
calldata
]
stateChanges
[
"selectedInst"
]
=
this
.
state
.
instructionsIndexByBytesOffset
[
currentAddress
][
props
.
vmTrace
[
vmTraceIndex
].
pc
]
stateChanges
[
"selectedInst"
]
=
this
.
state
.
instructionsIndexByBytesOffset
[
currentAddress
][
props
.
vmTrace
[
vmTraceIndex
].
pc
]
stateChanges
[
"currentSelected"
]
=
vmTraceIndex
stateChanges
[
"currentSelected"
]
=
vmTraceIndex
...
@@ -225,8 +239,8 @@ module.exports = React.createClass({
...
@@ -225,8 +239,8 @@ module.exports = React.createClass({
}
}
return
index
return
index
},
},
stepIntoBack
:
function
()
stepIntoBack
:
function
()
{
{
this
.
moveSelection
(
-
1
)
this
.
moveSelection
(
-
1
)
},
},
...
@@ -271,7 +285,7 @@ module.exports = React.createClass({
...
@@ -271,7 +285,7 @@ module.exports = React.createClass({
isCallInstruction
:
function
(
index
)
isCallInstruction
:
function
(
index
)
{
{
var
state
=
this
.
props
.
vmTrace
[
index
];
var
state
=
this
.
props
.
vmTrace
[
index
];
return
state
.
instname
===
"CALL"
||
state
.
instname
===
"CREATE"
||
state
.
instname
===
"DELEGATECALL"
return
state
.
instname
===
"CALL"
||
state
.
instname
===
"C
ALLCODE"
||
state
.
instname
===
"C
REATE"
||
state
.
instname
===
"DELEGATECALL"
},
},
isReturnInstruction
:
function
(
index
)
isReturnInstruction
:
function
(
index
)
...
...
src/basicStyles.js
View file @
d7b46729
...
@@ -16,6 +16,10 @@ module.exports = {
...
@@ -16,6 +16,10 @@ module.exports = {
{
{
'width'
:
"320px"
'width'
:
"320px"
},
},
transactionInfo
:
{
'marginTop'
:
'5px'
},
panel
:
panel
:
{
{
container
:
container
:
...
...
src/debugger.js
View file @
d7b46729
...
@@ -6,7 +6,7 @@ var style = require('./basicStyles')
...
@@ -6,7 +6,7 @@ var style = require('./basicStyles')
module
.
exports
=
React
.
createClass
({
module
.
exports
=
React
.
createClass
({
getInitialState
:
function
()
{
getInitialState
:
function
()
{
return
{
vmTrace
:
null
}
return
{
vmTrace
:
null
,
state
:
""
}
},
},
render
:
function
()
{
render
:
function
()
{
...
@@ -14,6 +14,7 @@ module.exports = React.createClass({
...
@@ -14,6 +14,7 @@ module.exports = React.createClass({
<
div
style
=
{
style
.
wrapper
}
>
<
div
style
=
{
style
.
wrapper
}
>
<
h1
style
=
{
style
.
container
}
>
Eth
Debugger
<
/h1
>
<
h1
style
=
{
style
.
container
}
>
Eth
Debugger
<
/h1
>
<
TxBrowser
onNewTxRequested
=
{
this
.
retrieveVmTrace
}
/
>
<
TxBrowser
onNewTxRequested
=
{
this
.
retrieveVmTrace
}
/
>
<
div
style
=
{
style
.
container
}
>
{
this
.
state
.
state
}
<
/div
>
<
VmTraceBrowser
vmTrace
=
{
this
.
state
.
vmTrace
}
/
>
<
VmTraceBrowser
vmTrace
=
{
this
.
state
.
vmTrace
}
/
>
<
/div
>
<
/div
>
);
);
...
@@ -21,6 +22,11 @@ module.exports = React.createClass({
...
@@ -21,6 +22,11 @@ module.exports = React.createClass({
retrieveVmTrace
:
function
(
blockNumber
,
txNumber
)
retrieveVmTrace
:
function
(
blockNumber
,
txNumber
)
{
{
this
.
setState
({
vmTrace
:
VmTraceManager
.
retrieveVmTrace
(
blockNumber
,
txNumber
)});
this
.
setState
({
state
:
"loading..."
})
var
deb
=
this
VmTraceManager
.
retrieveVmTrace
(
blockNumber
,
txNumber
,
function
(
error
,
result
)
{
deb
.
setState
({
vmTrace
:
result
,
state
:
""
});
})
}
}
});
});
src/txBrowser.js
View file @
d7b46729
...
@@ -7,12 +7,14 @@ module.exports = React.createClass({
...
@@ -7,12 +7,14 @@ module.exports = React.createClass({
},
},
getInitialState
:
function
()
{
getInitialState
:
function
()
{
return
{
blockNumber
:
"1
160004"
,
txNumber
:
"1
"
}
return
{
blockNumber
:
"1
382256"
,
txNumber
:
"1"
,
from
:
""
,
to
:
""
,
hash
:
"
"
}
},
},
submit
:
function
()
submit
:
function
()
{
{
this
.
props
.
onNewTxRequested
(
this
.
state
.
blockNumber
,
parseInt
(
this
.
state
.
txNumber
));
var
tx
=
web3
.
eth
.
getTransactionFromBlock
(
this
.
state
.
blockNumber
,
this
.
state
.
txNumber
)
this
.
setState
({
from
:
tx
.
from
,
to
:
tx
.
to
,
hash
:
tx
.
hash
})
this
.
props
.
onNewTxRequested
(
this
.
state
.
blockNumber
,
parseInt
(
this
.
state
.
txNumber
))
},
},
updateBlockN
:
function
(
ev
)
{
updateBlockN
:
function
(
ev
)
{
...
@@ -26,9 +28,14 @@ module.exports = React.createClass({
...
@@ -26,9 +28,14 @@ module.exports = React.createClass({
render
:
function
()
{
render
:
function
()
{
return
(
return
(
<
div
style
=
{
style
.
container
}
>
<
div
style
=
{
style
.
container
}
>
<
input
onChange
=
{
this
.
updateBlockN
}
type
=
"text"
placeholder
=
{
"Block number or hash
e.g. :
"
+
this
.
state
.
blockNumber
}
><
/input
>
<
input
onChange
=
{
this
.
updateBlockN
}
type
=
"text"
placeholder
=
{
"Block number or hash
(default 1382256)
"
+
this
.
state
.
blockNumber
}
><
/input
>
<
input
onChange
=
{
this
.
updateTxN
}
type
=
"text"
placeholder
=
{
"Transaction Number
e.g. :
"
+
this
.
state
.
txNumber
}
><
/input
>
<
input
onChange
=
{
this
.
updateTxN
}
type
=
"text"
placeholder
=
{
"Transaction Number
(default 1)
"
+
this
.
state
.
txNumber
}
><
/input
>
<
button
onClick
=
{
this
.
submit
}
>
Get
<
/button
>
<
button
onClick
=
{
this
.
submit
}
>
Get
<
/button
>
<
div
style
=
{
style
.
transactionInfo
}
>
<
div
>
Hash
:
{
this
.
state
.
hash
}
<
/div
>
<
div
>
From
:
{
this
.
state
.
from
}
<
/div
>
<
div
>
To
:
{
this
.
state
.
to
}
<
/div
>
<
/div
>
<
/div
>
<
/div
>
);
);
}
}
...
...
src/vmTraceManager.js
View file @
d7b46729
module
.
exports
=
{
module
.
exports
=
{
retrieveVmTrace
:
function
(
blockNumber
,
txNumber
)
{
retrieveVmTrace
:
function
(
blockNumber
,
txNumber
,
callBack
)
{
return
web3
.
debug
.
debugTrace
(
blockNumber
,
parseInt
(
txNumber
));
web3
.
debug
.
trace
(
blockNumber
,
parseInt
(
txNumber
),
function
(
error
,
result
)
{
callBack
(
error
,
result
)
});
}
}
}
}
src/web3Admin.js
View file @
d7b46729
...
@@ -93,7 +93,7 @@ module.exports = {
...
@@ -93,7 +93,7 @@ module.exports = {
methods
:
methods
:
[
[
new
web3
.
_extend
.
Method
({
new
web3
.
_extend
.
Method
({
name
:
'
debugT
race'
,
name
:
'
t
race'
,
call
:
'debug_trace'
,
call
:
'debug_trace'
,
params
:
1
,
params
:
1
,
inputFormatter
:
[
null
,
null
],
inputFormatter
:
[
null
,
null
],
...
...
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