diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2009-12-23 22:24:51 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2009-12-23 22:24:51 +0000 |
commit | 859825b8578d03e0fd93ec5946297c6c8bc2e637 (patch) | |
tree | de48e7a914ac2b25d9e031de6bba6eee255c4b57 /gdb/breakpoint.c | |
parent | f747b78daab5cdb984599facaff322ee9cdfa49b (diff) | |
download | gdb-859825b8578d03e0fd93ec5946297c6c8bc2e637.zip gdb-859825b8578d03e0fd93ec5946297c6c8bc2e637.tar.gz gdb-859825b8578d03e0fd93ec5946297c6c8bc2e637.tar.bz2 |
gdb/
* breakpoint.c (bpstat_stop_status): Check BL->SHLIB_DISABLED.
(print_breakpoint_location): New comment. Check LOC->SHLIB_DISABLED.
Check LOC validity before printing it. Use LOC instead of B->LOC.
Swap the if conditionals order.
gdb/testsuite/
* gdb.base/unload.c (main): Change the UNLOADSHR parameter to 1.
Replace the printf call of Y by provided "y-set-1" label. New block
for the second shared library.
* gdb.base/unload.exp: Compile also the second library, call
gdb_load_shlibs also for it. Use now gdb_breakpoint.
(single pending breakpoint info): Rename to ...
(pending breakpoint info before run): ... this extended test.
(libfile2, libname2, libsrcfile2, libsrc2)
(lib_sl2): New variables.
(exec_opts): Set also SHLIB_NAME2.
(pending breakpoint info on first run at shrfunc1)
(pending breakpoint info on second run at shrfunc1)
(pending breakpoint info on second run at shrfunc2)
(print y from libfile, print y from libfile2): New tests.
* gdb.base/unloadshr.c (shrfunc1): Change the returned value.
* gdb.base/unloadshr2.c: New.
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r-- | gdb/breakpoint.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 47a10f6..e44ef70 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -3562,6 +3562,8 @@ bpstat_stop_status (struct address_space *aspace, gdb_assert (b); if (!breakpoint_enabled (b) && b->enable_state != bp_permanent) continue; + if (bl->shlib_disabled) + continue; /* For hardware watchpoints, we look only at the first location. The watchpoint_check function will work on entire expression, @@ -3935,6 +3937,8 @@ bpstat_causes_stop (bpstat bs) +/* Print the LOC location out of the list of B->LOC locations. */ + static void print_breakpoint_location (struct breakpoint *b, struct bp_location *loc, char *wrap_indent, @@ -3942,10 +3946,13 @@ static void print_breakpoint_location (struct breakpoint *b, { struct cleanup *old_chain = save_current_program_space (); + if (loc != NULL && loc->shlib_disabled) + loc = NULL; + if (loc != NULL) set_current_program_space (loc->pspace); - if (b->source_file) + if (b->source_file && loc) { struct symbol *sym = find_pc_sect_function (loc->address, loc->section); @@ -3971,15 +3978,13 @@ static void print_breakpoint_location (struct breakpoint *b, ui_out_field_int (uiout, "line", b->line_number); } - else if (!b->loc) - { - ui_out_field_string (uiout, "pending", b->addr_string); - } - else + else if (loc) { print_address_symbolic (loc->address, stb->stream, demangle, ""); ui_out_field_stream (uiout, "at", stb); } + else + ui_out_field_string (uiout, "pending", b->addr_string); do_cleanups (old_chain); } |