parent
939e87c2e9
commit
f3d6daa29e
2
args.go
2
args.go
|
@ -27,7 +27,7 @@ func ArgDebug() bool {
|
||||||
func init() {
|
func init() {
|
||||||
arg.Register(&argDebugger)
|
arg.Register(&argDebugger)
|
||||||
|
|
||||||
full := "go.wit.com/gui/debugger"
|
full := "go.wit.com/bug/debugger"
|
||||||
short := "bugger"
|
short := "bugger"
|
||||||
|
|
||||||
INFO = log.NewFlag("INFO", false, full, short, "simple debugging Info()")
|
INFO = log.NewFlag("INFO", false, full, short, "simple debugging Info()")
|
||||||
|
|
6
chan.go
6
chan.go
|
@ -7,11 +7,11 @@ package debugger
|
||||||
import (
|
import (
|
||||||
// "regexp"
|
// "regexp"
|
||||||
// "go.wit.com/gui/toolkit"
|
// "go.wit.com/gui/toolkit"
|
||||||
"sync"
|
|
||||||
"runtime"
|
|
||||||
"github.com/sourcegraph/conc"
|
"github.com/sourcegraph/conc"
|
||||||
"github.com/sourcegraph/conc/stream"
|
|
||||||
"github.com/sourcegraph/conc/panics"
|
"github.com/sourcegraph/conc/panics"
|
||||||
|
"github.com/sourcegraph/conc/stream"
|
||||||
|
"runtime"
|
||||||
|
"sync"
|
||||||
|
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
)
|
)
|
||||||
|
|
|
@ -7,9 +7,9 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"go.wit.com/log"
|
|
||||||
"go.wit.com/gui/gui"
|
"go.wit.com/gui/gui"
|
||||||
"go.wit.com/gui/gadgets"
|
"go.wit.com/lib/gadgets"
|
||||||
|
"go.wit.com/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
var debugWG *sync.WaitGroup
|
var debugWG *sync.WaitGroup
|
||||||
|
@ -25,7 +25,7 @@ func DebugGoChannels(p *gui.Node) *gadgets.BasicWindow {
|
||||||
|
|
||||||
// var debugWG sync.WaitGroup
|
// var debugWG sync.WaitGroup
|
||||||
g.NewButton("init()", func() {
|
g.NewButton("init()", func() {
|
||||||
if (debugNumberChan == nil) {
|
if debugNumberChan == nil {
|
||||||
log.Log(CHAN, "making debugNumberChan channel")
|
log.Log(CHAN, "making debugNumberChan channel")
|
||||||
debugNumberChan = make(chan int)
|
debugNumberChan = make(chan int)
|
||||||
} else {
|
} else {
|
||||||
|
@ -94,7 +94,7 @@ func printInt(i int, name string) {
|
||||||
for num := range debugNumberChan {
|
for num := range debugNumberChan {
|
||||||
log.Log(CHAN, "printInt()", name, "read", num, "from channel")
|
log.Log(CHAN, "printInt()", name, "read", num, "from channel")
|
||||||
debugWG.Done()
|
debugWG.Done()
|
||||||
if (tmp == i) {
|
if tmp == i {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
tmp += 1
|
tmp += 1
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
package debugger
|
package debugger
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"fmt"
|
||||||
// "os"
|
// "os"
|
||||||
"runtime"
|
"runtime"
|
||||||
"runtime/debug"
|
"runtime/debug"
|
||||||
"runtime/pprof"
|
"runtime/pprof"
|
||||||
|
|
||||||
"go.wit.com/log"
|
|
||||||
"go.wit.com/gui/gui"
|
"go.wit.com/gui/gui"
|
||||||
"go.wit.com/gui/gadgets"
|
"go.wit.com/lib/gadgets"
|
||||||
|
"go.wit.com/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
func DebugGolangWindow(p *gui.Node) *gadgets.BasicWindow {
|
func DebugGolangWindow(p *gui.Node) *gadgets.BasicWindow {
|
||||||
|
|
14
main.go
14
main.go
|
@ -3,10 +3,10 @@ package debugger
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"go.wit.com/log"
|
|
||||||
"go.wit.com/gui/gui"
|
"go.wit.com/gui/gui"
|
||||||
"go.wit.com/gui/gadgets"
|
"go.wit.com/lib/gadgets"
|
||||||
"go.wit.com/gui/lib/logsettings"
|
"go.wit.com/lib/gui/logsettings"
|
||||||
|
"go.wit.com/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -14,7 +14,7 @@ import (
|
||||||
*/
|
*/
|
||||||
|
|
||||||
func DebugWindow(p *gui.Node) {
|
func DebugWindow(p *gui.Node) {
|
||||||
if (me != nil) {
|
if me != nil {
|
||||||
log.Warn("Draw then Toggle() debuging window here")
|
log.Warn("Draw then Toggle() debuging window here")
|
||||||
me.bugWin.Toggle()
|
me.bugWin.Toggle()
|
||||||
return
|
return
|
||||||
|
@ -74,7 +74,7 @@ func DebugWindow2(newB *gui.Node, title string) *gui.Node {
|
||||||
gr = newB.NewGroup("more things")
|
gr = newB.NewGroup("more things")
|
||||||
|
|
||||||
gr.NewButton("Node.ListChildren(true)", func() {
|
gr.NewButton("Node.ListChildren(true)", func() {
|
||||||
if (activeWidget == nil) {
|
if activeWidget == nil {
|
||||||
activeWidget = bugWin
|
activeWidget = bugWin
|
||||||
}
|
}
|
||||||
activeWidget.ListChildren(true)
|
activeWidget.ListChildren(true)
|
||||||
|
@ -140,7 +140,7 @@ func dropdownWindow(p *gui.Node) {
|
||||||
log.Log(INFO, "The Window was set to", name)
|
log.Log(INFO, "The Window was set to", name)
|
||||||
}
|
}
|
||||||
log.Log(INFO, "dd =", dd)
|
log.Log(INFO, "dd =", dd)
|
||||||
if (activeWidget == nil) {
|
if activeWidget == nil {
|
||||||
// the debug window doesn't exist yet so you can't display the change
|
// the debug window doesn't exist yet so you can't display the change
|
||||||
// TODO: make a fake binary tree for this(?)
|
// TODO: make a fake binary tree for this(?)
|
||||||
return
|
return
|
||||||
|
@ -152,7 +152,7 @@ func dropdownWindow(p *gui.Node) {
|
||||||
dd.AddText(child.GetProgName())
|
dd.AddText(child.GetProgName())
|
||||||
// last = child.Name
|
// last = child.Name
|
||||||
mapWindows[child.GetProgName()] = child
|
mapWindows[child.GetProgName()] = child
|
||||||
if (activeWidget == nil) {
|
if activeWidget == nil {
|
||||||
activeWidget = child
|
activeWidget = child
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,8 @@ package debugger
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"go.wit.com/gui/gui"
|
"go.wit.com/gui/gui"
|
||||||
"go.wit.com/gui/gadgets"
|
"go.wit.com/lib/gadgets"
|
||||||
"go.wit.com/gui/lib/logsettings"
|
"go.wit.com/lib/gui/logsettings"
|
||||||
)
|
)
|
||||||
|
|
||||||
var me *debuggerSettings
|
var me *debuggerSettings
|
||||||
|
@ -26,6 +26,7 @@ type debuggerSettings struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
var bugWin *gui.Node
|
var bugWin *gui.Node
|
||||||
|
|
||||||
/*
|
/*
|
||||||
// main debugging window
|
// main debugging window
|
||||||
var bugTab *gui.Node
|
var bugTab *gui.Node
|
||||||
|
|
14
widget.go
14
widget.go
|
@ -1,16 +1,15 @@
|
||||||
package debugger
|
package debugger
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"strconv"
|
|
||||||
"errors"
|
"errors"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
"go.wit.com/log"
|
|
||||||
"go.wit.com/gui/gui"
|
"go.wit.com/gui/gui"
|
||||||
"go.wit.com/gui/widget"
|
"go.wit.com/lib/gadgets"
|
||||||
"go.wit.com/gui/gadgets"
|
"go.wit.com/lib/widget"
|
||||||
|
"go.wit.com/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
func setActiveWidget(w *gui.Node) {
|
func setActiveWidget(w *gui.Node) {
|
||||||
if (w == nil) {
|
if (w == nil) {
|
||||||
|
@ -59,7 +58,6 @@ func DebugWidgetWindow(p *gui.Node) *gadgets.BasicWindow {
|
||||||
g2 = g.NewGroup("bool B:")
|
g2 = g.NewGroup("bool B:")
|
||||||
activeLabelNewB = g2.NewCheckbox("tmp bool")
|
activeLabelNewB = g2.NewCheckbox("tmp bool")
|
||||||
|
|
||||||
|
|
||||||
// common things that should work against each widget
|
// common things that should work against each widget
|
||||||
g = w.Box().NewGroup("common things")
|
g = w.Box().NewGroup("common things")
|
||||||
g.NewButton("Enable()", func() {
|
g.NewButton("Enable()", func() {
|
||||||
|
@ -127,7 +125,7 @@ func DebugWidgetWindow(p *gui.Node) *gadgets.BasicWindow {
|
||||||
activeJunk = w.Box().NewGroup("junk:")
|
activeJunk = w.Box().NewGroup("junk:")
|
||||||
activeJunk.NewLabel("test junk")
|
activeJunk.NewLabel("test junk")
|
||||||
|
|
||||||
if (activeWidget == nil) {
|
if activeWidget == nil {
|
||||||
setActiveWidget(me.myGui)
|
setActiveWidget(me.myGui)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -217,7 +215,7 @@ func debugAddWidgetButton(n *gui.Node) {
|
||||||
newY := widget.GetInt(activeLabelNewY.String())
|
newY := widget.GetInt(activeLabelNewY.String())
|
||||||
newB := widget.GetBool(activeLabelNewB.String())
|
newB := widget.GetBool(activeLabelNewB.String())
|
||||||
|
|
||||||
if (newY == -1) {
|
if newY == -1 {
|
||||||
name = name + " (" + strconv.Itoa(activeWidget.NextW) + "," + strconv.Itoa(activeWidget.NextH) + ")"
|
name = name + " (" + strconv.Itoa(activeWidget.NextW) + "," + strconv.Itoa(activeWidget.NextH) + ")"
|
||||||
} else {
|
} else {
|
||||||
// activeWidget.SetNext(newX, newY)
|
// activeWidget.SetNext(newX, newY)
|
||||||
|
|
Loading…
Reference in New Issue