如何通过文件〜/.gdbinit进行set arg -d
,但当GDB中加载特定的二进制文件时?
带有python,您可以在gdbinit
中添加类似以下内容py
def on_bin_echo(): gdb.execute("set arg -d")
exec_funcs = {"/bin/echo" : on_bin_echo}
map(lambda x: exec_funcs[x.filename]() if exec_funcs.has_key(x.filename) else None, gdb.objfiles())
end