Exemplo n.º 1
0
func _logFrames(thread *rtda.Thread) {
	for !thread.IsStackEmpty() {
		frame := thread.PopFrame()
		method := frame.Method()
		className := method.Class().Name()
		lineNum := method.GetLineNumber(frame.NextPC())
		fmt.Printf(">> line:%4d pc:%4d %v.%v%v \n",
			lineNum, frame.NextPC(), className, method.Name(), method.Descriptor())
	}
}
Exemplo n.º 2
0
func execMain(thread *rtda.Thread) {
	thread.PopFrame()
	mainClass := _classLoader.LoadClass(_mainClassName)
	mainMethod := mainClass.GetMainMethod()
	if mainMethod != nil {
		newFrame := thread.NewFrame(mainMethod)
		thread.PushFrame(newFrame)
		args := createArgs()
		newFrame.LocalVars().SetRef(0, args)
	} else {
		panic("no main method!") // todo
	}
}