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
012de18d
Commit
012de18d
authored
Jan 17, 2019
by
Iuri Matias
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
create rdb bin
parent
fe52033e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
114 additions
and
0 deletions
+114
-0
rdb
remix-debug/bin/rdb
+112
-0
package.json
remix-debug/package.json
+1
-0
test.js
remix-debug/test.js
+1
-0
No files found.
remix-debug/bin/rdb
0 → 100755
View file @
012de18d
#!/usr/bin/env node
const
program
=
require
(
'commander'
)
const
version
=
require
(
'../package.json'
).
version
program
.
command
(
'version'
)
.
description
(
"outputs version number"
)
.
action
(()
=>
{
console
.
log
(
version
)
process
.
exit
(
0
)
})
program
.
command
(
'help'
)
.
description
(
"outputs usage information"
)
.
action
(()
=>
{
program
.
help
()
process
.
exit
(
0
)
})
program
.
option
(
'-f, --file [filename]'
,
'solidity filename to debug'
)
.
option
(
'--tx [txHash]'
,
'transaction hash to debug'
)
.
option
(
'--node [url]'
,
'node to connect to'
)
.
parse
(
process
.
argv
)
var
CmdLine
=
require
(
'../src/cmdline/index.js'
)
var
solc
=
require
(
'solc'
)
var
fs
=
require
(
'fs'
)
var
filename
=
'test/sol/simple_storage.sol'
var
shortFilename
=
'simple_storage.sol'
var
inputJson
=
{
language
:
'Solidity'
,
sources
:
{
},
settings
:
{
optimizer
:
{
enabled
:
true
,
runs
:
200
},
outputSelection
:
{
'*'
:
{
''
:
[
'legacyAST'
],
'*'
:
[
'abi'
,
'metadata'
,
'devdoc'
,
'userdoc'
,
'evm.legacyAssembly'
,
'evm.bytecode'
,
'evm.deployedBytecode'
,
'evm.methodIdentifiers'
,
'evm.gasEstimates'
]
}
}
}
}
inputJson
.
sources
[
shortFilename
]
=
{
content
:
fs
.
readFileSync
(
filename
).
toString
()}
console
.
log
(
'compiling...'
)
let
compilationData
=
JSON
.
parse
(
solc
.
compileStandardWrapper
(
JSON
.
stringify
(
inputJson
)))
var
compilation
=
{}
compilation
.
data
=
compilationData
compilation
.
source
=
{
sources
:
inputJson
.
sources
}
var
cmdLine
=
new
CmdLine
()
cmdLine
.
connect
(
'http'
,
'http://localhost:8545'
)
cmdLine
.
loadCompilationResult
(
compilation
)
cmdLine
.
initDebugger
()
var
tx
=
'0xf510c4f0b1d9ee262d7b9e9e87b4262f275fe029c2c733feef7dfa1e2b1e32aa'
cmdLine
.
startDebug
(
tx
,
shortFilename
)
cmdLine
.
events
.
on
(
'source'
,
()
=>
{
cmdLine
.
getSource
().
forEach
(
console
.
dir
)
})
const
repl
=
require
(
'repl'
)
repl
.
start
({
prompt
:
'> '
,
eval
:
(
cmd
,
context
,
filename
,
cb
)
=>
{
let
command
=
cmd
.
trim
()
if
(
command
===
'next'
||
command
===
'n'
)
{
cmdLine
.
stepOverForward
(
true
)
}
if
(
command
===
'previous'
||
command
===
'p'
||
command
===
'prev'
)
{
cmdLine
.
stepOverBack
(
true
)
}
if
(
command
===
'step'
||
command
===
's'
)
{
cmdLine
.
stepIntoForward
(
true
)
}
if
(
command
===
'stepback'
||
command
===
'sb'
)
{
cmdLine
.
stepIntoBack
(
true
)
}
if
(
command
===
'exit'
||
command
===
'quit'
)
{
process
.
exit
(
0
)
}
if
(
command
===
'var local'
||
command
===
'v l'
||
command
===
'vl'
)
{
cmdLine
.
displayLocals
()
}
if
(
command
===
'var global'
||
command
===
'v g'
||
command
===
'vg'
)
{
cmdLine
.
displayGlobals
()
}
if
(
command
.
split
(
' '
)[
0
]
===
'jump'
)
{
let
stepIndex
=
parseInt
(
command
.
split
(
' '
)[
1
],
10
)
cmdLine
.
jumpTo
(
stepIndex
)
}
cb
(
null
,
''
)
}
})
module
.
exports
=
cmdLine
remix-debug/package.json
View file @
012de18d
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
],
],
"main"
:
"./index.js"
,
"main"
:
"./index.js"
,
"dependencies"
:
{
"dependencies"
:
{
"commander"
:
"^2.19.0"
,
"ethereumjs-util"
:
"^4.5.0"
,
"ethereumjs-util"
:
"^4.5.0"
,
"ethereumjs-vm"
:
"2.4.0"
,
"ethereumjs-vm"
:
"2.4.0"
,
"fast-async"
:
"^6.1.2"
,
"fast-async"
:
"^6.1.2"
,
...
...
remix-debug/
rdb
.js
→
remix-debug/
test
.js
View file @
012de18d
// TODO: this file shoudl be removed at some point
var
CmdLine
=
require
(
'./src/cmdline/index.js'
)
var
CmdLine
=
require
(
'./src/cmdline/index.js'
)
// var compilation = require('./compilation.json')
// var compilation = require('./compilation.json')
...
...
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