udk 加载脚本分析
CAUTION!
本篇实际上已经废弃
Automatical execution
每一次执行n或s后自动输出对应的C语言源代码,相应的Python实现代码在script/udk_gdb_script中Edk2StopHandler中对stop-handler的定义.
| class Edk2StopHandler(gdb.Command):
"""Command to be run when target is stopped.
这些代码将在目标的被调试机器停止时执行.
"""
def __init__(self):
#向 Gdb 注册stop-handler命令.
super(Edk2StopHandler, self).__init__("stop-handler", gdb.COMMAND_RUNNING, gdb.COMPLETE_NONE)
def invoke(self, arg, from_tty):
self.dont_repeat()
args = UdkCommandHelper.checkParameter(arg, 0)
if args == None:
return
gdb.execute("refresharch")
if not UdkCommandHelper.supportExpat():
gdb.execute("loadthis")
gdb.execute("info exception")
Edk2StopHandler()
|
在停止时执行是靠如下命令设置的.
| define hook-stop
stop-handler
end
|