Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
47417506
Commit
47417506
authored
May 27, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New debugger implemented
parent
d0b31e20
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
18 deletions
+25
-18
debugger.qml
ethereal/assets/debugger/debugger.qml
+4
-5
wallet.qml
ethereal/assets/qml/wallet.qml
+0
-8
debugger.go
ethereal/ui/debugger.go
+20
-4
gui.go
ethereal/ui/gui.go
+1
-1
No files found.
ethereal/assets/debugger/debugger.qml
View file @
47417506
...
...
@@ -175,19 +175,18 @@ ApplicationWindow {
}
function
setAsm
(
asm
)
{
console
.
log
(
"set asm"
,
asm
)
asmModel
.
append
({
asm
:
asm
})
}
function
clearAsm
()
{
asmModel
.
clear
()
}
function
setInstruction
(
num
)
{
asmTableView
.
selection
.
clear
()
asmTableView
.
selection
.
select
(
num
-
1
)
}
function
clearAsm
()
{
asmModel
.
clear
()
}
function
setMem
(
mem
)
{
memModel
.
append
({
num
:
mem
.
num
,
value
:
mem
.
value
})
}
...
...
ethereal/assets/qml/wallet.qml
View file @
47417506
...
...
@@ -306,14 +306,6 @@ ApplicationWindow {
text: "Connect"
}
*/
Button
{
property
var
enabled
:
true
id
:
debuggerWindow
onClicked
:
{
ui
.
startDebugger
()
}
text
:
"Debugger"
}
Button
{
id
:
importAppButton
...
...
ethereal/ui/debugger.go
View file @
47417506
...
...
@@ -24,7 +24,7 @@ func NewDebuggerWindow(lib *UiLib) *DebuggerWindow {
}
win
:=
component
.
CreateWindow
(
nil
)
db
:=
&
Debugger
{
win
,
make
(
chan
bool
),
true
}
db
:=
&
Debugger
{
win
,
make
(
chan
bool
),
make
(
chan
bool
),
true
}
return
&
DebuggerWindow
{
engine
:
engine
,
win
:
win
,
lib
:
lib
,
Db
:
db
}
}
...
...
@@ -40,8 +40,18 @@ func (self *DebuggerWindow) Show() {
}
func
(
self
*
DebuggerWindow
)
Debug
(
valueStr
,
gasStr
,
gasPriceStr
,
data
string
)
{
if
!
self
.
Db
.
done
{
self
.
Db
.
Q
<-
true
}
state
:=
self
.
lib
.
eth
.
BlockChain
()
.
CurrentBlock
.
State
()
defer
func
()
{
if
r
:=
recover
();
r
!=
nil
{
fmt
.
Println
(
r
)
}
}()
script
,
err
:=
ethutil
.
Compile
(
data
)
if
err
!=
nil
{
ethutil
.
Config
.
Log
.
Debugln
(
err
)
...
...
@@ -50,7 +60,7 @@ func (self *DebuggerWindow) Debug(valueStr, gasStr, gasPriceStr, data string) {
}
dis
:=
ethchain
.
Disassemble
(
script
)
self
.
lib
.
win
.
Root
()
.
Call
(
"clearAsm"
)
self
.
win
.
Root
()
.
Call
(
"clearAsm"
)
for
_
,
str
:=
range
dis
{
self
.
win
.
Root
()
.
Call
(
"setAsm"
,
str
)
...
...
@@ -91,6 +101,7 @@ func (self *DebuggerWindow) Next() {
type
Debugger
struct
{
win
*
qml
.
Window
N
chan
bool
Q
chan
bool
done
bool
}
...
...
@@ -98,7 +109,7 @@ type storeVal struct {
Key
,
Value
string
}
func
(
d
*
Debugger
)
halting
(
pc
int
,
op
ethchain
.
OpCode
,
mem
*
ethchain
.
Memory
,
stack
*
ethchain
.
Stack
,
stateObject
*
ethchain
.
StateObject
)
{
func
(
d
*
Debugger
)
halting
(
pc
int
,
op
ethchain
.
OpCode
,
mem
*
ethchain
.
Memory
,
stack
*
ethchain
.
Stack
,
stateObject
*
ethchain
.
StateObject
)
bool
{
d
.
win
.
Root
()
.
Call
(
"setInstruction"
,
pc
)
d
.
win
.
Root
()
.
Call
(
"clearMem"
)
d
.
win
.
Root
()
.
Call
(
"clearStack"
)
...
...
@@ -123,9 +134,14 @@ out:
select
{
case
<-
d
.
N
:
break
out
default
:
case
<-
d
.
Q
:
d
.
done
=
true
return
false
}
}
return
true
}
func
(
d
*
Debugger
)
Next
()
{
...
...
ethereal/ui/gui.go
View file @
47417506
...
...
@@ -130,7 +130,7 @@ func (gui *Gui) createWindow(comp qml.Object) *qml.Window {
gui
.
win
=
win
gui
.
uiLib
.
win
=
win
db
:=
&
Debugger
{
gui
.
win
,
make
(
chan
bool
),
true
}
db
:=
&
Debugger
{
gui
.
win
,
make
(
chan
bool
),
make
(
chan
bool
),
true
}
gui
.
lib
.
Db
=
db
gui
.
uiLib
.
Db
=
db
...
...
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