If there is a way to do this natively in gdb, something like 'load script', then feel free to ignore the emacs part of this question.
I frequently wind up doing the following in a pretty high-count loop:
- start gdb (in emacs if that helps).
- set several breakpoints (same breakpoints every time). Usually have to enter "y" I want to make breakpoint pending on future shared library load.
- set some watchpoints (same watchpoints)
- debug for a while.
- close gdb.
- goto 1.
So it would make my life much easier if I could save the commands to write to a buffer or file, and load and execute that set of commands every time I start gdb. Bonus points if I don't have to enter "y" to confirm that gdb should make the breakpoints pending on future library load.
What would be super awesom is if I could save all current breakpoints (by name not by address as those might change).