2008-08-19 Pedro Alves * breakpoint.c (breakpoint_re_set_one): If parsing failed, and the breakpoint had been inserted before, set it to pending state. (sharedlibrary_command): Disable breakpoints set in solibs, effectively setting them to the pending state. --- gdb/breakpoint.c | 19 +++++++++++++++---- gdb/solib.c | 1 + 2 files changed, 16 insertions(+), 4 deletions(-) Index: src/gdb/breakpoint.c =================================================================== --- src.orig/gdb/breakpoint.c 2008-08-19 12:35:52.000000000 +0100 +++ src/gdb/breakpoint.c 2008-08-19 15:00:02.000000000 +0100 @@ -7485,15 +7485,26 @@ breakpoint_re_set_one (void *bint) if (e.reason < 0) { int not_found_and_ok = 0; + + /* If this breakpoint had been inserted before, but we + cannot parse where to place it anymore, set it to + pending. */ + if (not_found && b->loc && !b->loc->shlib_disabled) + { + warning (_("Leaving breakpoint #%d pending"), + b->number); + b->loc->shlib_disabled = 1; + } + /* For pending breakpoints, it's expected that parsing will fail until the right shared library is loaded. User has already told to create pending breakpoints and don't need extra messages. If breakpoint is in bp_shlib_disabled state, then user already saw the message about that breakpoint being disabled, and don't want to see more errors. */ - if (not_found - && (b->condition_not_parsed - || (b->loc && b->loc->shlib_disabled) + if (not_found + && (b->condition_not_parsed + || b->loc || b->enable_state == bp_disabled)) not_found_and_ok = 1; @@ -7512,7 +7523,7 @@ breakpoint_re_set_one (void *bint) if (not_found) break; - + gdb_assert (sals.nelts == 1); resolve_sal_pc (&sals.sals[0]); if (b->condition_not_parsed && s && s[0]) Index: src/gdb/solib.c =================================================================== --- src.orig/gdb/solib.c 2008-08-19 12:35:52.000000000 +0100 +++ src/gdb/solib.c 2008-08-19 15:00:02.000000000 +0100 @@ -950,6 +950,7 @@ sharedlibrary_command (char *args, int f void no_shared_libraries (char *ignored, int from_tty) { + disable_breakpoints_in_shlibs (); objfile_purge_solibs (); clear_solib (); }