Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: creating the gdb-7.4 branch tomorrow (?)
Date: Tue, 06 Dec 2011 18:54:00 -0000	[thread overview]
Message-ID: <m3ipltmttc.fsf@fleche.redhat.com> (raw)
In-Reply-To: <20111205081911.GG28486@adacore.com> (Joel Brobecker's message of	"Mon, 5 Dec 2011 09:19:11 +0100")

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

Here is patch #1, to remove bp_startup_disabled.
It hasn't changed in a while, I'm sending it for completeness.

Tom


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch 1 --]
[-- Type: text/x-patch, Size: 4607 bytes --]

diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index c6b8e05..f0a351f 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -1574,6 +1574,9 @@ should_be_inserted (struct bp_location *bl)
   if (!bl->enabled || bl->shlib_disabled || bl->duplicate)
     return 0;
 
+  if (user_breakpoint_p (bl->owner) && bl->pspace->executing_startup)
+    return 0;
+
   /* This is set for example, when we're attached to the parent of a
      vfork, and have detached from the child.  The child is running
      free, and we expect it to do an exec or exit, at which point the
@@ -5341,8 +5344,7 @@ describe_other_breakpoints (struct gdbarch *gdbarch,
 	      printf_filtered (" (thread %d)", b->thread);
 	    printf_filtered ("%s%s ",
 			     ((b->enable_state == bp_disabled
-			       || b->enable_state == bp_call_disabled
-			       || b->enable_state == bp_startup_disabled)
+			       || b->enable_state == bp_call_disabled)
 			      ? " (disabled)"
 			      : b->enable_state == bp_permanent 
 			      ? " (permanent)"
@@ -7009,53 +7011,15 @@ enable_watchpoints_after_interactive_call_stop (void)
 void
 disable_breakpoints_before_startup (void)
 {
-  struct breakpoint *b;
-  int found = 0;
-
-  ALL_BREAKPOINTS (b)
-    {
-      if (b->pspace != current_program_space)
-	continue;
-
-      if ((b->type == bp_breakpoint
-	   || b->type == bp_hardware_breakpoint)
-	  && breakpoint_enabled (b))
-	{
-	  b->enable_state = bp_startup_disabled;
-	  found = 1;
-	}
-    }
-
-  if (found)
-    update_global_location_list (0);
-
   current_program_space->executing_startup = 1;
+  update_global_location_list (0);
 }
 
 void
 enable_breakpoints_after_startup (void)
 {
-  struct breakpoint *b;
-  int found = 0;
-
   current_program_space->executing_startup = 0;
-
-  ALL_BREAKPOINTS (b)
-    {
-      if (b->pspace != current_program_space)
-	continue;
-
-      if ((b->type == bp_breakpoint
-	   || b->type == bp_hardware_breakpoint)
-	  && b->enable_state == bp_startup_disabled)
-	{
-	  b->enable_state = bp_enabled;
-	  found = 1;
-	}
-    }
-
-  if (found)
-    breakpoint_re_set ();
+  breakpoint_re_set ();
 }
 
 
@@ -7344,11 +7308,6 @@ init_breakpoint_sal (struct breakpoint *b, struct gdbarch *gdbarch,
 			   "tracepoint marker to probe"));
 	    }
 
-	  if (enabled && b->pspace->executing_startup
-	      && (b->type == bp_breakpoint
-		  || b->type == bp_hardware_breakpoint))
-	    b->enable_state = bp_startup_disabled;
-
 	  loc = b->loc;
 	}
       else
@@ -8079,11 +8038,6 @@ create_breakpoint (struct gdbarch *gdbarch,
       b->enable_state = enabled ? bp_enabled : bp_disabled;
       b->pspace = current_program_space;
 
-      if (enabled && b->pspace->executing_startup
-	  && (b->type == bp_breakpoint
-	      || b->type == bp_hardware_breakpoint))
-	b->enable_state = bp_startup_disabled;
-
       install_breakpoint (internal, b, 0);
     }
   
@@ -10748,11 +10702,7 @@ update_global_location_list (int should_insert)
       struct breakpoint *b = loc->owner;
       struct bp_location **loc_first_p;
 
-      if (b->enable_state == bp_disabled
-	  || b->enable_state == bp_call_disabled
-	  || b->enable_state == bp_startup_disabled
-	  || !loc->enabled
-	  || loc->shlib_disabled
+      if (!should_be_inserted (loc)
 	  || !breakpoint_address_is_meaningful (b)
 	  /* Don't detect duplicate for tracepoint locations because they are
 	   never duplicated.  See the comments in field `duplicate' of
@@ -11038,8 +10988,7 @@ static struct breakpoint_ops base_breakpoint_ops =
 static void
 bkpt_re_set (struct breakpoint *b)
 {
-  /* Do not attempt to re-set breakpoints disabled during startup.  */
-  if (b->enable_state == bp_startup_disabled)
+  if (current_program_space->executing_startup)
     return;
 
   /* FIXME: is this still reachable?  */
diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h
index 438f347..17e65d6 100644
--- a/gdb/breakpoint.h
+++ b/gdb/breakpoint.h
@@ -186,14 +186,6 @@ enum enable_state
 			    automatically enabled and reset when the
 			    call "lands" (either completes, or stops
 			    at another eventpoint).  */
-    bp_startup_disabled, /* The eventpoint has been disabled during
-			    inferior startup.  This is necessary on
-			    some targets where the main executable
-			    will get relocated during startup, making
-			    breakpoint addresses invalid.  The
-			    eventpoint will be automatically enabled
-			    and reset once inferior startup is
-			    complete.  */
     bp_permanent	 /* There is a breakpoint instruction
 			    hard-wired into the target's code.  Don't
 			    try to write another breakpoint
-- 
1.7.6.4


  parent reply	other threads:[~2011-12-06 18:53 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-05  8:19 Joel Brobecker
2011-12-06 18:45 ` Tom Tromey
2011-12-06 18:53 ` Tom Tromey
2011-12-06 18:54 ` Tom Tromey [this message]
2011-12-06 19:05 ` Tom Tromey
2011-12-06 19:05 ` Tom Tromey
2011-12-06 19:07 ` Tom Tromey
2011-12-06 19:10 ` Tom Tromey
2011-12-07  4:09   ` Hui Zhu
2011-12-07  9:54     ` Joel Brobecker
2011-12-07 16:24       ` Stan Shebs
2011-12-07 23:50       ` Stan Shebs
2011-12-08  8:22         ` Joel Brobecker
2011-12-07  9:11   ` Jan Kratochvil
2011-12-07 10:01     ` Joel Brobecker
2011-12-08 15:33     ` FYI: fixlet in ovsrch.exp (Was: creating the gdb-7.4 branch tomorrow (?)) Tom Tromey
2011-12-09 17:17   ` Crash regression for gdb.base/ending-run.exp [Re: creating the gdb-7.4 branch tomorrow (?)] Jan Kratochvil
2011-12-09 19:05     ` Tom Tromey
2011-12-09 21:00       ` Jan Kratochvil
2011-12-09 17:17   ` Regression for gdb.base/sigstep.exp with .debug_types " Jan Kratochvil
2011-12-09 17:26     ` Regression for gdb.base/sigstep.exp with .debug_types Jan Kratochvil
2011-12-09 20:50       ` Tom Tromey
2011-12-09 21:55         ` Jan Kratochvil
2011-12-10  9:46           ` Tom Tromey
2011-12-10 19:27           ` [commit] testsuite: KFAIL gdb.cp/static-method.exp [Re: Regression for gdb.base/sigstep.exp with .debug_types] Jan Kratochvil
2011-12-11  9:26             ` Joel Brobecker
2011-12-11 12:42               ` Jan Kratochvil
2011-12-11 12:46                 ` Joel Brobecker
2011-12-14 19:02                   ` [patch] gcc KFAILs to XFAILs [Re: [commit] testsuite: KFAIL gdb.cp/static-method.exp] Jan Kratochvil
2011-12-14 19:43                     ` Doug Evans
2011-12-14 19:51                       ` [doc patch] gdbint: XFAIL vs. KFAIL [Re: [patch] gcc KFAILs to XFAILs] Jan Kratochvil
2011-12-15  5:33                         ` Eli Zaretskii
2011-12-19 11:16                           ` Jan Kratochvil
2011-12-19 13:41                             ` Eli Zaretskii
2011-12-19 13:42                               ` [commit] " Jan Kratochvil
2011-12-19 13:43                     ` [commit] [patch] gcc KFAILs to XFAILs [Re: [commit] testsuite: KFAIL gdb.cp/static-method.exp] Jan Kratochvil
2011-12-09 20:17     ` Regression for gdb.base/sigstep.exp with .debug_types [Re: creating the gdb-7.4 branch tomorrow (?)] Tom Tromey
2011-12-09 20:20       ` Jan Kratochvil
2011-12-14 11:52   ` creating the gdb-7.4 branch tomorrow (?) Andreas Schwab
2011-12-14 13:20     ` Joel Brobecker
2011-12-14 13:34       ` Andreas Schwab
2011-12-14 19:28     ` Joel Brobecker
2011-12-14 21:16       ` Andreas Schwab
2011-12-14 21:31         ` Joel Brobecker
2011-12-14 22:06           ` Andreas Schwab
2011-12-15 17:43       ` Tom Tromey
2012-07-22 19:41   ` Andreas Schwab
2012-08-15 19:34     ` Tom Tromey
2012-08-22 14:23       ` Tom Tromey

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=m3ipltmttc.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /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