This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Fix initial condition on multiple location breakpoint
- From: Vladimir Prus <vladimir at codesourcery dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Wed, 26 Sep 2007 22:48:58 +0400
- Subject: Fix initial condition on multiple location breakpoint
I've noticed a bug, where if one uses:
break <whatever> if <condition>
and <whatever> expands to several locations, <condition>
is set only on the first one. This bug went unnoticed
because when testsuite is run on x86, before any breakpoint
is hit, some shared libraries are loaded, which causes
breakpoint_re_set_one to execute, which updates conditions,
properly.
However, on targets where shared libraries are not loaded,
like arm-none-eabi, the mb-templates.exp was failing.
The attached patch fixes that; committed as obvious.
- Volodya
Index: ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/ChangeLog,v
retrieving revision 1.8718
diff -u -p -r1.8718 ChangeLog
--- ChangeLog 26 Sep 2007 18:32:52 -0000 1.8718
+++ ChangeLog 26 Sep 2007 18:43:25 -0000
@@ -1,3 +1,10 @@
+2007-09-26 Vladimir Prus <vladimir@codesourcery.com>
+
+ * breakpoint.c (create_breakpoint): Set
+ condition on each location, not on the first
+ location of breakpoint.
+
2007-09-26 Jim Blandy <jimb@codesourcery.com>
* remote.c (getpkt_sane): Fix error message. No animals were
Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.269
diff -u -p -r1.269 breakpoint.c
--- breakpoint.c 24 Sep 2007 07:40:32 -0000 1.269
+++ breakpoint.c 26 Sep 2007 18:43:27 -0000
@@ -5163,7 +5163,7 @@ create_breakpoint (struct symtabs_and_li
if (b->cond_string)
{
char *arg = b->cond_string;
- b->loc->cond = parse_exp_1 (&arg, block_for_pc (b->loc->address), 0);
+ loc->cond = parse_exp_1 (&arg, block_for_pc (loc->address), 0);
if (*arg)
{
if (pending_bp)