Reputation: 1
Hi all!
Thanks for the help in advance.
I'm trying to debug an excutable with multiple files and I need to place a breakpoint outside the current file. When I do this with the gdb CLI it tells me that the source file is not in the current context but asks if I want to perform a breakpoint pending:
GNU gdb (GDB) 7.5.1
[...]
(gdb) file /caer/bin/DAP_Alm
Reading symbols from /caer/bin/DAP_Alm...done.
(gdb) break /caer/src/dac/dap/intsrv/DAP_CalcFns.c:22217
No source file named /caer/src/dac/dap/intsrv/DAP_CalcFns.c.
Make breakpoint pending on future shared library load? (and or [n]) and
Breakpoint 1 (/caer/src/dac/dap/intsrv/DAP_CalcFns.c:22217) pending.
But when I do it from the DDD with the same version of the GDB, I do not get the option to place the breakpoint pending:
GNU DDD 3.3.9
[...]
(gdb) file /caer/bin/DAP_Alm
Reading symbols from /caer/bin/DAP_Alm...done.
(gdb) break /caer/src/dac/dap/intsrv/DAP_CalcFns.c:22217
No source file named /caer/src/dac/dap/intsrv/DAP_CalcFns.c.
(gdb)
The question is why does not that option appear to me from the DDD? Should I activate something in the DDD setting?
Upvotes: 0
Views: 323
Reputation: 5919
I found there is this options. (from https://sourceware.org/gdb/onlinedocs/gdb/Set-Breaks.html)
set breakpoint pending auto
This is the default behavior. When GDB cannot find the breakpoint location, it queries you whether a pending breakpoint should be created.
set breakpoint pending on
This indicates that an unrecognized breakpoint location should automatically result in a pending breakpoint being created.
set breakpoint pending off
This indicates that pending breakpoints are not to be created. Any unrecognized breakpoint location results in an error. This setting does not affect any pending breakpoints previously created.
show breakpoint pending
Show the current behavior setting for creating pending breakpoints.
and I tested this set breakpoint pending on
works for me (it makes it pending without my confirmation).
Upvotes: 0
Reputation: 213385
But when I do it from the DDD with the same version of the GDB, I do not get the option to place the breakpoint pending:
The DDD probably uses set confirm off
when starting GDB.
This should allow you to set pending breakpoint under DDD:
(gdb) set confirm on
(gdb) break /caer/src/dac/dap/intsrv/DAP_CalcFns.c:22217
Upvotes: 0