debug.go raw

   1  package gui
   2  
   3  // func (wg *WalletGUI) goRoutines() {
   4  // 	var e error
   5  // 	if wg.App.ActivePageGet() == "goroutines" || wg.unlockPage.ActivePageGet() == "goroutines" {
   6  // 		D.Ln("updating goroutines data")
   7  // 		var b []byte
   8  // 		buf := bytes.NewBuffer(b)
   9  // 		if e = pprof.Lookup("goroutine").WriteTo(buf, 2); E.Chk(e) {
  10  // 		}
  11  // 		lines := strings.Split(buf.String(), "\n")
  12  // 		var out []l.Widget
  13  // 		var clickables []*p9.Clickable
  14  // 		for x := range lines {
  15  // 			i := x
  16  // 			clickables = append(clickables, wg.Clickable())
  17  // 			var text string
  18  // 			if strings.HasPrefix(lines[i], "goroutine") && i < len(lines)-2 {
  19  // 				text = lines[i+2]
  20  // 				text = strings.TrimSpace(strings.Split(text, " ")[0])
  21  // 				// outString += text + "\n"
  22  // 				out = append(
  23  // 					out, func(gtx l.Context) l.Dimensions {
  24  // 						return wg.ButtonLayout(clickables[i]).Embed(
  25  // 							wg.ButtonInset(
  26  // 								0.25,
  27  // 								wg.Caption(text).
  28  // 									Color("DocText").Fn,
  29  // 							).Fn,
  30  // 						).Background("Transparent").SetClick(
  31  // 							func() {
  32  // 								go func() {
  33  // 									out := make([]string, 2)
  34  // 									split := strings.Split(text, ":")
  35  // 									if len(split) > 2 {
  36  // 										out[0] = strings.Join(split[:len(split)-1], ":")
  37  // 										out[1] = split[len(split)-1]
  38  // 									} else {
  39  // 										out[0] = split[0]
  40  // 										out[1] = split[1]
  41  // 									}
  42  // 									D.Ln("path", out[0], "line", out[1])
  43  // 									goland := "goland64.exe"
  44  // 									if runtime.GOOS != "windows" {
  45  // 										goland = "goland"
  46  // 									}
  47  // 									launch := exec.Command(goland, "--line", out[1], out[0])
  48  // 									if e = launch.Start(); E.Chk(e) {
  49  // 									}
  50  // 								}()
  51  // 							},
  52  // 						).
  53  // 							Fn(gtx)
  54  // 					},
  55  // 				)
  56  // 			}
  57  // 		}
  58  // 		// D.Ln(outString)
  59  // 		wg.State.SetGoroutines(out)
  60  // 		wg.invalidate <- struct{}{}
  61  // 	}
  62  // }
  63