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
9845029a
Commit
9845029a
authored
Jan 20, 2015
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
StdVm by default
parent
375cc67b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
8 deletions
+14
-8
debugger.qml
cmd/mist/assets/debugger/debugger.qml
+2
-1
debugger.go
cmd/mist/debugger.go
+3
-0
ui_lib.go
cmd/mist/ui_lib.go
+3
-3
execution.go
core/execution.go
+1
-1
vm.go
vm/vm.go
+4
-2
vm_jit.go
vm/vm_jit.go
+1
-1
No files found.
cmd/mist/assets/debugger/debugger.qml
View file @
9845029a
...
@@ -19,7 +19,7 @@ ApplicationWindow {
...
@@ -19,7 +19,7 @@ ApplicationWindow {
property
alias
dataText
:
rawDataField
.
text
property
alias
dataText
:
rawDataField
.
text
onClosing
:
{
onClosing
:
{
dbg
.
Stop
()
//
dbg.Stop()
}
}
menuBar
:
MenuBar
{
menuBar
:
MenuBar
{
...
@@ -353,6 +353,7 @@ ApplicationWindow {
...
@@ -353,6 +353,7 @@ ApplicationWindow {
ComboBox
{
ComboBox
{
visible
:
false
id
:
snippets
id
:
snippets
anchors.right
:
parent
.
right
anchors.right
:
parent
.
right
model
:
ListModel
{
model
:
ListModel
{
...
...
cmd/mist/debugger.go
View file @
9845029a
...
@@ -267,6 +267,9 @@ type storeVal struct {
...
@@ -267,6 +267,9 @@ type storeVal struct {
Key
,
Value
string
Key
,
Value
string
}
}
func
(
self
*
Debugger
)
Step
(
evm
vm
.
VirtualMachine
,
op
vm
.
OpCode
,
mem
*
vm
.
Memory
,
stack
*
vm
.
Stack
,
context
*
vm
.
Context
)
{
}
func
(
self
*
Debugger
)
BreakHook
(
pc
int
,
op
vm
.
OpCode
,
mem
*
vm
.
Memory
,
stack
*
vm
.
Stack
,
stateObject
*
state
.
StateObject
)
bool
{
func
(
self
*
Debugger
)
BreakHook
(
pc
int
,
op
vm
.
OpCode
,
mem
*
vm
.
Memory
,
stack
*
vm
.
Stack
,
stateObject
*
state
.
StateObject
)
bool
{
self
.
main
.
Logln
(
"break on instr:"
,
pc
)
self
.
main
.
Logln
(
"break on instr:"
,
pc
)
...
...
cmd/mist/ui_lib.go
View file @
9845029a
...
@@ -212,16 +212,16 @@ func (self *UiLib) StartDbWithContractAndData(contractHash, data string) {
...
@@ -212,16 +212,16 @@ func (self *UiLib) StartDbWithContractAndData(contractHash, data string) {
dbWindow
:=
NewDebuggerWindow
(
self
)
dbWindow
:=
NewDebuggerWindow
(
self
)
object
:=
self
.
eth
.
ChainManager
()
.
State
()
.
GetStateObject
(
ethutil
.
Hex2Bytes
(
contractHash
))
object
:=
self
.
eth
.
ChainManager
()
.
State
()
.
GetStateObject
(
ethutil
.
Hex2Bytes
(
contractHash
))
if
len
(
object
.
Code
)
>
0
{
if
len
(
object
.
Code
)
>
0
{
dbWindow
.
SetCode
(
"0x"
+
ethutil
.
Bytes2Hex
(
object
.
Code
))
dbWindow
.
SetCode
(
ethutil
.
Bytes2Hex
(
object
.
Code
))
}
}
dbWindow
.
SetData
(
"0x"
+
data
)
dbWindow
.
SetData
(
data
)
dbWindow
.
Show
()
dbWindow
.
Show
()
}
}
func
(
self
*
UiLib
)
StartDbWithCode
(
code
string
)
{
func
(
self
*
UiLib
)
StartDbWithCode
(
code
string
)
{
dbWindow
:=
NewDebuggerWindow
(
self
)
dbWindow
:=
NewDebuggerWindow
(
self
)
dbWindow
.
SetCode
(
"0x"
+
code
)
dbWindow
.
SetCode
(
code
)
dbWindow
.
Show
()
dbWindow
.
Show
()
}
}
...
...
core/execution.go
View file @
9845029a
...
@@ -33,7 +33,7 @@ func (self *Execution) Call(codeAddr []byte, caller vm.ContextRef) ([]byte, erro
...
@@ -33,7 +33,7 @@ func (self *Execution) Call(codeAddr []byte, caller vm.ContextRef) ([]byte, erro
func
(
self
*
Execution
)
exec
(
code
,
contextAddr
[]
byte
,
caller
vm
.
ContextRef
)
(
ret
[]
byte
,
err
error
)
{
func
(
self
*
Execution
)
exec
(
code
,
contextAddr
[]
byte
,
caller
vm
.
ContextRef
)
(
ret
[]
byte
,
err
error
)
{
env
:=
self
.
env
env
:=
self
.
env
evm
:=
vm
.
New
(
env
,
vm
.
StdVmTy
)
evm
:=
vm
.
New
(
env
)
if
env
.
Depth
()
==
vm
.
MaxCallDepth
{
if
env
.
Depth
()
==
vm
.
MaxCallDepth
{
caller
.
ReturnGas
(
self
.
Gas
,
self
.
price
)
caller
.
ReturnGas
(
self
.
Gas
,
self
.
price
)
...
...
vm/vm.go
View file @
9845029a
...
@@ -17,7 +17,6 @@ type Vm struct {
...
@@ -17,7 +17,6 @@ type Vm struct {
err
error
err
error
// Debugging
Dbg
Debugger
Dbg
Debugger
BreakPoints
[]
int64
BreakPoints
[]
int64
...
@@ -27,7 +26,7 @@ type Vm struct {
...
@@ -27,7 +26,7 @@ type Vm struct {
Recoverable
bool
Recoverable
bool
}
}
func
New
Vm
(
env
Environment
)
*
Vm
{
func
New
(
env
Environment
)
*
Vm
{
lt
:=
LogTyPretty
lt
:=
LogTyPretty
if
ethutil
.
Config
.
Diff
{
if
ethutil
.
Config
.
Diff
{
lt
=
LogTyDiff
lt
=
LogTyDiff
...
@@ -111,6 +110,9 @@ func (self *Vm) Run(me, caller ContextRef, code []byte, value, gas, price *big.I
...
@@ -111,6 +110,9 @@ func (self *Vm) Run(me, caller ContextRef, code []byte, value, gas, price *big.I
op
=
context
.
GetOp
(
pc
)
op
=
context
.
GetOp
(
pc
)
self
.
Printf
(
"(pc) %-3d -o- %-14s (m) %-4d (s) %-4d "
,
pc
,
op
.
String
(),
mem
.
Len
(),
stack
.
Len
())
self
.
Printf
(
"(pc) %-3d -o- %-14s (m) %-4d (s) %-4d "
,
pc
,
op
.
String
(),
mem
.
Len
(),
stack
.
Len
())
if
self
.
Dbg
!=
nil
{
//self.Dbg.Step(self, op, mem, stack, context)
}
newMemSize
,
gas
:=
self
.
calculateGasAndSize
(
context
,
caller
,
op
,
statedb
,
mem
,
stack
)
newMemSize
,
gas
:=
self
.
calculateGasAndSize
(
context
,
caller
,
op
,
statedb
,
mem
,
stack
)
...
...
vm/vm_jit.go
View file @
9845029a
...
@@ -8,7 +8,7 @@ type JitVm struct {
...
@@ -8,7 +8,7 @@ type JitVm struct {
}
}
func
NewJitVm
(
env
Environment
)
*
JitVm
{
func
NewJitVm
(
env
Environment
)
*
JitVm
{
backupVm
:=
New
Vm
(
env
)
backupVm
:=
New
(
env
)
return
&
JitVm
{
env
:
env
,
backup
:
backupVm
}
return
&
JitVm
{
env
:
env
,
backup
:
backupVm
}
}
}
...
...
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