This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Fix `condition' command regression
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Date: Fri, 9 Apr 2010 15:01:16 +0100
- Subject: Fix `condition' command regression
I was seeing a bunch of new gdb.trace/save-trace.exp failures.
Here's the problem:
(top-gdb) b main
Breakpoint 3 at 0x4572b3: file ../../src/gdb/gdb.c, line 28.
(top-gdb) condition 3 0
A syntax error in expression, near `0'.
(top-gdb) info breakpoints
...
3 breakpoint keep y 0x00000000004572b3 in main at ../../src/gdb/gdb.c:28
stop only if 3 0
that "3" used to be accepted as breakpoint number.
(top-gdb) help condition
Specify breakpoint number N to break only if COND is true.
Usage is `condition N COND', where N is an integer and COND is an
expression to be evaluated whenever breakpoint N is reached.
I've applied this to fix it.
--
Pedro Alves
2010-04-09 Pedro Alves <pedro@codesourcery.com>
gdb/
* breakpoint.c (condition_command): Pass condition expression to
set_breakpoint_condition stripped from breakpoint number.
---
gdb/breakpoint.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: src/gdb/breakpoint.c
===================================================================
--- src.orig/gdb/breakpoint.c 2010-04-09 14:39:37.000000000 +0100
+++ src/gdb/breakpoint.c 2010-04-09 14:41:04.000000000 +0100
@@ -784,7 +784,7 @@ condition_command (char *arg, int from_t
ALL_BREAKPOINTS (b)
if (b->number == bnum)
{
- set_breakpoint_condition (b, arg, from_tty);
+ set_breakpoint_condition (b, p, from_tty);
return;
}