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
66576387
Commit
66576387
authored
Jun 20, 2016
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- clean
- load EventManager as object
parent
d63a3e10
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
56 additions
and
88 deletions
+56
-88
asmCode.js
src/asmCode.js
+7
-1
calldataPanel.js
src/calldataPanel.js
+0
-6
callstackPanel.js
src/callstackPanel.js
+0
-6
codeManager.js
src/codeManager.js
+2
-2
debugger.js
src/debugger.js
+4
-6
eventManager.js
src/eventManager.js
+25
-15
memoryPanel.js
src/memoryPanel.js
+0
-6
stackPanel.js
src/stackPanel.js
+0
-6
stepManager.js
src/stepManager.js
+11
-14
sticker.js
src/sticker.js
+0
-6
storagePanel.js
src/storagePanel.js
+0
-6
util.js
src/util.js
+0
-1
vmDebugger.js
src/vmDebugger.js
+7
-13
No files found.
src/asmCode.js
View file @
66576387
...
@@ -4,7 +4,9 @@ var style = require('./basicStyles')
...
@@ -4,7 +4,9 @@ var style = require('./basicStyles')
module
.
exports
=
React
.
createClass
({
module
.
exports
=
React
.
createClass
({
contextTypes
:
{
contextTypes
:
{
codeManager
:
React
.
PropTypes
.
object
codeManager
:
React
.
PropTypes
.
object
,
root
:
React
.
PropTypes
.
object
,
tx
:
React
.
PropTypes
.
object
},
},
getInitialState
:
function
()
{
getInitialState
:
function
()
{
...
@@ -23,10 +25,14 @@ module.exports = React.createClass({
...
@@ -23,10 +25,14 @@ module.exports = React.createClass({
},
},
componentDidMount
:
function
()
{
componentDidMount
:
function
()
{
var
self
=
this
this
.
context
.
codeManager
.
register
(
'indexChanged'
,
this
,
this
.
indexChanged
)
this
.
context
.
codeManager
.
register
(
'indexChanged'
,
this
,
this
.
indexChanged
)
this
.
context
.
codeManager
.
register
(
'codeChanged'
,
this
,
this
.
codeChanged
)
this
.
context
.
codeManager
.
register
(
'codeChanged'
,
this
,
this
.
codeChanged
)
this
.
context
.
codeManager
.
register
(
'loadingCode'
,
this
,
function
(
address
)
{
this
.
context
.
codeManager
.
register
(
'loadingCode'
,
this
,
function
(
address
)
{
})
})
this
.
context
.
root
.
register
(
'indexChanged'
,
this
,
function
(
index
)
{
self
.
context
.
codeManager
.
resolveStep
(
index
,
self
.
context
.
tx
)
})
},
},
indexChanged
:
function
(
index
)
{
indexChanged
:
function
(
index
)
{
...
...
src/calldataPanel.js
View file @
66576387
...
@@ -9,12 +9,6 @@ module.exports = React.createClass({
...
@@ -9,12 +9,6 @@ module.exports = React.createClass({
root
:
React
.
PropTypes
.
object
root
:
React
.
PropTypes
.
object
},
},
getDefaultProps
:
function
()
{
return
{
currentStepIndex
:
-
1
}
},
getInitialState
:
function
()
{
getInitialState
:
function
()
{
return
{
return
{
data
:
null
data
:
null
...
...
src/callstackPanel.js
View file @
66576387
...
@@ -9,12 +9,6 @@ module.exports = React.createClass({
...
@@ -9,12 +9,6 @@ module.exports = React.createClass({
root
:
React
.
PropTypes
.
object
root
:
React
.
PropTypes
.
object
},
},
getDefaultProps
:
function
()
{
return
{
currentStepIndex
:
-
1
}
},
getInitialState
:
function
()
{
getInitialState
:
function
()
{
return
{
return
{
data
:
null
data
:
null
...
...
src/codeManager.js
View file @
66576387
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
var
traceManagerUtil
=
require
(
'./traceManagerUtil'
)
var
traceManagerUtil
=
require
(
'./traceManagerUtil'
)
var
codeResolver
=
require
(
'./codeResolver'
)
var
codeResolver
=
require
(
'./codeResolver'
)
var
util
=
require
(
'./util'
)
var
util
=
require
(
'./util'
)
var
e
ventManager
=
require
(
'./eventManager'
)
var
E
ventManager
=
require
(
'./eventManager'
)
/*
/*
resolve contract code referenced by vmtrace in order to be used by asm listview.
resolve contract code referenced by vmtrace in order to be used by asm listview.
...
@@ -14,7 +14,7 @@ var eventManager = require('./eventManager')
...
@@ -14,7 +14,7 @@ var eventManager = require('./eventManager')
*/
*/
function
CodeManager
(
_web3
,
_traceManager
)
{
function
CodeManager
(
_web3
,
_traceManager
)
{
util
.
extend
(
this
,
eventManager
)
util
.
extend
(
this
,
new
EventManager
()
)
this
.
web3
=
_web3
this
.
web3
=
_web3
this
.
isLoading
=
false
this
.
isLoading
=
false
this
.
traceManager
=
_traceManager
this
.
traceManager
=
_traceManager
...
...
src/debugger.js
View file @
66576387
...
@@ -5,7 +5,7 @@ var StepManager = require('./stepManager')
...
@@ -5,7 +5,7 @@ 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
util
=
require
(
'./util'
)
var
e
ventManager
=
require
(
'./eventManager'
)
var
E
ventManager
=
require
(
'./eventManager'
)
module
.
exports
=
React
.
createClass
({
module
.
exports
=
React
.
createClass
({
getInitialState
:
function
()
{
getInitialState
:
function
()
{
...
@@ -14,7 +14,7 @@ module.exports = React.createClass({
...
@@ -14,7 +14,7 @@ module.exports = React.createClass({
tx
:
null
tx
:
null
}
}
},
},
childContextTypes
:
{
childContextTypes
:
{
web3
:
React
.
PropTypes
.
object
,
web3
:
React
.
PropTypes
.
object
,
traceManager
:
React
.
PropTypes
.
object
,
traceManager
:
React
.
PropTypes
.
object
,
...
@@ -49,11 +49,10 @@ module.exports = React.createClass({
...
@@ -49,11 +49,10 @@ module.exports = React.createClass({
this
.
setState
({
this
.
setState
({
currentStepIndex
:
stepIndex
currentStepIndex
:
stepIndex
})
})
this
.
props
.
context
.
codeManager
.
resolveStep
(
stepIndex
,
this
.
state
.
tx
)
},
},
componentWillMount
:
function
()
{
componentWillMount
:
function
()
{
util
.
extend
(
this
,
eventManager
)
util
.
extend
(
this
,
new
EventManager
()
)
},
},
startDebugging
:
function
(
blockNumber
,
txIndex
,
tx
)
{
startDebugging
:
function
(
blockNumber
,
txIndex
,
tx
)
{
...
@@ -68,8 +67,7 @@ module.exports = React.createClass({
...
@@ -68,8 +67,7 @@ module.exports = React.createClass({
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
)
if
(
success
)
{
if
(
success
)
{
self
.
stepChanged
(
0
)
self
.
trigger
(
'newTraceLoaded'
)
self
.
refs
.
stepManager
.
newTraceAvailable
()
}
else
{
}
else
{
console
.
log
(
'trace not loaded'
)
console
.
log
(
'trace not loaded'
)
}
}
...
...
src/eventManager.js
View file @
66576387
'use strict'
'use strict'
module
.
exports
=
{
function
EventManager
()
{
registered
:
{},
this
.
registered
=
{}
}
register
:
function
(
eventName
,
obj
,
func
)
{
EventManager
.
prototype
.
unregister
=
function
(
eventName
,
obj
)
{
if
(
!
this
.
registered
[
eventName
])
{
for
(
var
reg
in
this
.
registered
[
eventName
])
{
this
.
registered
[
eventName
]
=
[]
if
(
this
.
registered
[
eventName
][
reg
]
&&
this
.
registered
[
eventName
][
reg
].
obj
===
obj
)
{
this
.
registered
[
eventName
].
splice
(
reg
,
1
)
return
}
}
this
.
registered
[
eventName
].
push
({
}
obj
:
obj
,
}
func
:
func
})
},
trigger
:
function
(
eventName
,
args
)
{
EventManager
.
prototype
.
register
=
function
(
eventName
,
obj
,
func
)
{
for
(
var
listener
in
this
.
registered
[
eventName
])
{
if
(
!
this
.
registered
[
eventName
])
{
var
l
=
this
.
registered
[
eventName
][
listener
]
this
.
registered
[
eventName
]
=
[]
l
.
func
.
apply
(
l
.
obj
,
args
)
}
}
}
this
.
registered
[
eventName
].
push
({
obj
:
obj
,
func
:
func
})
}
EventManager
.
prototype
.
trigger
=
function
(
eventName
,
args
)
{
for
(
var
listener
in
this
.
registered
[
eventName
])
{
var
l
=
this
.
registered
[
eventName
][
listener
]
l
.
func
.
apply
(
l
.
obj
,
args
)
}
}
}
module
.
exports
=
EventManager
src/memoryPanel.js
View file @
66576387
...
@@ -10,12 +10,6 @@ module.exports = React.createClass({
...
@@ -10,12 +10,6 @@ module.exports = React.createClass({
root
:
React
.
PropTypes
.
object
root
:
React
.
PropTypes
.
object
},
},
getDefaultProps
:
function
()
{
return
{
currentStepIndex
:
-
1
}
},
getInitialState
:
function
()
{
getInitialState
:
function
()
{
return
{
return
{
data
:
null
data
:
null
...
...
src/stackPanel.js
View file @
66576387
...
@@ -9,12 +9,6 @@ module.exports = React.createClass({
...
@@ -9,12 +9,6 @@ module.exports = React.createClass({
root
:
React
.
PropTypes
.
object
root
:
React
.
PropTypes
.
object
},
},
getDefaultProps
:
function
()
{
return
{
currentStepIndex
:
-
1
}
},
getInitialState
:
function
()
{
getInitialState
:
function
()
{
return
{
return
{
data
:
null
data
:
null
...
...
src/stepManager.js
View file @
66576387
...
@@ -3,8 +3,6 @@ var React = require('react')
...
@@ -3,8 +3,6 @@ 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
:
{
...
@@ -12,7 +10,8 @@ module.exports = React.createClass({
...
@@ -12,7 +10,8 @@ module.exports = React.createClass({
},
},
contextTypes
:
{
contextTypes
:
{
traceManager
:
React
.
PropTypes
.
object
traceManager
:
React
.
PropTypes
.
object
,
root
:
React
.
PropTypes
.
object
},
},
getInitialState
:
function
()
{
getInitialState
:
function
()
{
...
@@ -43,7 +42,10 @@ module.exports = React.createClass({
...
@@ -43,7 +42,10 @@ module.exports = React.createClass({
},
},
componentDidMount
:
function
()
{
componentDidMount
:
function
()
{
// util.extend(this, eventManager)
var
self
=
this
this
.
context
.
root
.
register
(
'newTraceLoaded'
,
this
,
function
()
{
self
.
newTraceAvailable
()
})
this
.
changeState
(
-
1
)
this
.
changeState
(
-
1
)
},
},
...
@@ -53,7 +55,7 @@ module.exports = React.createClass({
...
@@ -53,7 +55,7 @@ module.exports = React.createClass({
init
:
function
()
{
init
:
function
()
{
this
.
refs
.
slider
.
setValue
(
0
)
this
.
refs
.
slider
.
setValue
(
0
)
this
.
changeState
(
-
1
)
this
.
changeState
(
0
)
},
},
newTraceAvailable
:
function
()
{
newTraceAvailable
:
function
()
{
...
@@ -64,7 +66,6 @@ module.exports = React.createClass({
...
@@ -64,7 +66,6 @@ module.exports = React.createClass({
console
.
log
(
error
)
console
.
log
(
error
)
}
else
{
}
else
{
self
.
setState
({
traceLength
:
length
})
self
.
setState
({
traceLength
:
length
})
self
.
changeState
(
0
)
}
}
})
})
},
},
...
@@ -74,7 +75,6 @@ module.exports = React.createClass({
...
@@ -74,7 +75,6 @@ module.exports = React.createClass({
return
return
}
}
this
.
changeState
(
step
)
this
.
changeState
(
step
)
this
.
props
.
onStepChanged
(
step
)
},
},
stepIntoForward
:
function
()
{
stepIntoForward
:
function
()
{
...
@@ -87,7 +87,6 @@ module.exports = React.createClass({
...
@@ -87,7 +87,6 @@ module.exports = React.createClass({
}
}
this
.
refs
.
slider
.
setValue
(
step
)
this
.
refs
.
slider
.
setValue
(
step
)
this
.
changeState
(
step
)
this
.
changeState
(
step
)
this
.
props
.
onStepChanged
(
step
)
},
},
stepIntoBack
:
function
()
{
stepIntoBack
:
function
()
{
...
@@ -100,7 +99,6 @@ module.exports = React.createClass({
...
@@ -100,7 +99,6 @@ module.exports = React.createClass({
}
}
this
.
refs
.
slider
.
setValue
(
step
)
this
.
refs
.
slider
.
setValue
(
step
)
this
.
changeState
(
step
)
this
.
changeState
(
step
)
this
.
props
.
onStepChanged
(
step
)
},
},
stepOverForward
:
function
()
{
stepOverForward
:
function
()
{
...
@@ -110,7 +108,7 @@ module.exports = React.createClass({
...
@@ -110,7 +108,7 @@ module.exports = React.createClass({
var
step
=
this
.
context
.
traceManager
.
findStepOverForward
(
this
.
state
.
currentStepIndex
)
var
step
=
this
.
context
.
traceManager
.
findStepOverForward
(
this
.
state
.
currentStepIndex
)
this
.
refs
.
slider
.
setValue
(
step
)
this
.
refs
.
slider
.
setValue
(
step
)
this
.
changeState
(
step
)
this
.
changeState
(
step
)
this
.
props
.
onStepChanged
(
step
)
},
},
stepOverBack
:
function
()
{
stepOverBack
:
function
()
{
...
@@ -120,24 +118,23 @@ module.exports = React.createClass({
...
@@ -120,24 +118,23 @@ module.exports = React.createClass({
var
step
=
this
.
context
.
traceManager
.
findStepOverBack
(
this
.
state
.
currentStepIndex
)
var
step
=
this
.
context
.
traceManager
.
findStepOverBack
(
this
.
state
.
currentStepIndex
)
this
.
refs
.
slider
.
setValue
(
step
)
this
.
refs
.
slider
.
setValue
(
step
)
this
.
changeState
(
step
)
this
.
changeState
(
step
)
this
.
props
.
onStepChanged
(
step
)
},
},
jumpToNextCall
:
function
()
{
jumpToNextCall
:
function
()
{
if
(
!
this
.
context
.
traceManager
.
isLoaded
())
{
if
(
!
this
.
context
.
traceManager
.
isLoaded
())
{
return
return
}
}
var
step
=
this
.
context
.
traceManager
.
findNextCall
(
this
.
state
.
currentStepIndex
)
var
step
=
this
.
context
.
traceManager
.
findNextCall
(
this
.
state
.
currentStepIndex
)
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
)
{
this
.
updateGlobalSelectedItem
(
step
)
this
.
updateGlobalSelectedItem
(
step
)
this
.
setState
({
this
.
setState
({
currentStepIndex
:
step
currentStepIndex
:
step
})
})
this
.
refs
.
buttons
.
stepChanged
(
step
)
this
.
refs
.
buttons
.
stepChanged
(
step
)
this
.
props
.
onStepChanged
(
step
)
}
}
})
})
src/sticker.js
View file @
66576387
...
@@ -8,12 +8,6 @@ module.exports = React.createClass({
...
@@ -8,12 +8,6 @@ module.exports = React.createClass({
root
:
React
.
PropTypes
.
object
root
:
React
.
PropTypes
.
object
},
},
getDefaultProps
:
function
()
{
return
{
currentStepIndex
:
-
1
}
},
getInitialState
:
function
()
{
getInitialState
:
function
()
{
return
{
return
{
step
:
''
,
step
:
''
,
...
...
src/storagePanel.js
View file @
66576387
...
@@ -10,12 +10,6 @@ module.exports = React.createClass({
...
@@ -10,12 +10,6 @@ module.exports = React.createClass({
root
:
React
.
PropTypes
.
object
root
:
React
.
PropTypes
.
object
},
},
getDefaultProps
:
function
()
{
return
{
currentStepIndex
:
-
1
}
},
getInitialState
:
function
()
{
getInitialState
:
function
()
{
return
{
return
{
data
:
null
data
:
null
...
...
src/util.js
View file @
66576387
...
@@ -4,6 +4,5 @@ module.exports = {
...
@@ -4,6 +4,5 @@ module.exports = {
for
(
var
property
in
source
)
{
for
(
var
property
in
source
)
{
destination
[
property
]
=
source
[
property
]
destination
[
property
]
=
source
[
property
]
}
}
// return destination
}
}
}
}
src/vmDebugger.js
View file @
66576387
...
@@ -10,12 +10,6 @@ var StackPanel = require('./stackPanel')
...
@@ -10,12 +10,6 @@ var StackPanel = require('./stackPanel')
var
StoragePanel
=
require
(
'./storagePanel'
)
var
StoragePanel
=
require
(
'./storagePanel'
)
module
.
exports
=
React
.
createClass
({
module
.
exports
=
React
.
createClass
({
getDefaultProps
:
function
()
{
return
{
currentStepIndex
:
-
1
// index of the selected item in the vmtrace
}
},
render
:
function
()
{
render
:
function
()
{
return
(
return
(
<
div
style
=
{
this
.
props
.
vmTrace
===
null
?
style
.
hidden
:
style
.
display
}
>
<
div
style
=
{
this
.
props
.
vmTrace
===
null
?
style
.
hidden
:
style
.
display
}
>
...
@@ -24,29 +18,29 @@ module.exports = React.createClass({
...
@@ -24,29 +18,29 @@ module.exports = React.createClass({
<
tbody
>
<
tbody
>
<
tr
>
<
tr
>
<
td
>
<
td
>
<
ASMCode
ref
=
'asmcode'
currentStepIndex
=
{
this
.
props
.
currentStepIndex
}
/
>
<
ASMCode
/>
<
div
style
=
{
Object
.
assign
(
style
.
inline
,
style
.
sticker
)}
>
<
div
style
=
{
Object
.
assign
(
style
.
inline
,
style
.
sticker
)}
>
<
Sticker
currentStepIndex
=
{
this
.
props
.
currentStepIndex
}
/
>
<
Sticker
/>
<
/div
>
<
/div
>
<
/td
>
<
/td
>
<
td
>
<
td
>
<
StackPanel
currentStepIndex
=
{
this
.
props
.
currentStepIndex
}
/
>
<
StackPanel
/>
<
/td
>
<
/td
>
<
/tr
>
<
/tr
>
<
tr
>
<
tr
>
<
td
>
<
td
>
<
StoragePanel
currentStepIndex
=
{
this
.
props
.
currentStepIndex
}
/
>
<
StoragePanel
/>
<
/td
>
<
/td
>
<
td
>
<
td
>
<
MemoryPanel
currentStepIndex
=
{
this
.
props
.
currentStepIndex
}
/
>
<
MemoryPanel
/>
<
/td
>
<
/td
>
<
/tr
>
<
/tr
>
<
tr
>
<
tr
>
<
td
>
<
td
>
<
CalldataPanel
currentStepIndex
=
{
this
.
props
.
currentStepIndex
}
/
>
<
CalldataPanel
/>
<
/td
>
<
/td
>
<
td
>
<
td
>
<
CallstackPanel
currentStepIndex
=
{
this
.
props
.
currentStepIndex
}
/
>
<
CallstackPanel
/>
<
/td
>
<
/td
>
<
/tr
>
<
/tr
>
<
/tbody
>
<
/tbody
>
...
...
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