func fnOut(t *eval.Thread, args []eval.Value, res []eval.Value) { if curProc == nil { t.Abort(NoCurrentGoroutine{}) } err := curProc.Out() if err != nil { t.Abort(err) } // TODO(austin) Only in the command form printCurFrame() }
func fnBpSet(t *eval.Thread, args []eval.Value, res []eval.Value) { // TODO(austin) This probably shouldn't take a symbol name. // Perhaps it should take an interface that provides PC's. // Functions and instructions can implement that interface and // we can have something to translate file:line pairs. if curProc == nil { t.Abort(NoCurrentGoroutine{}) } name := args[0].(eval.StringValue).Get(t) fn := curProc.syms.LookupFunc(name) if fn == nil { t.Abort(UsageError("no such function " + name)) } curProc.OnBreakpoint(proc.Word(fn.Entry)).AddHandler(EventStop) }
func fnContWait(t *eval.Thread, args []eval.Value, res []eval.Value) { if curProc == nil { t.Abort(NoCurrentGoroutine{}) } err := curProc.ContWait() if err != nil { t.Abort(err) } // TODO(austin) Only in the command form ev := curProc.Event() if ev != nil { fmt.Printf("%v\n", ev) } printCurFrame() }
func (v remoteFramePtr) Get(t *eval.Thread) eval.Value { g := v.p.curGoroutine if g == nil || g.frame == nil { t.Abort(NoCurrentGoroutine{}) } for f := g.frame; f != nil; f = f.aOuter(t) { if f.fn != v.fn { continue } // TODO(austin): Register for shootdown with f return v.rt.mk(remote{f.fp, v.p}) } t.Abort(NotOnStack{v.fn, g}) panic("fail") }
func (v remotePackage) Assign(t *eval.Thread, o eval.Value) { t.Abort(ReadOnlyError("remote packages cannot be assigned to")) }
func (v remoteFramePtr) Set(t *eval.Thread, x eval.Value) { // Theoretically this could be a static error. If remote // packages were packages, remote frames could just be defined // as constants. t.Abort(ReadOnlyError("remote frames cannot be assigned to")) }