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
06071125
Commit
06071125
authored
Dec 12, 2018
by
Iuri Matias
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make linter happy
parent
3ea9af71
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
114 additions
and
117 deletions
+114
-117
rdb.js
remix-debug/rdb.js
+43
-44
contextManager.js
remix-debug/src/cmdline/contextManager.js
+1
-1
index.js
remix-debug/src/cmdline/index.js
+55
-56
debugger.js
remix-debug/src/debugger/debugger.js
+2
-2
solidityLocals.js
remix-debug/src/debugger/solidityLocals.js
+1
-1
solidityState.js
remix-debug/src/debugger/solidityState.js
+2
-3
stepManager.js
remix-debug/src/debugger/stepManager.js
+10
-10
No files found.
remix-debug/rdb.js
View file @
06071125
var
CmdLine
=
require
(
'./src/cmdline/index.js'
)
var
CmdLine
=
require
(
'./src/cmdline/index.js'
)
var
compilation
=
require
(
'./compilation.json'
)
//
var compilation = require('./compilation.json')
var
solc
=
require
(
'solc'
)
var
solc
=
require
(
'solc'
)
var
fs
=
require
(
'fs'
)
var
fs
=
require
(
'fs'
)
var
filename
=
'test/sol/simple_storage.sol'
var
filename
=
'test/sol/simple_storage.sol'
var
short
_filename
=
"simple_storage.sol"
var
short
Filename
=
'simple_storage.sol'
var
input
_j
son
=
{
var
input
J
son
=
{
language
:
'Solidity'
,
language
:
'Solidity'
,
sources
:
{
sources
:
{
},
},
...
@@ -25,85 +25,84 @@ var input_json = {
...
@@ -25,85 +25,84 @@ var input_json = {
}
}
}
}
input
_json
.
sources
[
short_f
ilename
]
=
{
content
:
fs
.
readFileSync
(
filename
).
toString
()}
input
Json
.
sources
[
shortF
ilename
]
=
{
content
:
fs
.
readFileSync
(
filename
).
toString
()}
console
.
dir
(
input
_j
son
)
console
.
dir
(
input
J
son
)
console
.
log
(
"compiling..."
)
console
.
log
(
'compiling...'
)
let
compilationData
=
JSON
.
parse
(
solc
.
compileStandardWrapper
(
JSON
.
stringify
(
input
_j
son
)))
let
compilationData
=
JSON
.
parse
(
solc
.
compileStandardWrapper
(
JSON
.
stringify
(
input
J
son
)))
console
.
dir
(
Object
.
keys
(
compilationData
))
console
.
dir
(
Object
.
keys
(
compilationData
))
var
compilation
=
{}
var
compilation
=
{}
compilation
.
data
=
compilationData
compilation
.
data
=
compilationData
compilation
.
source
=
{
sources
:
input
_j
son
.
sources
}
compilation
.
source
=
{
sources
:
input
J
son
.
sources
}
console
.
dir
(
compilation
)
console
.
dir
(
compilation
)
console
.
dir
(
compilation
.
data
.
errors
)
console
.
dir
(
compilation
.
data
.
errors
)
var
cmd
_l
ine
=
new
CmdLine
()
var
cmd
L
ine
=
new
CmdLine
()
cmd
_line
.
connect
(
"http"
,
"http://localhost:8545"
)
cmd
Line
.
connect
(
'http'
,
'http://localhost:8545'
)
cmd
_l
ine
.
loadCompilationResult
(
compilation
)
cmd
L
ine
.
loadCompilationResult
(
compilation
)
cmd
_l
ine
.
initDebugger
()
cmd
L
ine
.
initDebugger
()
var
deployContract
=
function
(
cb
)
{
//
var deployContract = function (cb) {
let
_web3
=
cmd_l
ine
.
debugger
.
debugger
.
web3
// let _web3 = cmdL
ine.debugger.debugger.web3
//
let
blockNumber
=
null
//
let blockNumber = null
let
txNumber
=
null
//
let txNumber = null
let
tx
=
null
//
let tx = null
//
let
code
=
compilation
.
data
.
contracts
[
short_f
ilename
].
SimpleStorage
.
evm
.
bytecode
.
object
// let code = compilation.data.contracts[shortF
ilename].SimpleStorage.evm.bytecode.object
console
.
dir
(
"deploying..."
)
// console.dir('deploying...'
)
console
.
dir
(
code
)
//
console.dir(code)
_web3
.
eth
.
sendTransaction
({
data
:
"0x"
+
code
,
from
:
_web3
.
eth
.
accounts
[
0
],
gas
:
800000
},
cb
)
// _web3.eth.sendTransaction({data: '0x'
+ code, from: _web3.eth.accounts[0], gas: 800000}, cb)
}
//
}
let
_web3
=
cmd_l
ine
.
debugger
.
debugger
.
web3
// let _web3 = cmdL
ine.debugger.debugger.web3
var
tx
=
"0xf510c4f0b1d9ee262d7b9e9e87b4262f275fe029c2c733feef7dfa1e2b1e32aa"
var
tx
=
'0xf510c4f0b1d9ee262d7b9e9e87b4262f275fe029c2c733feef7dfa1e2b1e32aa'
// deployContract((err, tx) => {
// deployContract((err, tx) => {
cmd_line
.
startDebug
(
tx
,
short_f
ilename
)
cmdLine
.
startDebug
(
tx
,
shortF
ilename
)
cmd
_line
.
events
.
on
(
"source"
,
()
=>
{
cmd
Line
.
events
.
on
(
'source'
,
()
=>
{
cmd
_l
ine
.
getSource
().
forEach
(
console
.
dir
)
cmd
L
ine
.
getSource
().
forEach
(
console
.
dir
)
})
})
// })
// })
//})
//
})
const
repl
=
require
(
'repl'
)
const
repl
=
require
(
'repl'
)
const
r
=
repl
.
start
({
repl
.
start
({
prompt
:
'> '
,
prompt
:
'> '
,
eval
:
(
cmd
,
context
,
filename
,
cb
)
=>
{
eval
:
(
cmd
,
context
,
filename
,
cb
)
=>
{
let
command
=
cmd
.
trim
()
let
command
=
cmd
.
trim
()
if
(
command
===
'next'
||
command
===
'n'
)
{
if
(
command
===
'next'
||
command
===
'n'
)
{
cmd
_l
ine
.
stepOverForward
(
true
)
cmd
L
ine
.
stepOverForward
(
true
)
}
}
if
(
command
===
'previous'
||
command
===
'p'
||
command
===
'prev'
)
{
if
(
command
===
'previous'
||
command
===
'p'
||
command
===
'prev'
)
{
cmd
_l
ine
.
stepOverBack
(
true
)
cmd
L
ine
.
stepOverBack
(
true
)
}
}
if
(
command
===
'step'
||
command
===
's'
)
{
if
(
command
===
'step'
||
command
===
's'
)
{
cmd
_l
ine
.
stepIntoForward
(
true
)
cmd
L
ine
.
stepIntoForward
(
true
)
}
}
if
(
command
===
'stepback'
||
command
===
'sb'
)
{
if
(
command
===
'stepback'
||
command
===
'sb'
)
{
cmd
_l
ine
.
stepIntoBack
(
true
)
cmd
L
ine
.
stepIntoBack
(
true
)
}
}
if
(
command
===
'exit'
||
command
===
'quit'
)
{
if
(
command
===
'exit'
||
command
===
'quit'
)
{
process
.
exit
(
0
)
process
.
exit
(
0
)
}
}
if
(
command
===
'var local'
||
command
===
'v l'
||
command
===
'vl'
)
{
if
(
command
===
'var local'
||
command
===
'v l'
||
command
===
'vl'
)
{
cmd
_l
ine
.
displayLocals
()
cmd
L
ine
.
displayLocals
()
}
}
if
(
command
===
'var global'
||
command
===
'v g'
||
command
===
'vg'
)
{
if
(
command
===
'var global'
||
command
===
'v g'
||
command
===
'vg'
)
{
cmd
_l
ine
.
displayGlobals
()
cmd
L
ine
.
displayGlobals
()
}
}
if
(
command
.
split
(
' '
)[
0
]
===
'jump'
)
{
if
(
command
.
split
(
' '
)[
0
]
===
'jump'
)
{
let
stepIndex
=
parseInt
(
command
.
split
(
' '
)[
1
],
10
)
let
stepIndex
=
parseInt
(
command
.
split
(
' '
)[
1
],
10
)
cmd
_l
ine
.
jumpTo
(
stepIndex
)
cmd
L
ine
.
jumpTo
(
stepIndex
)
}
}
cb
(
null
,
''
)
;
cb
(
null
,
''
)
}
}
});
})
module
.
exports
=
cmd_line
module
.
exports
=
cmdLine
remix-debug/src/cmdline/contextManager.js
View file @
06071125
...
@@ -48,7 +48,7 @@ class ContextManager {
...
@@ -48,7 +48,7 @@ class ContextManager {
self
.
web3
=
(
!
webDebugNode
?
obj
:
webDebugNode
)
self
.
web3
=
(
!
webDebugNode
?
obj
:
webDebugNode
)
}
}
self
.
event
.
trigger
(
'providerChanged'
,
[
type
,
self
.
web3
])
self
.
event
.
trigger
(
'providerChanged'
,
[
type
,
self
.
web3
])
if
(
cb
)
return
cb
()
;
if
(
cb
)
return
cb
()
})
})
self
.
event
.
trigger
(
'providerChanged'
,
[
type
,
self
.
web3
])
self
.
event
.
trigger
(
'providerChanged'
,
[
type
,
self
.
web3
])
}
}
...
...
remix-debug/src/cmdline/index.js
View file @
06071125
...
@@ -12,7 +12,7 @@ class CmdLine {
...
@@ -12,7 +12,7 @@ class CmdLine {
}
}
connect
(
providerType
,
url
)
{
connect
(
providerType
,
url
)
{
if
(
providerType
!==
'http'
)
throw
new
Error
(
"unsupported provider type"
)
if
(
providerType
!==
'http'
)
throw
new
Error
(
'unsupported provider type'
)
this
.
web3
=
new
Web3
(
new
Web3
.
providers
.
HttpProvider
(
url
))
this
.
web3
=
new
Web3
(
new
Web3
.
providers
.
HttpProvider
(
url
))
}
}
...
@@ -47,167 +47,166 @@ class CmdLine {
...
@@ -47,167 +47,166 @@ class CmdLine {
this
.
contextManager
.
switchProvider
(
'debugger_web3'
,
cb
)
this
.
contextManager
.
switchProvider
(
'debugger_web3'
,
cb
)
}
}
getSource
()
{
getSource
()
{
const
self
=
this
const
self
=
this
let
lineColumnPos
=
this
.
lineColumnPos
let
lineColumnPos
=
this
.
lineColumnPos
if
(
!
lineColumnPos
||
!
lineColumnPos
.
start
)
return
[]
;
if
(
!
lineColumnPos
||
!
lineColumnPos
.
start
)
return
[]
let
content
=
self
.
compilation
.
lastCompilationResult
.
source
.
sources
[
this
.
filename
].
content
.
split
(
"
\
n"
)
let
content
=
self
.
compilation
.
lastCompilationResult
.
source
.
sources
[
this
.
filename
].
content
.
split
(
'
\
n'
)
let
source
=
[]
let
source
=
[]
let
line
let
line
line
=
content
[
lineColumnPos
.
start
.
line
-
2
]
line
=
content
[
lineColumnPos
.
start
.
line
-
2
]
if
(
line
!==
undefined
)
{
if
(
line
!==
undefined
)
{
source
.
push
(
" "
+
(
lineColumnPos
.
start
.
line
-
1
)
+
": "
+
line
)
source
.
push
(
' '
+
(
lineColumnPos
.
start
.
line
-
1
)
+
': '
+
line
)
}
}
line
=
content
[
lineColumnPos
.
start
.
line
-
1
]
line
=
content
[
lineColumnPos
.
start
.
line
-
1
]
if
(
line
!==
undefined
)
{
if
(
line
!==
undefined
)
{
source
.
push
(
" "
+
lineColumnPos
.
start
.
line
+
": "
+
line
)
source
.
push
(
' '
+
lineColumnPos
.
start
.
line
+
': '
+
line
)
}
}
let
currentLineNumber
=
lineColumnPos
.
start
.
line
let
currentLineNumber
=
lineColumnPos
.
start
.
line
let
currentLine
=
content
[
currentLineNumber
]
let
currentLine
=
content
[
currentLineNumber
]
source
.
push
(
"=> "
+
(
currentLineNumber
+
1
)
+
": "
+
currentLine
)
source
.
push
(
'=> '
+
(
currentLineNumber
+
1
)
+
': '
+
currentLine
)
let
startLine
=
lineColumnPos
.
start
.
line
let
startLine
=
lineColumnPos
.
start
.
line
for
(
var
i
=
1
;
i
<
4
;
i
++
)
{
for
(
var
i
=
1
;
i
<
4
;
i
++
)
{
let
line
=
content
[
startLine
+
i
]
let
line
=
content
[
startLine
+
i
]
source
.
push
(
" "
+
(
startLine
+
i
+
1
)
+
": "
+
line
)
source
.
push
(
' '
+
(
startLine
+
i
+
1
)
+
': '
+
line
)
}
}
return
source
return
source
}
}
getCurrentLine
()
{
getCurrentLine
()
{
let
lineColumnPos
=
this
.
lineColumnPos
let
lineColumnPos
=
this
.
lineColumnPos
if
(
!
lineColumnPos
)
return
""
if
(
!
lineColumnPos
)
return
''
let
currentLineNumber
=
lineColumnPos
.
start
.
line
let
currentLineNumber
=
lineColumnPos
.
start
.
line
let
content
=
this
.
compilation
.
lastCompilationResult
.
source
.
sources
[
this
.
filename
].
content
.
split
(
"
\
n"
)
let
content
=
this
.
compilation
.
lastCompilationResult
.
source
.
sources
[
this
.
filename
].
content
.
split
(
'
\
n'
)
return
content
[
currentLineNumber
]
return
content
[
currentLineNumber
]
}
}
startDebug
(
txNumber
,
filename
,
cb
)
{
startDebug
(
txNumber
,
filename
,
cb
)
{
const
self
=
this
const
self
=
this
this
.
filename
=
filename
this
.
filename
=
filename
this
.
txHash
=
txNumber
this
.
txHash
=
txNumber
this
.
debugger
.
debug
(
null
,
txNumber
,
null
,
()
=>
{
this
.
debugger
.
debug
(
null
,
txNumber
,
null
,
()
=>
{
self
.
debugger
.
event
.
register
(
'newSourceLocation'
,
function
(
lineColumnPos
,
rawLocation
)
{
self
.
debugger
.
event
.
register
(
'newSourceLocation'
,
function
(
lineColumnPos
,
rawLocation
)
{
self
.
lineColumnPos
=
lineColumnPos
self
.
lineColumnPos
=
lineColumnPos
self
.
rawLocation
=
rawLocation
self
.
rawLocation
=
rawLocation
self
.
events
.
emit
(
"source"
,
[
lineColumnPos
,
rawLocation
])
self
.
events
.
emit
(
'source'
,
[
lineColumnPos
,
rawLocation
])
})
;
})
self
.
debugger
.
vmDebuggerLogic
.
event
.
register
(
'solidityState'
,
(
data
)
=>
{
self
.
debugger
.
vmDebuggerLogic
.
event
.
register
(
'solidityState'
,
(
data
)
=>
{
self
.
solidityState
=
data
self
.
solidityState
=
data
self
.
events
.
emit
(
"globals"
,
data
)
self
.
events
.
emit
(
'globals'
,
data
)
})
;
})
// TODO: this doesnt work too well, it should request the data instead...
// TODO: this doesnt work too well, it should request the data instead...
self
.
debugger
.
vmDebuggerLogic
.
event
.
register
(
'solidityLocals'
,
(
data
)
=>
{
self
.
debugger
.
vmDebuggerLogic
.
event
.
register
(
'solidityLocals'
,
(
data
)
=>
{
if
(
JSON
.
stringify
(
data
)
===
'{}'
)
return
if
(
JSON
.
stringify
(
data
)
===
'{}'
)
return
self
.
solidityLocals
=
data
self
.
solidityLocals
=
data
self
.
events
.
emit
(
"locals"
,
data
)
self
.
events
.
emit
(
'locals'
,
data
)
})
;
})
if
(
cb
)
{
if
(
cb
)
{
// TODO: this should be an onReady event
// TODO: this should be an onReady event
setTimeout
(
cb
,
1000
)
;
setTimeout
(
cb
,
1000
)
}
}
})
})
}
}
getVars
()
{
getVars
()
{
return
{
return
{
locals
:
this
.
solidityLocals
,
locals
:
this
.
solidityLocals
,
contract
:
this
.
solidityState
contract
:
this
.
solidityState
}
}
}
}
triggerSourceUpdate
()
{
triggerSourceUpdate
()
{
this
.
events
.
emit
(
"source"
,
[
this
.
lineColumnPos
,
this
.
rawLocation
])
this
.
events
.
emit
(
'source'
,
[
this
.
lineColumnPos
,
this
.
rawLocation
])
}
}
stepJumpNextBreakpoint
()
{
stepJumpNextBreakpoint
()
{
this
.
debugger
.
step_manager
.
jumpNextBreakpoint
()
this
.
debugger
.
step_manager
.
jumpNextBreakpoint
()
}
}
stepJumpPreviousBreakpoint
()
{
stepJumpPreviousBreakpoint
()
{
this
.
debugger
.
step_manager
.
jumpPreviousBreakpoint
()
this
.
debugger
.
step_manager
.
jumpPreviousBreakpoint
()
}
}
stepOverForward
(
solidityMode
)
{
stepOverForward
(
solidityMode
)
{
this
.
debugger
.
step_manager
.
stepOverForward
(
solidityMode
)
this
.
debugger
.
step_manager
.
stepOverForward
(
solidityMode
)
}
}
stepOverBack
(
solidityMode
)
{
stepOverBack
(
solidityMode
)
{
this
.
debugger
.
step_manager
.
stepOverBack
(
solidityMode
)
this
.
debugger
.
step_manager
.
stepOverBack
(
solidityMode
)
}
}
stepIntoForward
(
solidityMode
)
{
stepIntoForward
(
solidityMode
)
{
this
.
debugger
.
step_manager
.
stepIntoForward
(
solidityMode
)
this
.
debugger
.
step_manager
.
stepIntoForward
(
solidityMode
)
}
}
stepIntoBack
(
solidityMode
)
{
stepIntoBack
(
solidityMode
)
{
this
.
debugger
.
step_manager
.
stepIntoBack
(
solidityMode
)
this
.
debugger
.
step_manager
.
stepIntoBack
(
solidityMode
)
}
}
jumpTo
(
step
)
{
jumpTo
(
step
)
{
this
.
debugger
.
step_manager
.
jumpTo
(
step
)
this
.
debugger
.
step_manager
.
jumpTo
(
step
)
}
}
getTraceLength
()
{
getTraceLength
()
{
if
(
!
this
.
debugger
.
step_manager
)
return
0
;
if
(
!
this
.
debugger
.
step_manager
)
return
0
return
this
.
debugger
.
step_manager
.
traceLength
return
this
.
debugger
.
step_manager
.
traceLength
}
}
getCodeFirstStep
()
{
getCodeFirstStep
()
{
if
(
!
this
.
debugger
.
step_manager
)
return
0
;
if
(
!
this
.
debugger
.
step_manager
)
return
0
return
this
.
debugger
.
step_manager
.
calculateFirstStep
()
return
this
.
debugger
.
step_manager
.
calculateFirstStep
()
}
}
getCodeTraceLength
()
{
getCodeTraceLength
()
{
if
(
!
this
.
debugger
.
step_manager
)
return
0
;
if
(
!
this
.
debugger
.
step_manager
)
return
0
return
this
.
debugger
.
step_manager
.
calculateCodeLength
()
return
this
.
debugger
.
step_manager
.
calculateCodeLength
()
}
}
nextStep
()
{
nextStep
()
{
if
(
!
this
.
debugger
.
step_manager
)
return
0
;
if
(
!
this
.
debugger
.
step_manager
)
return
0
return
this
.
debugger
.
step_manager
.
nextStep
()
return
this
.
debugger
.
step_manager
.
nextStep
()
}
}
previousStep
()
{
previousStep
()
{
if
(
!
this
.
debugger
.
step_manager
)
return
0
;
if
(
!
this
.
debugger
.
step_manager
)
return
0
return
this
.
debugger
.
step_manager
.
previousStep
()
return
this
.
debugger
.
step_manager
.
previousStep
()
}
}
currentStep
()
{
currentStep
()
{
if
(
!
this
.
debugger
.
step_manager
)
return
0
;
if
(
!
this
.
debugger
.
step_manager
)
return
0
return
this
.
debugger
.
step_manager
.
currentStepIndex
return
this
.
debugger
.
step_manager
.
currentStepIndex
}
}
canGoNext
()
{
canGoNext
()
{
return
this
.
currentStep
()
<
this
.
getCodeTraceLength
()
return
this
.
currentStep
()
<
this
.
getCodeTraceLength
()
}
}
canGoPrevious
()
{
canGoPrevious
()
{
return
this
.
currentStep
()
>
this
.
getCodeFirstStep
()
return
this
.
currentStep
()
>
this
.
getCodeFirstStep
()
}
}
unload
()
{
unload
()
{
return
this
.
debugger
.
unload
()
return
this
.
debugger
.
unload
()
}
}
displayLocals
()
{
displayLocals
()
{
console
.
dir
(
"= displayLocals"
)
console
.
dir
(
'= displayLocals'
)
console
.
dir
(
this
.
solidityLocals
)
console
.
dir
(
this
.
solidityLocals
)
}
}
displayGlobals
()
{
displayGlobals
()
{
console
.
dir
(
"= displayGlobals"
)
console
.
dir
(
'= displayGlobals'
)
console
.
dir
(
this
.
solidityState
)
console
.
dir
(
this
.
solidityState
)
}
}
}
}
...
...
remix-debug/src/debugger/debugger.js
View file @
06071125
...
@@ -112,11 +112,11 @@ Debugger.prototype.debugTx = function (tx, loadingCb) {
...
@@ -112,11 +112,11 @@ Debugger.prototype.debugTx = function (tx, loadingCb) {
})
})
this
.
vmDebuggerLogic
=
new
VmDebuggerLogic
(
this
.
debugger
,
tx
,
this
.
step_manager
,
this
.
debugger
.
traceManager
,
this
.
debugger
.
codeManager
,
this
.
debugger
.
solidityProxy
,
this
.
debugger
.
callTree
)
this
.
vmDebuggerLogic
=
new
VmDebuggerLogic
(
this
.
debugger
,
tx
,
this
.
step_manager
,
this
.
debugger
.
traceManager
,
this
.
debugger
.
codeManager
,
this
.
debugger
.
solidityProxy
,
this
.
debugger
.
callTree
)
this
.
vmDebuggerLogic
.
start
()
this
.
vmDebuggerLogic
.
start
()
this
.
step_manager
.
event
.
register
(
'stepChanged'
,
this
,
function
(
stepIndex
)
{
this
.
step_manager
.
event
.
register
(
'stepChanged'
,
this
,
function
(
stepIndex
)
{
if
(
!
stepIndex
)
{
if
(
!
stepIndex
)
{
return
self
.
event
.
trigger
(
"endDebug"
)
return
self
.
event
.
trigger
(
'endDebug'
)
}
}
self
.
debugger
.
codeManager
.
resolveStep
(
stepIndex
,
tx
)
self
.
debugger
.
codeManager
.
resolveStep
(
stepIndex
,
tx
)
...
...
remix-debug/src/debugger/solidityLocals.js
View file @
06071125
...
@@ -40,7 +40,7 @@ class DebuggerSolidityLocals {
...
@@ -40,7 +40,7 @@ class DebuggerSolidityLocals {
self
.
stepManager
.
currentStepIndex
,
self
.
stepManager
.
currentStepIndex
,
(
error
,
result
)
=>
{
(
error
,
result
)
=>
{
if
(
error
)
{
if
(
error
)
{
return
error
;
return
error
}
}
var
stack
=
result
[
0
].
value
var
stack
=
result
[
0
].
value
var
memory
=
result
[
1
].
value
var
memory
=
result
[
1
].
value
...
...
remix-debug/src/debugger/solidityState.js
View file @
06071125
...
@@ -39,11 +39,10 @@ class DebuggerSolidityState {
...
@@ -39,11 +39,10 @@ class DebuggerSolidityState {
// necessary due to some states that can crash the debugger
// necessary due to some states that can crash the debugger
try
{
try
{
self
.
decode
(
index
)
self
.
decode
(
index
)
}
catch
(
err
)
{
}
catch
(
err
)
{
console
.
dir
(
"====> error"
)
console
.
dir
(
'====> error'
)
console
.
dir
(
err
)
console
.
dir
(
err
)
}
}
},
500
)
},
500
)
}
}
...
...
remix-debug/src/debugger/stepManager.js
View file @
06071125
...
@@ -158,17 +158,17 @@ class DebuggerStepManager {
...
@@ -158,17 +158,17 @@ class DebuggerStepManager {
this
.
debugger
.
breakpointManager
.
jumpPreviousBreakpoint
(
this
.
currentStepIndex
,
true
)
this
.
debugger
.
breakpointManager
.
jumpPreviousBreakpoint
(
this
.
currentStepIndex
,
true
)
}
}
calculateFirstStep
()
{
calculateFirstStep
()
{
let
step
=
this
.
resolveToReducedTrace
(
0
,
1
)
let
step
=
this
.
resolveToReducedTrace
(
0
,
1
)
return
this
.
resolveToReducedTrace
(
step
,
1
)
return
this
.
resolveToReducedTrace
(
step
,
1
)
}
}
calculateCodeStepList
()
{
calculateCodeStepList
()
{
let
step
=
0
let
step
=
0
let
steps
=
[]
let
steps
=
[]
while
(
step
<
this
.
traceLength
)
{
while
(
step
<
this
.
traceLength
)
{
let
_step
=
this
.
resolveToReducedTrace
(
step
,
1
)
let
_step
=
this
.
resolveToReducedTrace
(
step
,
1
)
if
(
!
_step
)
break
;
if
(
!
_step
)
break
steps
.
push
(
_step
)
steps
.
push
(
_step
)
step
+=
1
step
+=
1
}
}
...
@@ -176,17 +176,17 @@ class DebuggerStepManager {
...
@@ -176,17 +176,17 @@ class DebuggerStepManager {
return
steps
return
steps
}
}
calculateCodeLength
()
{
calculateCodeLength
()
{
let
steps
=
this
.
calculateCodeStepList
().
reverse
()
this
.
calculateCodeStepList
().
reverse
()
return
this
.
calculateCodeStepList
().
reverse
()[
1
]
||
this
.
traceLength
;
return
this
.
calculateCodeStepList
().
reverse
()[
1
]
||
this
.
traceLength
}
}
nextStep
()
{
nextStep
()
{
return
this
.
resolveToReducedTrace
(
this
.
currentStepIndex
,
1
)
;
return
this
.
resolveToReducedTrace
(
this
.
currentStepIndex
,
1
)
}
}
previousStep
()
{
previousStep
()
{
return
this
.
resolveToReducedTrace
(
this
.
currentStepIndex
,
-
1
)
;
return
this
.
resolveToReducedTrace
(
this
.
currentStepIndex
,
-
1
)
}
}
resolveToReducedTrace
(
value
,
incr
)
{
resolveToReducedTrace
(
value
,
incr
)
{
...
...
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