2009-03-23 Paul Pluzhnikov <ppluzhnikov@google.com>
authorPaul Pluzhnikov <ppluzhnikov@google.com>
Mon, 23 Mar 2009 18:34:03 +0000 (18:34 +0000)
committerPaul Pluzhnikov <ppluzhnikov@google.com>
Mon, 23 Mar 2009 18:34:03 +0000 (18:34 +0000)
* breakpoint.c (disable_breakpoints_in_unloaded_shlib): Use
solib_contains_address_p instead of searching.

gdb/ChangeLog
gdb/breakpoint.c

index c347f674abb77a9372978e350fc76c423fdd2d89..6d5d9caa3007d5dce89882f450580e258073efff 100644 (file)
@@ -1,3 +1,8 @@
+2009-03-23  Paul Pluzhnikov  <ppluzhnikov@google.com>
+
+       * breakpoint.c (disable_breakpoints_in_unloaded_shlib): Use
+       solib_contains_address_p instead of searching.
+       
 2009-03-23  Tom Tromey  <tromey@redhat.com>
 
        * charset.c (ICONV_CONST) <PHONY_ICONV>: Define.
index 5affe4e6835908ad2d4dbe223ff70ce9bee62eb2..7e503427ccd8ed214c21af6fc0532dcc8f8c1f99 100644 (file)
@@ -4502,28 +4502,22 @@ disable_breakpoints_in_unloaded_shlib (struct so_list *solib)
     struct breakpoint *b = loc->owner;
     if ((loc->loc_type == bp_loc_hardware_breakpoint
         || loc->loc_type == bp_loc_software_breakpoint)
-       && !loc->shlib_disabled)
+       && !loc->shlib_disabled
+       && (b->type == bp_breakpoint || b->type == bp_hardware_breakpoint)
+       && solib_contains_address_p (solib, loc->address))
       {
-#ifdef PC_SOLIB
-       char *so_name = PC_SOLIB (loc->address);
-#else
-       char *so_name = solib_name_from_address (loc->address);
-#endif
-       if (so_name && !strcmp (so_name, solib->so_name))
-          {
-           loc->shlib_disabled = 1;
-           /* At this point, we cannot rely on remove_breakpoint
-              succeeding so we must mark the breakpoint as not inserted
-              to prevent future errors occurring in remove_breakpoints.  */
-           loc->inserted = 0;
-           if (!disabled_shlib_breaks)
-             {
-               target_terminal_ours_for_output ();
-               warning (_("Temporarily disabling breakpoints for unloaded shared library \"%s\""),
-                         so_name);
-             }
-           disabled_shlib_breaks = 1;
+       loc->shlib_disabled = 1;
+       /* At this point, we cannot rely on remove_breakpoint
+          succeeding so we must mark the breakpoint as not inserted
+          to prevent future errors occurring in remove_breakpoints.  */
+       loc->inserted = 0;
+       if (!disabled_shlib_breaks)
+         {
+           target_terminal_ours_for_output ();
+           warning (_("Temporarily disabling breakpoints for unloaded shared library \"%s\""),
+                    solib->so_name);
          }
+       disabled_shlib_breaks = 1;
       }
   }
 }