good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
bor
Commits
8e511744
Commit
8e511744
authored
Jul 5, 2014
by
Jeffrey Wilcke
Browse files
Options
Downloads
Patches
Plain Diff
New type of debugger
parent
9754c01f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
ethereal/debugger.go
+32
-12
32 additions, 12 deletions
ethereal/debugger.go
with
32 additions
and
12 deletions
ethereal/debugger.go
+
32
−
12
View file @
8e511744
...
@@ -17,7 +17,6 @@ type DebuggerWindow struct {
...
@@ -17,7 +17,6 @@ type DebuggerWindow struct {
vm
*
ethchain
.
Vm
vm
*
ethchain
.
Vm
Db
*
Debugger
Db
*
Debugger
breakPoints
[]
int64
}
}
func
NewDebuggerWindow
(
lib
*
UiLib
)
*
DebuggerWindow
{
func
NewDebuggerWindow
(
lib
*
UiLib
)
*
DebuggerWindow
{
...
@@ -30,9 +29,11 @@ func NewDebuggerWindow(lib *UiLib) *DebuggerWindow {
...
@@ -30,9 +29,11 @@ func NewDebuggerWindow(lib *UiLib) *DebuggerWindow {
}
}
win
:=
component
.
CreateWindow
(
nil
)
win
:=
component
.
CreateWindow
(
nil
)
db
:=
&
Debugger
{
win
,
make
(
chan
bool
),
make
(
chan
bool
),
true
,
false
}
return
&
DebuggerWindow
{
engine
:
engine
,
win
:
win
,
lib
:
lib
,
Db
:
db
,
vm
:
&
ethchain
.
Vm
{}}
w
:=
&
DebuggerWindow
{
engine
:
engine
,
win
:
win
,
lib
:
lib
,
vm
:
&
ethchain
.
Vm
{}}
w
.
Db
=
NewDebugger
(
w
)
return
w
}
}
func
(
self
*
DebuggerWindow
)
Show
()
{
func
(
self
*
DebuggerWindow
)
Show
()
{
...
@@ -138,8 +139,7 @@ func (self *DebuggerWindow) Debug(valueStr, gasStr, gasPriceStr, scriptStr, data
...
@@ -138,8 +139,7 @@ func (self *DebuggerWindow) Debug(valueStr, gasStr, gasPriceStr, scriptStr, data
Value
:
ethutil
.
Big
(
valueStr
),
Value
:
ethutil
.
Big
(
valueStr
),
})
})
vm
.
Verbose
=
true
vm
.
Verbose
=
true
vm
.
Hook
=
self
.
Db
.
halting
vm
.
Dbg
=
self
.
Db
vm
.
BreakPoints
=
self
.
breakPoints
self
.
vm
=
vm
self
.
vm
=
vm
self
.
Db
.
done
=
false
self
.
Db
.
done
=
false
...
@@ -201,8 +201,7 @@ func (self *DebuggerWindow) ExecCommand(command string) {
...
@@ -201,8 +201,7 @@ func (self *DebuggerWindow) ExecCommand(command string) {
self
.
Logln
(
err
)
self
.
Logln
(
err
)
break
break
}
}
self
.
breakPoints
=
append
(
self
.
breakPoints
,
int64
(
lineNo
))
self
.
Db
.
breakPoints
=
append
(
self
.
Db
.
breakPoints
,
int64
(
lineNo
))
self
.
vm
.
BreakPoints
=
self
.
breakPoints
self
.
Logf
(
"break point set on instruction %d"
,
lineNo
)
self
.
Logf
(
"break point set on instruction %d"
,
lineNo
)
}
else
{
}
else
{
self
.
Logf
(
"'%s' requires line number"
,
cmd
[
0
])
self
.
Logf
(
"'%s' requires line number"
,
cmd
[
0
])
...
@@ -211,8 +210,7 @@ func (self *DebuggerWindow) ExecCommand(command string) {
...
@@ -211,8 +210,7 @@ func (self *DebuggerWindow) ExecCommand(command string) {
if
len
(
cmd
)
>
1
{
if
len
(
cmd
)
>
1
{
switch
cmd
[
1
]
{
switch
cmd
[
1
]
{
case
"break"
,
"bp"
:
case
"break"
,
"bp"
:
self
.
breakPoints
=
nil
self
.
Db
.
breakPoints
=
nil
self
.
vm
.
BreakPoints
=
nil
self
.
Logln
(
"Breakpoints cleared"
)
self
.
Logln
(
"Breakpoints cleared"
)
case
"log"
:
case
"log"
:
...
@@ -231,16 +229,38 @@ func (self *DebuggerWindow) ExecCommand(command string) {
...
@@ -231,16 +229,38 @@ func (self *DebuggerWindow) ExecCommand(command string) {
}
}
type
Debugger
struct
{
type
Debugger
struct
{
win
*
qml
.
Window
N
chan
bool
N
chan
bool
Q
chan
bool
Q
chan
bool
done
,
interrupt
bool
done
,
interrupt
bool
breakPoints
[]
int64
main
*
DebuggerWindow
win
*
qml
.
Window
}
func
NewDebugger
(
main
*
DebuggerWindow
)
*
Debugger
{
db
:=
&
Debugger
{
make
(
chan
bool
),
make
(
chan
bool
),
true
,
false
,
nil
,
main
,
main
.
win
}
return
db
}
}
type
storeVal
struct
{
type
storeVal
struct
{
Key
,
Value
string
Key
,
Value
string
}
}
func
(
self
*
Debugger
)
BreakHook
(
pc
int
,
op
ethchain
.
OpCode
,
mem
*
ethchain
.
Memory
,
stack
*
ethchain
.
Stack
,
stateObject
*
ethchain
.
StateObject
)
bool
{
self
.
main
.
Logln
(
"break on instr:"
,
pc
)
return
self
.
halting
(
pc
,
op
,
mem
,
stack
,
stateObject
)
}
func
(
self
*
Debugger
)
StepHook
(
pc
int
,
op
ethchain
.
OpCode
,
mem
*
ethchain
.
Memory
,
stack
*
ethchain
.
Stack
,
stateObject
*
ethchain
.
StateObject
)
bool
{
return
self
.
halting
(
pc
,
op
,
mem
,
stack
,
stateObject
)
}
func
(
self
*
Debugger
)
BreakPoints
()
[]
int64
{
return
self
.
breakPoints
}
func
(
d
*
Debugger
)
halting
(
pc
int
,
op
ethchain
.
OpCode
,
mem
*
ethchain
.
Memory
,
stack
*
ethchain
.
Stack
,
stateObject
*
ethchain
.
StateObject
)
bool
{
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
(
"setInstruction"
,
pc
)
d
.
win
.
Root
()
.
Call
(
"clearMem"
)
d
.
win
.
Root
()
.
Call
(
"clearMem"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment