How to set arg -d
through the file ~/.gdbinit but just when a specific binary is loaded in gdb?
Asked
Active
Viewed 764 times
1

Rodrigo Gurgel
- 1,696
- 2
- 15
- 32
1 Answers
1
with python you can add something like the following to your 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

matt
- 5,364
- 1
- 25
- 25