On Sun, Jan 29, 2023 at 5:21 PM Tom Tromey wrote: > PR breakpoints/18183 points out that breakpoints saved with the "save > breakpoints" command can be slightly inconvenient, depending on "set > breakpoint pending". > > This patch makes use of the new "with" command to save breakpoints > such that they will automatically be made pending, if necessary, when > being restored. > > Unfortunately, reloading a breakpoint saved this way will also print: > > No symbol table is loaded. Use the "file" command. > > This seems strange to me, and also a bit useless, but changing > create_breakpoint not to call exception_print in the AUTO_BOOLEAN_TRUE > case caused other regressions, so I've left it as-is for the time > being. > > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=18183 > > I've tried this out and I think it's very convenient and makes gdb more user friendly. Before this patch: gdb]$ ./gdb -ex 'b write' /bin/ls save breakpoints tbb The pending breakpoint was not reloaded: gdb]$ ./gdb /bin/ls (gdb) source tbb Function "write" not defined. Make breakpoint pending on future shared library load? (y or [n]) [answered N; input not from terminal] (gdb) and after applying the patch pending breakpoint is there: (gdb) source tbb Function "write" not defined. Breakpoint 1 (write) pending.