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
0a82e3b7
Commit
0a82e3b7
authored
Sep 19, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stack info
parent
9689a201
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
92 additions
and
31 deletions
+92
-31
debugger.qml
Mist/assets/debugger/debugger.qml
+70
-25
debugger.go
Mist/debugger.go
+20
-4
flags.go
Mist/flags.go
+1
-1
javascript_runtime.go
javascript/javascript_runtime.go
+1
-1
No files found.
Mist/assets/debugger/debugger.qml
View file @
0a82e3b7
...
@@ -86,8 +86,37 @@ ApplicationWindow {
...
@@ -86,8 +86,37 @@ ApplicationWindow {
TableView
{
TableView
{
id
:
asmTableView
id
:
asmTableView
width
:
200
width
:
200
headerVisible
:
false
TableViewColumn
{
role
:
"value"
;
title
:
""
;
width
:
asmTableView
.
width
-
2
}
TableViewColumn
{
role
:
"value"
;
title
:
""
;
width
:
asmTableView
.
width
-
2
}
model
:
asmModel
model
:
asmModel
/*
alternatingRowColors: false
itemDelegate: Item {
Rectangle {
anchors.fill: parent
color: "#DDD"
Text {
anchors {
left: parent.left
right: parent.right
leftMargin: 10
verticalCenter: parent.verticalCenter
}
color: "#333"
elide: styleData.elideMode
text: styleData.value
font.pixelSize: 11
MouseArea {
acceptedButtons: Qt.LeftButton
anchors.fill: parent
onClicked: {
mouse.accepted = true
}
}
}
}
}
*/
}
}
Rectangle
{
Rectangle
{
...
@@ -201,8 +230,8 @@ ApplicationWindow {
...
@@ -201,8 +230,8 @@ ApplicationWindow {
}
}
height
:
parent
.
height
height
:
parent
.
height
width
:
parent
.
width
-
stackTableView
.
width
width
:
parent
.
width
-
stackTableView
.
width
TableViewColumn
{
id
:
mnumColmn
;
role
:
"num"
;
title
:
"#"
;
width
:
50
}
TableViewColumn
{
id
:
mnumColmn
;
role
:
"num"
;
title
:
"#"
;
width
:
50
}
TableViewColumn
{
role
:
"value"
;
title
:
"Memory"
;
width
:
750
}
TableViewColumn
{
role
:
"value"
;
title
:
"Memory"
;
width
:
750
}
model
:
memModel
model
:
memModel
}
}
}
}
...
@@ -223,7 +252,6 @@ ApplicationWindow {
...
@@ -223,7 +252,6 @@ ApplicationWindow {
}
}
}
}
SplitView
{
Rectangle
{
Rectangle
{
height
:
200
height
:
200
width
:
parent
.
width
*
0.66
width
:
parent
.
width
*
0.66
...
@@ -239,15 +267,6 @@ ApplicationWindow {
...
@@ -239,15 +267,6 @@ ApplicationWindow {
}
}
}
}
TextArea
{
objectName
:
"info"
anchors
{
top
:
parent
.
top
bottom
:
parent
.
bottom
}
readOnly
:
true
}
}
}
}
}
}
}
}
...
@@ -271,12 +290,37 @@ ApplicationWindow {
...
@@ -271,12 +290,37 @@ ApplicationWindow {
exec
()
exec
()
}
}
}
}
RowLayout
{
anchors.left
:
dbgCommand
.
right
anchors.leftMargin
:
10
spacing
:
5
y
:
parent
.
height
/
2
-
this
.
height
/
2
Text
{
objectName
:
"stackFrame"
font.pixelSize
:
10
text
:
"<b>stack ptr</b>: 0"
}
Text
{
objectName
:
"stackSize"
font.pixelSize
:
10
text
:
"<b>stack size</b>: 0"
}
Text
{
objectName
:
"memSize"
font.pixelSize
:
10
text
:
"<b>mem size</b>: 0"
}
}
}
}
toolBar
:
ToolBar
{
toolBar
:
ToolBar
{
height
:
30
height
:
30
RowLayout
{
RowLayout
{
spacing
:
5
spacing
:
10
Button
{
Button
{
property
var
enabled
:
true
property
var
enabled
:
true
...
@@ -338,6 +382,7 @@ ApplicationWindow {
...
@@ -338,6 +382,7 @@ ApplicationWindow {
function
setInstruction
(
num
)
{
function
setInstruction
(
num
)
{
asmTableView
.
selection
.
clear
()
asmTableView
.
selection
.
clear
()
asmTableView
.
selection
.
select
(
num
)
asmTableView
.
selection
.
select
(
num
)
asmTableView
.
positionViewAtRow
(
num
,
ListView
.
Center
)
}
}
function
setMem
(
mem
)
{
function
setMem
(
mem
)
{
...
...
Mist/debugger.go
View file @
0a82e3b7
...
@@ -5,6 +5,7 @@ import (
...
@@ -5,6 +5,7 @@ import (
"math/big"
"math/big"
"strconv"
"strconv"
"strings"
"strings"
"unicode"
"github.com/ethereum/eth-go/ethchain"
"github.com/ethereum/eth-go/ethchain"
"github.com/ethereum/eth-go/ethstate"
"github.com/ethereum/eth-go/ethstate"
...
@@ -271,9 +272,20 @@ func (d *Debugger) halting(pc int, op ethvm.OpCode, mem *ethvm.Memory, stack *et
...
@@ -271,9 +272,20 @@ func (d *Debugger) halting(pc int, op ethvm.OpCode, mem *ethvm.Memory, stack *et
d
.
win
.
Root
()
.
Call
(
"clearStorage"
)
d
.
win
.
Root
()
.
Call
(
"clearStorage"
)
addr
:=
0
addr
:=
0
for
i
:=
0
;
i
+
32
<=
mem
.
Len
();
i
+=
32
{
for
i
:=
0
;
i
+
32
<=
mem
.
Len
();
i
+=
16
{
d
.
win
.
Root
()
.
Call
(
"setMem"
,
memAddr
{
fmt
.
Sprintf
(
"%03d"
,
addr
),
fmt
.
Sprintf
(
"% x"
,
mem
.
Data
()[
i
:
i
+
32
])})
dat
:=
mem
.
Data
()[
i
:
i
+
16
]
addr
++
var
str
string
for
_
,
d
:=
range
dat
{
if
unicode
.
IsGraphic
(
rune
(
d
))
{
str
+=
string
(
d
)
}
else
{
str
+=
"?"
}
}
d
.
win
.
Root
()
.
Call
(
"setMem"
,
memAddr
{
fmt
.
Sprintf
(
"%03d"
,
addr
),
fmt
.
Sprintf
(
"%s % x"
,
str
,
dat
)})
addr
+=
16
}
}
for
_
,
val
:=
range
stack
.
Data
()
{
for
_
,
val
:=
range
stack
.
Data
()
{
...
@@ -284,7 +296,11 @@ func (d *Debugger) halting(pc int, op ethvm.OpCode, mem *ethvm.Memory, stack *et
...
@@ -284,7 +296,11 @@ func (d *Debugger) halting(pc int, op ethvm.OpCode, mem *ethvm.Memory, stack *et
d
.
win
.
Root
()
.
Call
(
"setStorage"
,
storeVal
{
fmt
.
Sprintf
(
"% x"
,
key
),
fmt
.
Sprintf
(
"% x"
,
node
.
Str
())})
d
.
win
.
Root
()
.
Call
(
"setStorage"
,
storeVal
{
fmt
.
Sprintf
(
"% x"
,
key
),
fmt
.
Sprintf
(
"% x"
,
node
.
Str
())})
})
})
d
.
win
.
Root
()
.
ObjectByName
(
"info"
)
.
Set
(
"text"
,
fmt
.
Sprintf
(
`stack frame %v`
,
new
(
big
.
Int
)
.
SetBytes
(
mem
.
Get
(
0
,
32
))))
stackFrameAt
:=
new
(
big
.
Int
)
.
SetBytes
(
mem
.
Get
(
0
,
32
))
psize
:=
mem
.
Len
()
-
int
(
new
(
big
.
Int
)
.
SetBytes
(
mem
.
Get
(
0
,
32
))
.
Uint64
())
d
.
win
.
Root
()
.
ObjectByName
(
"stackFrame"
)
.
Set
(
"text"
,
fmt
.
Sprintf
(
`<b>stack ptr</b>: %v`
,
stackFrameAt
))
d
.
win
.
Root
()
.
ObjectByName
(
"stackSize"
)
.
Set
(
"text"
,
fmt
.
Sprintf
(
`<b>stack size</b>: %d`
,
psize
))
d
.
win
.
Root
()
.
ObjectByName
(
"memSize"
)
.
Set
(
"text"
,
fmt
.
Sprintf
(
`<b>mem size</b>: %v`
,
mem
.
Len
()))
out
:
out
:
for
{
for
{
...
...
Mist/flags.go
View file @
0a82e3b7
...
@@ -44,7 +44,7 @@ func defaultAssetPath() string {
...
@@ -44,7 +44,7 @@ func defaultAssetPath() string {
// assume a debug build and use the source directory as
// assume a debug build and use the source directory as
// asset directory.
// asset directory.
pwd
,
_
:=
os
.
Getwd
()
pwd
,
_
:=
os
.
Getwd
()
if
pwd
==
path
.
Join
(
os
.
Getenv
(
"GOPATH"
),
"src"
,
"github.com"
,
"ethereum"
,
"go-ethereum"
,
"
M
ist"
)
{
if
pwd
==
path
.
Join
(
os
.
Getenv
(
"GOPATH"
),
"src"
,
"github.com"
,
"ethereum"
,
"go-ethereum"
,
"
m
ist"
)
{
assetPath
=
path
.
Join
(
pwd
,
"assets"
)
assetPath
=
path
.
Join
(
pwd
,
"assets"
)
}
else
{
}
else
{
switch
runtime
.
GOOS
{
switch
runtime
.
GOOS
{
...
...
javascript/javascript_runtime.go
View file @
0a82e3b7
...
@@ -42,7 +42,7 @@ func (jsre *JSRE) LoadExtFile(path string) {
...
@@ -42,7 +42,7 @@ func (jsre *JSRE) LoadExtFile(path string) {
}
}
func
(
jsre
*
JSRE
)
LoadIntFile
(
file
string
)
{
func
(
jsre
*
JSRE
)
LoadIntFile
(
file
string
)
{
assetPath
:=
path
.
Join
(
os
.
Getenv
(
"GOPATH"
),
"src"
,
"github.com"
,
"ethereum"
,
"go-ethereum"
,
"
M
ist"
,
"assets"
,
"ext"
)
assetPath
:=
path
.
Join
(
os
.
Getenv
(
"GOPATH"
),
"src"
,
"github.com"
,
"ethereum"
,
"go-ethereum"
,
"
m
ist"
,
"assets"
,
"ext"
)
jsre
.
LoadExtFile
(
path
.
Join
(
assetPath
,
file
))
jsre
.
LoadExtFile
(
path
.
Join
(
assetPath
,
file
))
}
}
...
...
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