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
3ebcf92b
Commit
3ebcf92b
authored
Apr 06, 2018
by
dm4
Committed by
Felix Lange
Apr 06, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/evm: print vm output when debug flag is on (#16326)
parent
c43792a4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
runner.go
cmd/evm/runner.go
+2
-3
logger.go
core/vm/logger.go
+7
-0
No files found.
cmd/evm/runner.go
View file @
3ebcf92b
...
...
@@ -76,6 +76,7 @@ func runCmd(ctx *cli.Context) error {
logconfig
:=
&
vm
.
LogConfig
{
DisableMemory
:
ctx
.
GlobalBool
(
DisableMemoryFlag
.
Name
),
DisableStack
:
ctx
.
GlobalBool
(
DisableStackFlag
.
Name
),
Debug
:
ctx
.
GlobalBool
(
DebugFlag
.
Name
),
}
var
(
...
...
@@ -234,9 +235,7 @@ Gas used: %d
`
,
execTime
,
mem
.
HeapObjects
,
mem
.
Alloc
,
mem
.
TotalAlloc
,
mem
.
NumGC
,
initialGas
-
leftOverGas
)
}
if
tracer
!=
nil
{
tracer
.
CaptureEnd
(
ret
,
initialGas
-
leftOverGas
,
execTime
,
err
)
}
else
{
if
tracer
==
nil
{
fmt
.
Printf
(
"0x%x
\n
"
,
ret
)
if
err
!=
nil
{
fmt
.
Printf
(
" error: %v
\n
"
,
err
)
...
...
core/vm/logger.go
View file @
3ebcf92b
...
...
@@ -45,6 +45,7 @@ type LogConfig struct {
DisableMemory
bool
// disable memory capture
DisableStack
bool
// disable stack capture
DisableStorage
bool
// disable storage capture
Debug
bool
// print output during capture end
Limit
int
// maximum length of output, but zero means unlimited
}
...
...
@@ -184,6 +185,12 @@ func (l *StructLogger) CaptureFault(env *EVM, pc uint64, op OpCode, gas, cost ui
func
(
l
*
StructLogger
)
CaptureEnd
(
output
[]
byte
,
gasUsed
uint64
,
t
time
.
Duration
,
err
error
)
error
{
l
.
output
=
output
l
.
err
=
err
if
l
.
cfg
.
Debug
{
fmt
.
Printf
(
"0x%x
\n
"
,
output
)
if
err
!=
nil
{
fmt
.
Printf
(
" error: %v
\n
"
,
err
)
}
}
return
nil
}
...
...
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