当前位置: 首页>>代码示例>>Golang>>正文


Golang eval.Thread类代码示例

本文整理汇总了Golang中exp/eval.Thread的典型用法代码示例。如果您正苦于以下问题:Golang Thread类的具体用法?Golang Thread怎么用?Golang Thread使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Thread类的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()
}
开发者ID:edisonwsk,项目名称:golang-on-cygwin,代码行数:11,代码来源:cmd.go

示例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)
}
开发者ID:edisonwsk,项目名称:golang-on-cygwin,代码行数:15,代码来源:cmd.go

示例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()
}
开发者ID:edisonwsk,项目名称:golang-on-cygwin,代码行数:15,代码来源:cmd.go

示例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")
}
开发者ID:rapgamer,项目名称:golang-china,代码行数:18,代码来源:vars.go

示例5: Assign

func (v remotePackage) Assign(t *eval.Thread, o eval.Value) {
	t.Abort(ReadOnlyError("remote packages cannot be assigned to"))
}
开发者ID:rapgamer,项目名称:golang-china,代码行数:3,代码来源:vars.go

示例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"))
}
开发者ID:rapgamer,项目名称:golang-china,代码行数:6,代码来源:vars.go


注:本文中的exp/eval.Thread类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。