In recent versions of GDB, setting a breakpoint on a library function call results in multiple actual breakpoints:
add these lines to your ~/.gdbinit
file and call disaplts
to disable all @plt
breakpoints:
define disaplts
python
import gdb
from StringIO import StringIO
lines=gdb.execute("info break", True, True)
for l in StringIO(lines).readlines():
if "@plt" in l:
bp=l.split()[0]
gdb.execute("disa {0}".format(bp))
print("disabling {0}".format(bp))
end
end
# disable on library load
catch load mylibrarywithplt disaplt
Note: mind the spacing in python code. I recommend you use cat
to paste the content.
EDIT: added "execute on library load" per @WallStProg