### 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);