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
ce43a950
Commit
ce43a950
authored
Apr 12, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Debug steps
parent
710bbed1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
68 additions
and
45 deletions
+68
-45
wallet.qml
ethereal/assets/qml/wallet.qml
+17
-2
gui.go
ethereal/ui/gui.go
+3
-1
library.go
ethereal/ui/library.go
+1
-0
ui_lib.go
ethereal/ui/ui_lib.go
+47
-42
No files found.
ethereal/assets/qml/wallet.qml
View file @
ce43a950
...
...
@@ -619,7 +619,18 @@ ApplicationWindow {
width
:
800
height
:
600
Item
{
id
:
keyHandler
focus
:
true
Keys.onPressed
:
{
if
(
event
.
key
==
Qt
.
Key_Space
)
{
ui
.
next
()
}
}
}
SplitView
{
anchors.fill
:
parent
property
var
asmModel
:
ListModel
{
id
:
asmModel
...
...
@@ -664,10 +675,14 @@ ApplicationWindow {
}
function
setAsm
(
asm
)
{
//for(var i = 0; i < asm.length; i++) {
asmModel
.
append
({
asm
:
asm
})
//}
}
function
setInstruction
(
num
)
{
asmTableView
.
selection
.
clear
()
asmTableView
.
selection
.
select
(
num
-
1
)
}
function
clearAsm
()
{
asmModel
.
clear
()
}
...
...
ethereal/ui/gui.go
View file @
ce43a950
...
...
@@ -113,10 +113,12 @@ func (ui *Gui) Start(assetPath string) {
ethutil
.
Config
.
Log
.
Infoln
(
"FATAL: asset not found: you can set an alternative asset path on on the command line using option 'asset_path'"
)
panic
(
err
)
}
ui
.
engine
.
LoadFile
(
uiLib
.
AssetPath
(
"qml/transactions.qml"
))
ui
.
win
=
component
.
CreateWindow
(
nil
)
uiLib
.
win
=
ui
.
win
db
:=
&
Debugger
{
ui
.
win
,
make
(
chan
bool
)}
ui
.
lib
.
Db
=
db
uiLib
.
Db
=
db
// Register the ui as a block processor
//ui.eth.BlockManager.SecondaryBlockProcessor = ui
...
...
ethereal/ui/library.go
View file @
ce43a950
...
...
@@ -15,6 +15,7 @@ type EthLib struct {
stateManager
*
ethchain
.
StateManager
blockChain
*
ethchain
.
BlockChain
txPool
*
ethchain
.
TxPool
Db
*
Debugger
}
func
(
lib
*
EthLib
)
ImportAndSetPrivKey
(
privKey
string
)
bool
{
...
...
ethereal/ui/ui_lib.go
View file @
ce43a950
...
...
@@ -16,6 +16,11 @@ import (
"strings"
)
type
memAddr
struct
{
Num
string
Value
string
}
// UI Library that has some basic functionality exposed
type
UiLib
struct
{
engine
*
qml
.
Engine
...
...
@@ -24,6 +29,7 @@ type UiLib struct {
assetPath
string
// The main application window
win
*
qml
.
Window
Db
*
Debugger
}
func
NewUiLib
(
engine
*
qml
.
Engine
,
eth
*
eth
.
Ethereum
,
assetPath
string
)
*
UiLib
{
...
...
@@ -89,48 +95,11 @@ func DefaultAssetPath() string {
return
base
}
type
memAddr
struct
{
Num
string
Value
string
}
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
)
mainInput
,
_
:=
ethutil
.
PreProcess
(
data
)
asm
,
err
:=
mutan
.
Compile
(
strings
.
NewReader
(
mainInput
),
false
)
if
err
!=
nil
{
fmt
.
Println
(
err
)
}
...
...
@@ -160,11 +129,47 @@ func (ui *UiLib) DebugTx(recipient, valueStr, gasStr, gasPriceStr, data string)
TxData
:
nil
,
})
db
:=
&
Debugger
{
ui
,
make
(
chan
bool
)}
ui
.
engine
.
Context
()
.
SetVar
(
"db"
,
db
)
go
func
()
{
callerClosure
.
Call
(
vm
,
nil
,
d
b
.
halting
)
callerClosure
.
Call
(
vm
,
nil
,
ui
.
D
b
.
halting
)
state
.
Reset
()
}()
}
func
(
ui
*
UiLib
)
Next
()
{
ui
.
Db
.
Next
()
}
type
Debugger
struct
{
win
*
qml
.
Window
N
chan
bool
}
func
(
d
*
Debugger
)
halting
(
pc
int
,
op
ethchain
.
OpCode
,
mem
*
ethchain
.
Memory
,
stack
*
ethchain
.
Stack
)
{
d
.
win
.
Root
()
.
Call
(
"setInstruction"
,
pc
)
d
.
win
.
Root
()
.
Call
(
"clearMem"
)
d
.
win
.
Root
()
.
Call
(
"clearStack"
)
addr
:=
0
for
i
:=
0
;
i
+
32
<=
mem
.
Len
();
i
+=
32
{
d
.
win
.
Root
()
.
Call
(
"setMem"
,
memAddr
{
fmt
.
Sprintf
(
"%03d"
,
addr
),
fmt
.
Sprintf
(
"% x"
,
mem
.
Data
()[
i
:
i
+
32
])})
addr
++
}
for
_
,
val
:=
range
stack
.
Data
()
{
d
.
win
.
Root
()
.
Call
(
"setStack"
,
val
.
String
())
}
out
:
for
{
select
{
case
<-
d
.
N
:
break
out
default
:
}
}
}
func
(
d
*
Debugger
)
Next
()
{
d
.
N
<-
true
}
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