Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Paul Pluzhnikov <ppluzhnikov@google.com>
To: Ulrich Weigand <uweigand@de.ibm.com>
Cc: Joel Brobecker <brobecker@adacore.com>,
	tromey@redhat.com,         gdb-patches@sourceware.org
Subject: Re: [rfc][patch] Eliminate quadratic slow-down on number of solibs.
Date: Mon, 22 Jun 2009 18:56:00 -0000	[thread overview]
Message-ID: <8ac60eac0906221156o91c8059t17d1dd1bd2752dd0@mail.gmail.com> (raw)
In-Reply-To: <200906221709.n5MH9xPY029467@d12av02.megacenter.de.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 914 bytes --]

On Mon, Jun 22, 2009 at 10:09 AM, Ulrich Weigand<uweigand@de.ibm.com> wrote:

> Paul Pluzhnikov wrote:
>
>> 2009-05-12  Paul Pluzhnikov  <ppluzhnikov@google.com>
...
> Maybe I'm missing something here, but this seems to break overlay
> support.

Yes, I believe your analysis is correct.

> If you're going to reset only breakpoints
> from one objfile, maybe you should likewise *delete* only breakpoints
> from that objfile?

That sounds like a good approach :-)

Patch below tested on Linux/x86_64 with no new failures.

Unfortunately I don't have any targets that support overlays, so I can't
test this. Did this fail for you on spu? If so, does it pass with this patch?

Thanks,
-- 
Paul Pluzhnikov

2009-06-22  Paul Pluzhnikov  <ppluzhnikov@google.com>

	* breakpoint.c (breakpoint_re_set_one): Add objfile parameter,
	delete overlay breakpoint only in the given objfile.
	(breakpoint_re_set_objfile): Adjust.

[-- Attachment #2: gdb-overlay-bp-20090622.txt --]
[-- Type: text/plain, Size: 3228 bytes --]

Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.407
diff -u -p -u -r1.407 breakpoint.c
--- breakpoint.c	19 Jun 2009 15:14:11 -0000	1.407
+++ breakpoint.c	22 Jun 2009 18:41:43 -0000
@@ -90,8 +90,6 @@ static void map_breakpoint_numbers (char
 
 static void ignore_command (char *, int);
 
-static int breakpoint_re_set_one (void *);
-
 static void clear_command (char *, int);
 
 static void catch_command (char *, int);
@@ -7607,11 +7605,9 @@ update_breakpoint_locations (struct brea
    The value we return ends up being the return value from catch_errors.
    Unused in this case.  */
 
-static int
-breakpoint_re_set_one (void *bint)
+static void
+breakpoint_re_set_one (struct breakpoint *b, struct objfile *objfile)
 {
-  /* get past catch_errs */
-  struct breakpoint *b = (struct breakpoint *) bint;
   struct value *mark;
   int i;
   int not_found = 0;
@@ -7628,7 +7624,7 @@ breakpoint_re_set_one (void *bint)
     case bp_none:
       warning (_("attempted to reset apparently deleted breakpoint #%d?"),
 	       b->number);
-      return 0;
+      return;
     case bp_breakpoint:
     case bp_hardware_breakpoint:
     case bp_tracepoint:
@@ -7636,7 +7632,7 @@ breakpoint_re_set_one (void *bint)
 	{
 	  /* Anything without a string can't be re-set. */
 	  delete_breakpoint (b);
-	  return 0;
+	  return;
 	}
 
       set_language (b->language);
@@ -7739,12 +7735,17 @@ breakpoint_re_set_one (void *bint)
 
     default:
       printf_filtered (_("Deleting unknown breakpoint type %d\n"), b->type);
-      /* fall through */
-      /* Delete overlay event breakpoints; they will be reset later by
-         breakpoint_re_set.  */
-    case bp_overlay_event:
       delete_breakpoint (b);
       break;
+    case bp_overlay_event:
+      if (objfile == NULL
+          || lookup_minimal_symbol_text (b->addr_string, objfile))
+        {
+          /* Delete overlay event breakpoints; they will be reset later by
+             breakpoint_re_set.  */
+          delete_breakpoint (b);
+        }
+      break;
 
       /* This breakpoint is special, it's set up when the inferior
          starts and we really don't want to touch it.  */
@@ -7767,8 +7768,6 @@ breakpoint_re_set_one (void *bint)
     case bp_longjmp_resume:
       break;
     }
-
-  return 0;
 }
 
 /* Re-set all breakpoints after symbols have been re-loaded.
@@ -7787,12 +7786,15 @@ breakpoint_re_set_objfile (struct objfil
   save_input_radix = input_radix;
   ALL_BREAKPOINTS_SAFE (b, temp)
   {
-    /* Format possible error msg */
-    char *message = xstrprintf ("Error in re-setting breakpoint %d: ",
-				b->number);
-    struct cleanup *cleanups = make_cleanup (xfree, message);
-    catch_errors (breakpoint_re_set_one, b, message, RETURN_MASK_ALL);
-    do_cleanups (cleanups);
+    volatile struct gdb_exception ex;
+
+    TRY_CATCH (ex, RETURN_MASK_ALL)
+      {
+        breakpoint_re_set_one (b, objfile);
+      }
+    if (ex.reason < 0)
+      exception_fprintf (gdb_stderr, ex,
+                         "Error in re-setting breakpoint %d: ", b->number);
   }
   set_language (save_language);
   input_radix = save_input_radix;

  reply	other threads:[~2009-06-22 18:56 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-20 23:29 Paul Pluzhnikov
2009-04-21  1:06 ` Tom Tromey
2009-04-29 21:12   ` Paul Pluzhnikov
2009-05-12  8:48     ` Joel Brobecker
2009-05-12 21:21       ` Paul Pluzhnikov
2009-05-13  9:39         ` Joel Brobecker
2009-06-22 17:10         ` Ulrich Weigand
2009-06-22 18:56           ` Paul Pluzhnikov [this message]
2009-06-22 19:30             ` Ulrich Weigand
2009-06-22 19:42               ` Paul Pluzhnikov
2009-06-22 20:06                 ` Ulrich Weigand
2009-06-22 22:04                   ` Paul Pluzhnikov
2009-06-23  0:43                     ` Ulrich Weigand
2009-06-23  1:33                       ` Paul Pluzhnikov
2009-06-23 13:32                         ` Ulrich Weigand
2009-06-22 20:41             ` Doug Evans
2009-06-22 20:48               ` Michael Snyder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8ac60eac0906221156o91c8059t17d1dd1bd2752dd0@mail.gmail.com \
    --to=ppluzhnikov@google.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@redhat.com \
    --cc=uweigand@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox