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
964587b1
Commit
964587b1
authored
Jun 05, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added more debugger output
parent
98811f11
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
debugger.go
ethereal/ui/debugger.go
+13
-4
No files found.
ethereal/ui/debugger.go
View file @
964587b1
...
...
@@ -5,6 +5,7 @@ import (
"github.com/ethereum/eth-go/ethchain"
"github.com/ethereum/eth-go/ethutil"
"github.com/go-qml/qml"
"math/big"
"strings"
)
...
...
@@ -89,15 +90,17 @@ func (self *DebuggerWindow) Debug(valueStr, gasStr, gasPriceStr, scriptStr, data
self
.
win
.
Root
()
.
Call
(
"setAsm"
,
str
)
}
gas
:=
ethutil
.
Big
(
gasStr
)
gasPrice
:=
ethutil
.
Big
(
gasPriceStr
)
// Contract addr as test address
keyPair
:=
ethutil
.
GetKeyRing
()
.
Get
(
0
)
callerTx
:=
ethchain
.
NewContractCreationTx
(
ethutil
.
Big
(
valueStr
),
ethutil
.
Big
(
gasStr
),
ethutil
.
Big
(
gasPriceStr
)
,
script
)
callerTx
:=
ethchain
.
NewContractCreationTx
(
ethutil
.
Big
(
valueStr
),
gas
,
gasPrice
,
script
)
callerTx
.
Sign
(
keyPair
.
PrivateKey
)
state
:=
self
.
lib
.
eth
.
BlockChain
()
.
CurrentBlock
.
State
()
account
:=
self
.
lib
.
eth
.
StateManager
()
.
TransState
()
.
GetAccount
(
keyPair
.
Address
())
contract
:=
ethchain
.
MakeContract
(
callerTx
,
state
)
callerClosure
:=
ethchain
.
NewClosure
(
account
,
contract
,
script
,
state
,
ethutil
.
Big
(
gasStr
),
ethutil
.
Big
(
gasPriceStr
)
)
callerClosure
:=
ethchain
.
NewClosure
(
account
,
contract
,
script
,
state
,
gas
,
gasPrice
)
block
:=
self
.
lib
.
eth
.
BlockChain
()
.
CurrentBlock
vm
:=
ethchain
.
NewVm
(
state
,
self
.
lib
.
eth
.
StateManager
(),
ethchain
.
RuntimeVars
{
...
...
@@ -111,12 +114,18 @@ func (self *DebuggerWindow) Debug(valueStr, gasStr, gasPriceStr, scriptStr, data
})
self
.
Db
.
done
=
false
self
.
Logf
(
"callsize %d"
,
len
(
script
))
go
func
()
{
ret
,
_
,
err
:=
callerClosure
.
Call
(
vm
,
data
,
self
.
Db
.
halting
)
ret
,
g
,
err
:=
callerClosure
.
Call
(
vm
,
data
,
self
.
Db
.
halting
)
self
.
Logln
(
"gas usage"
,
g
,
"total price ="
,
new
(
big
.
Int
)
.
Mul
(
g
,
gasPrice
))
if
err
!=
nil
{
self
.
Logln
(
"exited with errors:"
,
err
)
}
else
{
self
.
Logf
(
"exited: %v"
,
ret
)
if
len
(
ret
)
>
0
{
self
.
Logf
(
"exited: % x"
,
ret
)
}
else
{
self
.
Logf
(
"exited: 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