本文整理汇总了Golang中exp/eval.Thread.Abort方法的典型用法代码示例。如果您正苦于以下问题:Golang Thread.Abort方法的具体用法?Golang Thread.Abort怎么用?Golang Thread.Abort使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类exp/eval.Thread
的用法示例。
在下文中一共展示了Thread.Abort方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: fnOut
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()
}
示例2: fnBpSet
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)
}
示例3: fnContWait
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()
}
示例4: Get
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")
}
示例5: Assign
func (v remotePackage) Assign(t *eval.Thread, o eval.Value) {
t.Abort(ReadOnlyError("remote packages cannot be assigned to"))
}
示例6: Set
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"))
}