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
a9a65859
Commit
a9a65859
authored
Apr 11, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Debugger
parent
8280dd65
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
16 deletions
+40
-16
ui_lib.go
ethereal/ui/ui_lib.go
+40
-16
No files found.
ethereal/ui/ui_lib.go
View file @
a9a65859
...
...
@@ -94,7 +94,40 @@ type memAddr struct {
Value
string
}
func
(
ui
*
UiLib
)
DebugTx
(
recipient
,
valueStr
,
gasStr
,
gasPriceStr
,
data
string
)
(
string
,
error
)
{
type
Debugger
struct
{
ui
*
UiLib
next
chan
bool
}
func
(
d
*
Debugger
)
halting
(
op
ethchain
.
OpCode
,
mem
*
ethchain
.
Memory
,
stack
*
ethchain
.
Stack
)
{
d
.
ui
.
win
.
Root
()
.
Call
(
"clearMem"
)
d
.
ui
.
win
.
Root
()
.
Call
(
"clearStack"
)
addr
:=
0
for
i
:=
0
;
i
+
32
<=
mem
.
Len
();
i
+=
32
{
d
.
ui
.
win
.
Root
()
.
Call
(
"setMem"
,
memAddr
{
fmt
.
Sprintf
(
"%03d"
,
addr
),
fmt
.
Sprintf
(
"% x"
,
mem
.
Data
()[
i
:
i
+
32
])})
addr
++
}
for
_
,
val
:=
range
stack
.
Data
()
{
d
.
ui
.
win
.
Root
()
.
Call
(
"setStack"
,
val
.
String
())
}
out
:
for
{
select
{
case
<-
d
.
next
:
break
out
default
:
}
}
}
func
(
d
*
Debugger
)
Next
()
{
d
.
next
<-
true
}
func
(
ui
*
UiLib
)
DebugTx
(
recipient
,
valueStr
,
gasStr
,
gasPriceStr
,
data
string
)
{
state
:=
ui
.
eth
.
BlockChain
()
.
CurrentBlock
.
State
()
asm
,
err
:=
mutan
.
Compile
(
strings
.
NewReader
(
data
),
false
)
...
...
@@ -126,21 +159,12 @@ func (ui *UiLib) DebugTx(recipient, valueStr, gasStr, gasPriceStr, data string)
Diff
:
block
.
Difficulty
,
TxData
:
nil
,
})
callerClosure
.
Call
(
vm
,
nil
,
func
(
op
ethchain
.
OpCode
,
mem
*
ethchain
.
Memory
,
stack
*
ethchain
.
Stack
)
{
ui
.
win
.
Root
()
.
Call
(
"clearMem"
)
ui
.
win
.
Root
()
.
Call
(
"clearStack"
)
addr
:=
0
for
i
:=
0
;
i
+
32
<=
mem
.
Len
();
i
+=
32
{
ui
.
win
.
Root
()
.
Call
(
"setMem"
,
memAddr
{
fmt
.
Sprintf
(
"%03d"
,
addr
),
fmt
.
Sprintf
(
"% x"
,
mem
.
Data
()[
i
:
i
+
32
])})
addr
++
}
for
_
,
val
:=
range
stack
.
Data
()
{
ui
.
win
.
Root
()
.
Call
(
"setStack"
,
val
.
String
())
}
})
state
.
Reset
()
db
:=
&
Debugger
{
ui
,
make
(
chan
bool
)}
ui
.
engine
.
Context
()
.
SetVar
(
"db"
,
db
)
go
func
()
{
callerClosure
.
Call
(
vm
,
nil
,
db
.
halting
)
return
""
,
nil
state
.
Reset
()
}()
}
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