Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Francois Chouinard" <fchouinard@gmail.com>
To: gdb-patches@sourceware.org
Subject: Patch for bug2457
Date: Wed, 14 May 2008 18:27:00 -0000	[thread overview]
Message-ID: <578d90ee0805141109y1b768c67jc64828923162cea9@mail.gmail.com> (raw)

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

Hi,

Here's a simple patch for bug2457 (Incorrect handling of erroneous
breakpoint conditions).

It just postpones the update of the breakpoint condition until it has
been parsed successfully.

If there is a parsing error, the condition is set to NULL.

Best Regards,
/fc

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: gdb-bug2457.patch --]
[-- Type: text/x-diff; name=gdb-bug2457.patch, Size: 1334 bytes --]

### Eclipse Workspace Patch 1.0
#P gdb
Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.321
diff -u -r1.321 breakpoint.c
--- breakpoint.c	4 May 2008 19:38:59 -0000	1.321
+++ breakpoint.c	14 May 2008 17:32:06 -0000
@@ -596,11 +596,13 @@
 	      }
 	  }
 	if (b->cond_string != NULL)
-	  xfree (b->cond_string);
+	  {
+	    xfree (b->cond_string);
+	    b->cond_string = NULL;	/* Keep in sync */
+	  }
 
 	if (*p == 0)
 	  {
-	    b->cond_string = NULL;
 	    if (from_tty)
 	      printf_filtered (_("Breakpoint %d now unconditional.\n"), bnum);
 	  }
@@ -609,7 +611,6 @@
 	    arg = p;
 	    /* I don't know if it matters whether this is the string the user
 	       typed in or the decompiled expression.  */
-	    b->cond_string = savestring (arg, strlen (arg));
 	    b->condition_not_parsed = 0;
 	    for (loc = b->loc; loc; loc = loc->next)
 	      {
@@ -619,6 +620,9 @@
 		if (*arg)
 		  error (_("Junk at end of expression"));
 	      }
+	    /* If we get here, the condition was parsed successfully and
+           no exception was thrown. See bug 2457. */
+	    b->cond_string = savestring (p, strlen (p));
 	  }
 	breakpoints_changed ();
 	breakpoint_modify_event (b->number);

             reply	other threads:[~2008-05-14 18:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-14 18:27 Francois Chouinard [this message]
2008-05-14 21:59 ` Vladimir Prus

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=578d90ee0805141109y1b768c67jc64828923162cea9@mail.gmail.com \
    --to=fchouinard@gmail.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