Skip to content

Commit c951702

Browse files
committed
Merge branch 'develop'
2 parents fc8bd72 + 7d64b58 commit c951702

File tree

16 files changed

+167
-87
lines changed

16 files changed

+167
-87
lines changed

ethereal/assets/debugger/debugger.qml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ ApplicationWindow {
1919
property alias dataText: rawDataField.text
2020

2121
onClosing: {
22-
compileTimer.stop()
22+
//compileTimer.stop()
2323
}
2424

2525
MenuBar {
@@ -86,7 +86,7 @@ ApplicationWindow {
8686
TableView {
8787
id: asmTableView
8888
width: 200
89-
TableViewColumn{ role: "value" ; title: "" ; width: 200 }
89+
TableViewColumn{ role: "value" ; title: "" ; width: asmTableView.width - 2 }
9090
model: asmModel
9191
}
9292

@@ -112,13 +112,15 @@ ApplicationWindow {
112112
anchors.right: settings.left
113113
focus: true
114114

115+
/*
115116
Timer {
116117
id: compileTimer
117118
interval: 500 ; running: true ; repeat: true
118119
onTriggered: {
119-
dbg.compile(codeEditor.text)
120+
dbg.autoComp(codeEditor.text)
120121
}
121122
}
123+
*/
122124
}
123125

124126
Column {

ethereal/assets/qml/webapp.qml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ ApplicationWindow {
191191
inspector.visible = false
192192
}else{
193193
inspector.visible = true
194+
inspector.url = webview.experimental.remoteInspectorUrl
194195
}
195196
}
196197
onDoubleClicked: {
@@ -224,7 +225,6 @@ ApplicationWindow {
224225
WebView {
225226
id: inspector
226227
visible: false
227-
url: webview.experimental.remoteInspectorUrl
228228
anchors {
229229
left: root.left
230230
right: root.right
@@ -238,7 +238,6 @@ ApplicationWindow {
238238
name: "inspectorShown"
239239
PropertyChanges {
240240
target: inspector
241-
url: webview.experimental.remoteInspectorUrl
242241
}
243242
}
244243
]

ethereal/debugger.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,13 @@ func (self *DebuggerWindow) Compile(code string) {
7474
}
7575
}
7676

77+
// Used by QML
78+
func (self *DebuggerWindow) AutoComp(code string) {
79+
if self.Db.done {
80+
self.Compile(code)
81+
}
82+
}
83+
7784
func (self *DebuggerWindow) ClearLog() {
7885
self.win.Root().Call("clearLog")
7986
}
@@ -110,8 +117,6 @@ func (self *DebuggerWindow) Debug(valueStr, gasStr, gasPriceStr, scriptStr, data
110117
return
111118
}
112119

113-
self.SetAsm(script)
114-
115120
var (
116121
gas = ethutil.Big(gasStr)
117122
gasPrice = ethutil.Big(gasPriceStr)
@@ -257,6 +262,10 @@ func (self *Debugger) StepHook(pc int, op ethchain.OpCode, mem *ethchain.Memory,
257262
return self.halting(pc, op, mem, stack, stateObject)
258263
}
259264

265+
func (self *Debugger) SetCode(byteCode []byte) {
266+
self.main.SetAsm(byteCode)
267+
}
268+
260269
func (self *Debugger) BreakPoints() []int64 {
261270
return self.breakPoints
262271
}

ethereal/flags.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ var LogLevel int
3636
// flags specific to gui client
3737
var AssetPath string
3838

39+
//TODO: If we re-use the one defined in cmd.go the binary osx image crashes. If somebody finds out why we can dry this up.
3940
func defaultAssetPath() string {
4041
var assetPath string
4142
// If the current working directory is the go-ethereum dir
@@ -60,7 +61,6 @@ func defaultAssetPath() string {
6061
}
6162
return assetPath
6263
}
63-
6464
func defaultDataDir() string {
6565
usr, _ := user.Current()
6666
return path.Join(usr.HomeDir, ".ethereal")

ethereal/html_container.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"github.com/go-qml/qml"
99
"github.com/howeyc/fsnotify"
1010
"io/ioutil"
11-
"log"
1211
"net/url"
1312
"os"
1413
"path"
@@ -59,7 +58,7 @@ func (app *HtmlApplication) RootFolder() string {
5958
if err != nil {
6059
return ""
6160
}
62-
return path.Dir(folder.RequestURI())
61+
return path.Dir(ethutil.WindonizePath(folder.RequestURI()))
6362
}
6463
func (app *HtmlApplication) RecursiveFolders() []os.FileInfo {
6564
files, _ := ioutil.ReadDir(app.RootFolder())
@@ -77,11 +76,13 @@ func (app *HtmlApplication) NewWatcher(quitChan chan bool) {
7776

7877
app.watcher, err = fsnotify.NewWatcher()
7978
if err != nil {
79+
logger.Infoln("Could not create new auto-reload watcher:", err)
8080
return
8181
}
8282
err = app.watcher.Watch(app.RootFolder())
8383
if err != nil {
84-
log.Fatal(err)
84+
logger.Infoln("Could not start auto-reload watcher:", err)
85+
return
8586
}
8687
for _, folder := range app.RecursiveFolders() {
8788
fullPath := app.RootFolder() + "/" + folder.Name()

ethereum/cmd.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@ package main
22

33
import (
44
"github.com/ethereum/eth-go"
5+
"github.com/ethereum/go-ethereum/ethereum/repl"
56
"github.com/ethereum/go-ethereum/utils"
67
"io/ioutil"
78
"os"
89
)
910

1011
func InitJsConsole(ethereum *eth.Ethereum) {
11-
repl := NewJSRepl(ethereum)
12+
repl := ethrepl.NewJSRepl(ethereum)
1213
go repl.Start()
1314
utils.RegisterInterrupt(func(os.Signal) {
1415
repl.Stop()
@@ -24,7 +25,7 @@ func ExecJsFile(ethereum *eth.Ethereum, InputFile string) {
2425
if err != nil {
2526
logger.Fatalln(err)
2627
}
27-
re := NewJSRE(ethereum)
28+
re := ethrepl.NewJSRE(ethereum)
2829
utils.RegisterInterrupt(func(os.Signal) {
2930
re.Stop()
3031
})

ethereum/flags.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import (
1111

1212
var Identifier string
1313
var KeyRing string
14+
var DiffTool bool
15+
var DiffType string
1416
var KeyStore string
1517
var StartRpc bool
1618
var RpcPort int
@@ -66,6 +68,8 @@ func Init() {
6668
flag.StringVar(&ConfigFile, "conf", defaultConfigFile, "config file")
6769
flag.StringVar(&DebugFile, "debug", "", "debug file (no debugging if not set)")
6870
flag.IntVar(&LogLevel, "loglevel", int(ethlog.InfoLevel), "loglevel: 0-5: silent,error,warn,info,debug,debug detail)")
71+
flag.BoolVar(&DiffTool, "difftool", false, "creates output for diff'ing. Sets LogLevel=0")
72+
flag.StringVar(&DiffType, "diff", "all", "sets the level of diff output [vm, all]. Has no effect if difftool=false")
6973

7074
flag.BoolVar(&StartMining, "mine", false, "start dagger mining")
7175
flag.BoolVar(&StartJsConsole, "js", false, "launches javascript console")

ethereum/main.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package main
22

33
import (
44
"github.com/ethereum/eth-go/ethlog"
5+
"github.com/ethereum/eth-go/ethutil"
56
"github.com/ethereum/go-ethereum/utils"
67
"runtime"
78
)
@@ -20,7 +21,15 @@ func main() {
2021

2122
// precedence: code-internal flag default < config file < environment variables < command line
2223
Init() // parsing command line
24+
25+
// If the difftool option is selected ignore all other log output
26+
if DiffTool {
27+
LogLevel = 0
28+
}
29+
2330
utils.InitConfig(ConfigFile, Datadir, "ETH")
31+
ethutil.Config.Diff = DiffTool
32+
ethutil.Config.DiffType = DiffType
2433

2534
utils.InitDataDir(Datadir)
2635

ethereum/javascript_runtime.go renamed to ethereum/repl/javascript_runtime.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package main
1+
package ethrepl
22

33
import (
44
"fmt"

ethereum/js_lib.go renamed to ethereum/repl/js_lib.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package main
1+
package ethrepl
22

33
const jsLib = `
44
function pp(object) {

0 commit comments

Comments
 (0)