Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org, Stan Shebs <stan@codesourcery.com>
Subject: [patch 3.1/3] bpstat_what removal - addon gdb_assert
Date: Thu, 24 Jun 2010 14:48:00 -0000	[thread overview]
Message-ID: <20100624144826.GB29245@host0.dyn.jankratochvil.net> (raw)
In-Reply-To: <20100624144423.GA29245@host0.dyn.jankratochvil.net>

Hi Pedro,

On Thu, 24 Jun 2010 16:44:23 +0200, Jan Kratochvil wrote:
> attaching follow-up on your patch still using BPSTAT_WHAT_* symbols.

this is a gdb_assert followup with the goal of making the code both more clear
and more safe against future changes.  I do not mind much about this patch.

No regressions on {x86_64,x86_64-m32,i686}-fedora13-linux-gnu.


Thanks,
Jan


2010-06-24  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* breakpoint.c (bpstat_what): Pre-set this_action to -1.  Set
	this_action to BPSTAT_WHAT_KEEP_CHECKING in cases it has been left
	unchanged.  New gdb_assert.

--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -4234,7 +4234,7 @@ bpstat_what (bpstat bs)
     {
       /* Extract this BS's action.  After processing each BS, we check
 	 if its action overrides all we've seem so far.  */
-      enum bpstat_what_main_action this_action = BPSTAT_WHAT_KEEP_CHECKING;
+      enum bpstat_what_main_action this_action = -1;
       enum bptype bptype;
 
       if (bs->breakpoint_at == NULL)
@@ -4251,6 +4251,7 @@ bpstat_what (bpstat bs)
       switch (bptype)
 	{
 	case bp_none:
+	  this_action = BPSTAT_WHAT_KEEP_CHECKING;
 	  break;
 	case bp_breakpoint:
 	case bp_hardware_breakpoint:
@@ -4281,6 +4282,7 @@ bpstat_what (bpstat bs)
 	    {
 	      /* There was a watchpoint, but we're not stopping.
 		 This requires no further action.  */
+	      this_action = BPSTAT_WHAT_KEEP_CHECKING;
 	    }
 	  break;
 	case bp_longjmp:
@@ -4317,6 +4319,7 @@ bpstat_what (bpstat bs)
 	    {
 	      /* There was a catchpoint, but we're not stopping.
 		 This requires no further action.  */
+	      this_action = BPSTAT_WHAT_KEEP_CHECKING;
 	    }
 	  break;
 	case bp_shlib_event:
@@ -4359,6 +4362,7 @@ bpstat_what (bpstat bs)
 			  _("bpstat_what: unhandled bptype %d"), (int) bptype);
 	}
 
+      gdb_assert (this_action != -1);
       retval.main_action = max (retval.main_action, this_action);
     }
 


  reply	other threads:[~2010-06-24 14:48 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-03 20:02 [patch 3/3] bpstat_what removal Jan Kratochvil
2010-05-04 14:10 ` Stan Shebs
2010-05-07 16:17   ` Jan Kratochvil
2010-05-07 16:26     ` Pedro Alves
2010-05-07 17:02       ` Jan Kratochvil
2010-05-07 17:17         ` Pedro Alves
2010-05-17 21:46           ` Jan Kratochvil
2010-06-12 17:02             ` [patch 3/3] bpstat_what removal [rediff] Jan Kratochvil
2010-06-15 15:08               ` Pedro Alves
2010-06-15 21:54                 ` Jan Kratochvil
2010-06-16 19:13                   ` Pedro Alves
2010-06-18 10:41                     ` Jan Kratochvil
2010-06-18 11:42                       ` Pedro Alves
2010-06-18 14:09                         ` Jan Kratochvil
2010-06-18 14:35                           ` Pedro Alves
2010-06-24 14:44                     ` [patch 3/3] bpstat_what removal Jan Kratochvil
2010-06-24 14:48                       ` Jan Kratochvil [this message]
2010-06-24 15:03                       ` Pedro Alves
2010-06-24 15:21                         ` Jan Kratochvil
2010-06-16 20:40                   ` [patch 3/3] bpstat_what removal [rediff] Tom Tromey
2010-06-23 14:42                     ` Jan Kratochvil

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=20100624144826.GB29245@host0.dyn.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@codesourcery.com \
    --cc=stan@codesourcery.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