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
d63a3e10
Commit
d63a3e10
authored
Jun 20, 2016
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add indexChanged event
parent
e5594b7c
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
92 additions
and
66 deletions
+92
-66
calldataPanel.js
src/calldataPanel.js
+11
-7
callstackPanel.js
src/callstackPanel.js
+11
-7
codeManager.js
src/codeManager.js
+2
-0
debugger.js
src/debugger.js
+14
-4
memoryPanel.js
src/memoryPanel.js
+11
-7
stackPanel.js
src/stackPanel.js
+11
-7
stepManager.js
src/stepManager.js
+9
-6
sticker.js
src/sticker.js
+12
-8
storagePanel.js
src/storagePanel.js
+11
-7
vmDebugger.js
src/vmDebugger.js
+0
-13
No files found.
src/calldataPanel.js
View file @
d63a3e10
...
@@ -4,7 +4,9 @@ var BasicPanel = require('./basicPanel')
...
@@ -4,7 +4,9 @@ var BasicPanel = require('./basicPanel')
module
.
exports
=
React
.
createClass
({
module
.
exports
=
React
.
createClass
({
contextTypes
:
{
contextTypes
:
{
traceManager
:
React
.
PropTypes
.
object
traceManager
:
React
.
PropTypes
.
object
,
codeManager
:
React
.
PropTypes
.
object
,
root
:
React
.
PropTypes
.
object
},
},
getDefaultProps
:
function
()
{
getDefaultProps
:
function
()
{
...
@@ -25,20 +27,22 @@ module.exports = React.createClass({
...
@@ -25,20 +27,22 @@ module.exports = React.createClass({
)
)
},
},
componentWillReceiveProps
:
function
(
nextProps
)
{
componentDidMount
:
function
()
{
if
(
nextProps
.
currentStepIndex
<
0
)
return
if
(
window
.
ethDebuggerSelectedItem
!==
nextProps
.
currentStepIndex
)
return
var
self
=
this
var
self
=
this
this
.
context
.
traceManager
.
getCallDataAt
(
nextProps
.
currentStepIndex
,
function
(
error
,
calldata
)
{
this
.
context
.
root
.
register
(
'indexChanged'
,
this
,
function
(
index
)
{
if
(
index
<
0
)
return
if
(
window
.
ethDebuggerSelectedItem
!==
index
)
return
self
.
context
.
traceManager
.
getCallDataAt
(
index
,
function
(
error
,
calldata
)
{
if
(
error
)
{
if
(
error
)
{
console
.
log
(
error
)
console
.
log
(
error
)
}
else
if
(
window
.
ethDebuggerSelectedItem
===
nextProps
.
currentStepI
ndex
)
{
}
else
if
(
window
.
ethDebuggerSelectedItem
===
i
ndex
)
{
self
.
setState
({
self
.
setState
({
data
:
self
.
format
(
calldata
)
data
:
self
.
format
(
calldata
)
})
})
}
}
})
})
})
},
},
format
:
function
(
calldata
)
{
format
:
function
(
calldata
)
{
...
...
src/callstackPanel.js
View file @
d63a3e10
...
@@ -4,7 +4,9 @@ var BasicPanel = require('./basicPanel')
...
@@ -4,7 +4,9 @@ var BasicPanel = require('./basicPanel')
module
.
exports
=
React
.
createClass
({
module
.
exports
=
React
.
createClass
({
contextTypes
:
{
contextTypes
:
{
traceManager
:
React
.
PropTypes
.
object
traceManager
:
React
.
PropTypes
.
object
,
codeManager
:
React
.
PropTypes
.
object
,
root
:
React
.
PropTypes
.
object
},
},
getDefaultProps
:
function
()
{
getDefaultProps
:
function
()
{
...
@@ -25,20 +27,22 @@ module.exports = React.createClass({
...
@@ -25,20 +27,22 @@ module.exports = React.createClass({
)
)
},
},
componentWillReceiveProps
:
function
(
nextProps
)
{
componentDidMount
:
function
()
{
if
(
nextProps
.
currentStepIndex
<
0
)
return
if
(
window
.
ethDebuggerSelectedItem
!==
nextProps
.
currentStepIndex
)
return
var
self
=
this
var
self
=
this
this
.
context
.
traceManager
.
getCallStackAt
(
nextProps
.
currentStepIndex
,
function
(
error
,
callstack
)
{
this
.
context
.
root
.
register
(
'indexChanged'
,
this
,
function
(
index
)
{
if
(
index
<
0
)
return
if
(
window
.
ethDebuggerSelectedItem
!==
index
)
return
self
.
context
.
traceManager
.
getCallStackAt
(
index
,
function
(
error
,
callstack
)
{
if
(
error
)
{
if
(
error
)
{
console
.
log
(
error
)
console
.
log
(
error
)
}
else
if
(
window
.
ethDebuggerSelectedItem
===
nextProps
.
currentStepI
ndex
)
{
}
else
if
(
window
.
ethDebuggerSelectedItem
===
i
ndex
)
{
self
.
setState
({
self
.
setState
({
data
:
self
.
format
(
callstack
)
data
:
self
.
format
(
callstack
)
})
})
}
}
})
})
})
},
},
format
:
function
(
callstack
)
{
format
:
function
(
callstack
)
{
...
...
src/codeManager.js
View file @
d63a3e10
...
@@ -53,6 +53,7 @@ CodeManager.prototype.ensureCodeLoaded = function (address, currentStep, tx) {
...
@@ -53,6 +53,7 @@ CodeManager.prototype.ensureCodeLoaded = function (address, currentStep, tx) {
self
.
getInstructionIndex
(
address
,
currentStep
,
function
(
error
,
result
)
{
self
.
getInstructionIndex
(
address
,
currentStep
,
function
(
error
,
result
)
{
if
(
!
error
)
{
if
(
!
error
)
{
self
.
trigger
(
'codeChanged'
,
[
codes
.
code
,
address
,
result
])
self
.
trigger
(
'codeChanged'
,
[
codes
.
code
,
address
,
result
])
self
.
trigger
(
'indexChanged'
,
[
result
])
self
.
currentAddress
=
address
self
.
currentAddress
=
address
}
else
{
}
else
{
console
.
log
(
error
)
console
.
log
(
error
)
...
@@ -67,6 +68,7 @@ CodeManager.prototype.ensureCodeLoaded = function (address, currentStep, tx) {
...
@@ -67,6 +68,7 @@ CodeManager.prototype.ensureCodeLoaded = function (address, currentStep, tx) {
self
.
getInstructionIndex
(
address
,
currentStep
,
function
(
error
,
result
)
{
self
.
getInstructionIndex
(
address
,
currentStep
,
function
(
error
,
result
)
{
if
(
!
error
)
{
if
(
!
error
)
{
self
.
trigger
(
'codeChanged'
,
[
code
,
address
,
result
])
self
.
trigger
(
'codeChanged'
,
[
code
,
address
,
result
])
self
.
trigger
(
'indexChanged'
,
[
result
])
self
.
currentAddress
=
address
self
.
currentAddress
=
address
}
else
{
}
else
{
console
.
log
(
error
)
console
.
log
(
error
)
...
...
src/debugger.js
View file @
d63a3e10
...
@@ -4,6 +4,8 @@ var TxBrowser = require('./txBrowser')
...
@@ -4,6 +4,8 @@ var TxBrowser = require('./txBrowser')
var
StepManager
=
require
(
'./stepManager'
)
var
StepManager
=
require
(
'./stepManager'
)
var
VmDebugger
=
require
(
'./vmDebugger'
)
var
VmDebugger
=
require
(
'./vmDebugger'
)
var
style
=
require
(
'./basicStyles'
)
var
style
=
require
(
'./basicStyles'
)
var
util
=
require
(
'./util'
)
var
eventManager
=
require
(
'./eventManager'
)
module
.
exports
=
React
.
createClass
({
module
.
exports
=
React
.
createClass
({
getInitialState
:
function
()
{
getInitialState
:
function
()
{
...
@@ -17,6 +19,7 @@ module.exports = React.createClass({
...
@@ -17,6 +19,7 @@ module.exports = React.createClass({
web3
:
React
.
PropTypes
.
object
,
web3
:
React
.
PropTypes
.
object
,
traceManager
:
React
.
PropTypes
.
object
,
traceManager
:
React
.
PropTypes
.
object
,
codeManager
:
React
.
PropTypes
.
object
,
codeManager
:
React
.
PropTypes
.
object
,
root
:
React
.
PropTypes
.
object
,
tx
:
React
.
PropTypes
.
object
tx
:
React
.
PropTypes
.
object
},
},
...
@@ -25,6 +28,7 @@ module.exports = React.createClass({
...
@@ -25,6 +28,7 @@ module.exports = React.createClass({
web3
:
this
.
props
.
context
.
web3
,
web3
:
this
.
props
.
context
.
web3
,
traceManager
:
this
.
props
.
context
.
traceManager
,
traceManager
:
this
.
props
.
context
.
traceManager
,
codeManager
:
this
.
props
.
context
.
codeManager
,
codeManager
:
this
.
props
.
context
.
codeManager
,
root
:
this
,
tx
:
this
.
state
.
tx
tx
:
this
.
state
.
tx
}
}
},
},
...
@@ -41,12 +45,17 @@ module.exports = React.createClass({
...
@@ -41,12 +45,17 @@ module.exports = React.createClass({
},
},
stepChanged
:
function
(
stepIndex
)
{
stepChanged
:
function
(
stepIndex
)
{
this
.
trigger
(
'indexChanged'
,
[
stepIndex
])
this
.
setState
({
this
.
setState
({
currentStepIndex
:
stepIndex
currentStepIndex
:
stepIndex
})
})
this
.
props
.
context
.
codeManager
.
resolveStep
(
stepIndex
,
this
.
state
.
tx
)
this
.
props
.
context
.
codeManager
.
resolveStep
(
stepIndex
,
this
.
state
.
tx
)
},
},
componentWillMount
:
function
()
{
util
.
extend
(
this
,
eventManager
)
},
startDebugging
:
function
(
blockNumber
,
txIndex
,
tx
)
{
startDebugging
:
function
(
blockNumber
,
txIndex
,
tx
)
{
if
(
this
.
props
.
context
.
traceManager
.
isLoading
)
{
if
(
this
.
props
.
context
.
traceManager
.
isLoading
)
{
return
return
...
@@ -58,11 +67,12 @@ module.exports = React.createClass({
...
@@ -58,11 +67,12 @@ module.exports = React.createClass({
var
self
=
this
var
self
=
this
this
.
props
.
context
.
traceManager
.
resolveTrace
(
tx
,
function
(
success
)
{
this
.
props
.
context
.
traceManager
.
resolveTrace
(
tx
,
function
(
success
)
{
console
.
log
(
'trace loaded '
+
success
)
console
.
log
(
'trace loaded '
+
success
)
self
.
setState
({
if
(
success
)
{
currentStepIndex
:
0
self
.
stepChanged
(
0
)
})
self
.
refs
.
stepManager
.
newTraceAvailable
()
self
.
refs
.
stepManager
.
newTraceAvailable
()
self
.
props
.
context
.
codeManager
.
resolveStep
(
0
,
tx
)
}
else
{
console
.
log
(
'trace not loaded'
)
}
})
})
}
}
})
})
src/memoryPanel.js
View file @
d63a3e10
...
@@ -5,7 +5,9 @@ var BasicPanel = require('./basicPanel')
...
@@ -5,7 +5,9 @@ var BasicPanel = require('./basicPanel')
module
.
exports
=
React
.
createClass
({
module
.
exports
=
React
.
createClass
({
contextTypes
:
{
contextTypes
:
{
traceManager
:
React
.
PropTypes
.
object
,
traceManager
:
React
.
PropTypes
.
object
,
web3
:
React
.
PropTypes
.
object
web3
:
React
.
PropTypes
.
object
,
codeManager
:
React
.
PropTypes
.
object
,
root
:
React
.
PropTypes
.
object
},
},
getDefaultProps
:
function
()
{
getDefaultProps
:
function
()
{
...
@@ -26,20 +28,22 @@ module.exports = React.createClass({
...
@@ -26,20 +28,22 @@ module.exports = React.createClass({
)
)
},
},
componentWillReceiveProps
:
function
(
nextProps
)
{
componentDidMount
:
function
()
{
if
(
nextProps
.
currentStepIndex
<
0
)
return
if
(
window
.
ethDebuggerSelectedItem
!==
nextProps
.
currentStepIndex
)
return
var
self
=
this
var
self
=
this
this
.
context
.
traceManager
.
getMemoryAt
(
nextProps
.
currentStepIndex
,
function
(
error
,
memory
)
{
this
.
context
.
root
.
register
(
'indexChanged'
,
this
,
function
(
index
)
{
if
(
index
<
0
)
return
if
(
window
.
ethDebuggerSelectedItem
!==
index
)
return
self
.
context
.
traceManager
.
getMemoryAt
(
index
,
function
(
error
,
memory
)
{
if
(
error
)
{
if
(
error
)
{
console
.
log
(
error
)
console
.
log
(
error
)
}
else
if
(
window
.
ethDebuggerSelectedItem
===
nextProps
.
currentStepI
ndex
)
{
}
else
if
(
window
.
ethDebuggerSelectedItem
===
i
ndex
)
{
self
.
setState
({
self
.
setState
({
data
:
self
.
formatMemory
(
memory
,
16
)
data
:
self
.
formatMemory
(
memory
,
16
)
})
})
}
}
})
})
})
},
},
formatMemory
:
function
(
mem
,
width
)
{
formatMemory
:
function
(
mem
,
width
)
{
...
...
src/stackPanel.js
View file @
d63a3e10
...
@@ -4,7 +4,9 @@ var BasicPanel = require('./basicPanel')
...
@@ -4,7 +4,9 @@ var BasicPanel = require('./basicPanel')
module
.
exports
=
React
.
createClass
({
module
.
exports
=
React
.
createClass
({
contextTypes
:
{
contextTypes
:
{
traceManager
:
React
.
PropTypes
.
object
traceManager
:
React
.
PropTypes
.
object
,
codeManager
:
React
.
PropTypes
.
object
,
root
:
React
.
PropTypes
.
object
},
},
getDefaultProps
:
function
()
{
getDefaultProps
:
function
()
{
...
@@ -25,20 +27,22 @@ module.exports = React.createClass({
...
@@ -25,20 +27,22 @@ module.exports = React.createClass({
)
)
},
},
componentWillReceiveProps
:
function
(
nextProps
)
{
componentDidMount
:
function
()
{
if
(
nextProps
.
currentStepIndex
<
0
)
return
if
(
window
.
ethDebuggerSelectedItem
!==
nextProps
.
currentStepIndex
)
return
var
self
=
this
var
self
=
this
this
.
context
.
traceManager
.
getStackAt
(
nextProps
.
currentStepIndex
,
function
(
error
,
stack
)
{
this
.
context
.
root
.
register
(
'indexChanged'
,
this
,
function
(
index
)
{
if
(
index
<
0
)
return
if
(
window
.
ethDebuggerSelectedItem
!==
index
)
return
self
.
context
.
traceManager
.
getStackAt
(
index
,
function
(
error
,
stack
)
{
if
(
error
)
{
if
(
error
)
{
console
.
log
(
error
)
console
.
log
(
error
)
}
else
if
(
window
.
ethDebuggerSelectedItem
===
nextProps
.
currentStepI
ndex
)
{
}
else
if
(
window
.
ethDebuggerSelectedItem
===
i
ndex
)
{
self
.
setState
({
self
.
setState
({
data
:
self
.
format
(
stack
)
data
:
self
.
format
(
stack
)
})
})
}
}
})
})
})
},
},
format
:
function
(
stack
)
{
format
:
function
(
stack
)
{
...
...
src/stepManager.js
View file @
d63a3e10
...
@@ -3,6 +3,8 @@ var React = require('react')
...
@@ -3,6 +3,8 @@ var React = require('react')
var
ButtonNavigator
=
require
(
'./buttonNavigator'
)
var
ButtonNavigator
=
require
(
'./buttonNavigator'
)
var
Slider
=
require
(
'./slider'
)
var
Slider
=
require
(
'./slider'
)
var
style
=
require
(
'./basicStyles'
)
var
style
=
require
(
'./basicStyles'
)
var
util
=
require
(
'./util'
)
var
eventManager
=
require
(
'./eventManager'
)
module
.
exports
=
React
.
createClass
({
module
.
exports
=
React
.
createClass
({
propTypes
:
{
propTypes
:
{
...
@@ -41,6 +43,7 @@ module.exports = React.createClass({
...
@@ -41,6 +43,7 @@ module.exports = React.createClass({
},
},
componentDidMount
:
function
()
{
componentDidMount
:
function
()
{
// util.extend(this, eventManager)
this
.
changeState
(
-
1
)
this
.
changeState
(
-
1
)
},
},
...
@@ -70,8 +73,8 @@ module.exports = React.createClass({
...
@@ -70,8 +73,8 @@ module.exports = React.createClass({
if
(
!
this
.
context
.
traceManager
.
inRange
(
step
))
{
if
(
!
this
.
context
.
traceManager
.
inRange
(
step
))
{
return
return
}
}
this
.
props
.
onStepChanged
(
step
)
this
.
changeState
(
step
)
this
.
changeState
(
step
)
this
.
props
.
onStepChanged
(
step
)
},
},
stepIntoForward
:
function
()
{
stepIntoForward
:
function
()
{
...
@@ -82,9 +85,9 @@ module.exports = React.createClass({
...
@@ -82,9 +85,9 @@ module.exports = React.createClass({
if
(
!
this
.
context
.
traceManager
.
inRange
(
step
))
{
if
(
!
this
.
context
.
traceManager
.
inRange
(
step
))
{
return
return
}
}
this
.
props
.
onStepChanged
(
step
)
this
.
refs
.
slider
.
setValue
(
step
)
this
.
refs
.
slider
.
setValue
(
step
)
this
.
changeState
(
step
)
this
.
changeState
(
step
)
this
.
props
.
onStepChanged
(
step
)
},
},
stepIntoBack
:
function
()
{
stepIntoBack
:
function
()
{
...
@@ -95,9 +98,9 @@ module.exports = React.createClass({
...
@@ -95,9 +98,9 @@ module.exports = React.createClass({
if
(
!
this
.
context
.
traceManager
.
inRange
(
step
))
{
if
(
!
this
.
context
.
traceManager
.
inRange
(
step
))
{
return
return
}
}
this
.
props
.
onStepChanged
(
step
)
this
.
refs
.
slider
.
setValue
(
step
)
this
.
refs
.
slider
.
setValue
(
step
)
this
.
changeState
(
step
)
this
.
changeState
(
step
)
this
.
props
.
onStepChanged
(
step
)
},
},
stepOverForward
:
function
()
{
stepOverForward
:
function
()
{
...
@@ -105,9 +108,9 @@ module.exports = React.createClass({
...
@@ -105,9 +108,9 @@ module.exports = React.createClass({
return
return
}
}
var
step
=
this
.
context
.
traceManager
.
findStepOverForward
(
this
.
state
.
currentStepIndex
)
var
step
=
this
.
context
.
traceManager
.
findStepOverForward
(
this
.
state
.
currentStepIndex
)
this
.
props
.
onStepChanged
(
step
)
this
.
refs
.
slider
.
setValue
(
step
)
this
.
refs
.
slider
.
setValue
(
step
)
this
.
changeState
(
step
)
this
.
changeState
(
step
)
this
.
props
.
onStepChanged
(
step
)
},
},
stepOverBack
:
function
()
{
stepOverBack
:
function
()
{
...
@@ -115,9 +118,9 @@ module.exports = React.createClass({
...
@@ -115,9 +118,9 @@ module.exports = React.createClass({
return
return
}
}
var
step
=
this
.
context
.
traceManager
.
findStepOverBack
(
this
.
state
.
currentStepIndex
)
var
step
=
this
.
context
.
traceManager
.
findStepOverBack
(
this
.
state
.
currentStepIndex
)
this
.
props
.
onStepChanged
(
step
)
this
.
refs
.
slider
.
setValue
(
step
)
this
.
refs
.
slider
.
setValue
(
step
)
this
.
changeState
(
step
)
this
.
changeState
(
step
)
this
.
props
.
onStepChanged
(
step
)
},
},
jumpToNextCall
:
function
()
{
jumpToNextCall
:
function
()
{
...
@@ -125,9 +128,9 @@ module.exports = React.createClass({
...
@@ -125,9 +128,9 @@ module.exports = React.createClass({
return
return
}
}
var
step
=
this
.
context
.
traceManager
.
findNextCall
(
this
.
state
.
currentStepIndex
)
var
step
=
this
.
context
.
traceManager
.
findNextCall
(
this
.
state
.
currentStepIndex
)
this
.
props
.
onStepChanged
(
step
)
this
.
refs
.
slider
.
setValue
(
step
)
this
.
refs
.
slider
.
setValue
(
step
)
this
.
changeState
(
step
)
this
.
changeState
(
step
)
this
.
props
.
onStepChanged
(
step
)
},
},
changeState
:
function
(
step
)
{
changeState
:
function
(
step
)
{
...
...
src/sticker.js
View file @
d63a3e10
...
@@ -3,7 +3,9 @@ var React = require('react')
...
@@ -3,7 +3,9 @@ var React = require('react')
module
.
exports
=
React
.
createClass
({
module
.
exports
=
React
.
createClass
({
contextTypes
:
{
contextTypes
:
{
traceManager
:
React
.
PropTypes
.
object
traceManager
:
React
.
PropTypes
.
object
,
codeManager
:
React
.
PropTypes
.
object
,
root
:
React
.
PropTypes
.
object
},
},
getDefaultProps
:
function
()
{
getDefaultProps
:
function
()
{
...
@@ -80,11 +82,12 @@ module.exports = React.createClass({
...
@@ -80,11 +82,12 @@ module.exports = React.createClass({
return
null
return
null
},
},
componentWillReceiveProps
:
function
(
nextProps
)
{
componentDidMount
:
function
()
{
if
(
nextProps
.
currentStepIndex
<
0
)
return
var
self
=
this
var
self
=
this
this
.
context
.
traceManager
.
getCurrentStep
(
nextProps
.
currentStepIndex
,
function
(
error
,
step
)
{
this
.
context
.
root
.
register
(
'indexChanged'
,
this
,
function
(
index
)
{
if
(
index
<
0
)
return
self
.
context
.
traceManager
.
getCurrentStep
(
index
,
function
(
error
,
step
)
{
if
(
error
)
{
if
(
error
)
{
console
.
log
(
error
)
console
.
log
(
error
)
}
else
{
}
else
{
...
@@ -94,7 +97,7 @@ module.exports = React.createClass({
...
@@ -94,7 +97,7 @@ module.exports = React.createClass({
}
}
})
})
this
.
context
.
traceManager
.
getMemExpand
(
nextProps
.
currentStepI
ndex
,
function
(
error
,
addmem
)
{
self
.
context
.
traceManager
.
getMemExpand
(
i
ndex
,
function
(
error
,
addmem
)
{
if
(
error
)
{
if
(
error
)
{
console
.
log
(
error
)
console
.
log
(
error
)
}
else
{
}
else
{
...
@@ -104,7 +107,7 @@ module.exports = React.createClass({
...
@@ -104,7 +107,7 @@ module.exports = React.createClass({
}
}
})
})
this
.
context
.
traceManager
.
getStepCost
(
nextProps
.
currentStepI
ndex
,
function
(
error
,
gas
)
{
self
.
context
.
traceManager
.
getStepCost
(
i
ndex
,
function
(
error
,
gas
)
{
if
(
error
)
{
if
(
error
)
{
console
.
log
(
error
)
console
.
log
(
error
)
}
else
{
}
else
{
...
@@ -114,7 +117,7 @@ module.exports = React.createClass({
...
@@ -114,7 +117,7 @@ module.exports = React.createClass({
}
}
})
})
this
.
context
.
traceManager
.
getRemainingGas
(
nextProps
.
currentStepI
ndex
,
function
(
error
,
remaingas
)
{
self
.
context
.
traceManager
.
getRemainingGas
(
i
ndex
,
function
(
error
,
remaingas
)
{
if
(
error
)
{
if
(
error
)
{
console
.
log
(
error
)
console
.
log
(
error
)
}
else
{
}
else
{
...
@@ -123,5 +126,6 @@ module.exports = React.createClass({
...
@@ -123,5 +126,6 @@ module.exports = React.createClass({
})
})
}
}
})
})
})
}
}
})
})
src/storagePanel.js
View file @
d63a3e10
...
@@ -5,7 +5,9 @@ var BasicPanel = require('./basicPanel')
...
@@ -5,7 +5,9 @@ var BasicPanel = require('./basicPanel')
module
.
exports
=
React
.
createClass
({
module
.
exports
=
React
.
createClass
({
contextTypes
:
{
contextTypes
:
{
traceManager
:
React
.
PropTypes
.
object
,
traceManager
:
React
.
PropTypes
.
object
,
tx
:
React
.
PropTypes
.
object
tx
:
React
.
PropTypes
.
object
,
codeManager
:
React
.
PropTypes
.
object
,
root
:
React
.
PropTypes
.
object
},
},
getDefaultProps
:
function
()
{
getDefaultProps
:
function
()
{
...
@@ -26,20 +28,22 @@ module.exports = React.createClass({
...
@@ -26,20 +28,22 @@ module.exports = React.createClass({
)
)
},
},
componentWillReceiveProps
:
function
(
nextProps
)
{
componentDidMount
:
function
()
{
if
(
nextProps
.
currentStepIndex
<
0
)
return
if
(
window
.
ethDebuggerSelectedItem
!==
nextProps
.
currentStepIndex
)
return
var
self
=
this
var
self
=
this
this
.
context
.
traceManager
.
getStorageAt
(
nextProps
.
currentStepIndex
,
this
.
context
.
tx
,
function
(
error
,
storage
)
{
this
.
context
.
root
.
register
(
'indexChanged'
,
this
,
function
(
index
)
{
if
(
index
<
0
)
return
if
(
window
.
ethDebuggerSelectedItem
!==
index
)
return
self
.
context
.
traceManager
.
getStorageAt
(
index
,
self
.
context
.
tx
,
function
(
error
,
storage
)
{
if
(
error
)
{
if
(
error
)
{
console
.
log
(
error
)
console
.
log
(
error
)
}
else
if
(
window
.
ethDebuggerSelectedItem
===
nextProps
.
currentStepI
ndex
)
{
}
else
if
(
window
.
ethDebuggerSelectedItem
===
i
ndex
)
{
self
.
setState
({
self
.
setState
({
data
:
self
.
formatStorage
(
storage
)
data
:
self
.
formatStorage
(
storage
)
})
})
}
}
})
})
})
},
},
formatStorage
:
function
(
storage
)
{
formatStorage
:
function
(
storage
)
{
...
...
src/vmDebugger.js
View file @
d63a3e10
...
@@ -10,16 +10,6 @@ var StackPanel = require('./stackPanel')
...
@@ -10,16 +10,6 @@ var StackPanel = require('./stackPanel')
var
StoragePanel
=
require
(
'./storagePanel'
)
var
StoragePanel
=
require
(
'./storagePanel'
)
module
.
exports
=
React
.
createClass
({
module
.
exports
=
React
.
createClass
({
contextTypes
:
{
traceManager
:
React
.
PropTypes
.
object
},
getInitialState
:
function
()
{
return
{
currentAddress
:
null
}
},
getDefaultProps
:
function
()
{
getDefaultProps
:
function
()
{
return
{
return
{
currentStepIndex
:
-
1
// index of the selected item in the vmtrace
currentStepIndex
:
-
1
// index of the selected item in the vmtrace
...
@@ -30,9 +20,6 @@ module.exports = React.createClass({
...
@@ -30,9 +20,6 @@ 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
}
>
<
div
style
=
{
style
.
container
}
>
<
span
style
=
{
style
.
address
}
>
Current
code
:
{
this
.
state
.
currentAddress
}
<
/span
>
<
/div
>
<
div
style
=
{
style
.
container
}
>
<
table
>
<
table
>
<
tbody
>
<
tbody
>
<
tr
>
<
tr
>
...
...
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