Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何set arg -d通过文件 ~/.gdbinit 但仅在 gdb 中加载特定的二进制文件时?
set arg -d
使用 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