Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [Patch] Cannot set pending bp if condition set explicitly
@ 2012-07-24 14:45 Marc Khouzam
  2012-07-25 15:28 ` Tom Tromey
  0 siblings, 1 reply; 10+ messages in thread
From: Marc Khouzam @ 2012-07-24 14:45 UTC (permalink / raw)
  To: 'gdb-patches@sourceware.org'

Hi,

If I set a condition explicitly on a pending breakpoint (using
the 'condition' command), the breakpoint fails to install.

I believe it is because the condition is marked as parsed,
although, for a pending bp, this is not the case.
Note that using the form
  b mydll:c:5 if j==3
does work because the condition is not examined until the
pending breakpoint is installed.  This is not the case
when using the 'condition' command.
Broken session below.

No regressions on Ubuntu 32bit.

Is this ok for HEAD and 7_5?

Thanks

2012-07-20  Marc Khouzam  <marc.khouzam@ericsson.com>

	* breakpoint.c (set_breakpoint_condition): For pending
	breakpoints, mark condition as not parsed.

### Eclipse Workspace Patch 1.0
#P src
Index: gdb/breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.694
diff -u -r1.694 breakpoint.c
--- gdb/breakpoint.c    19 Jul 2012 15:38:16 -0000      1.694
+++ gdb/breakpoint.c    23 Jul 2012 15:46:24 -0000
@@ -951,7 +951,12 @@
       /* I don't know if it matters whether this is the string the user
         typed in or the decompiled expression.  */
       b->cond_string = xstrdup (arg);
-      b->condition_not_parsed = 0;
+
+      /* For a pending breakoint, the condition is not parsed yet */
+      if (b->loc == NULL || b->loc->shlib_disabled)
+       b->condition_not_parsed = 1;
+      else  
+       b->condition_not_parsed = 0;
 
       if (is_watchpoint (b))
        {


> gdb myapp.exe
GNU gdb (GDB) 7.4.1
(gdb) b mydll.c:5
No source file named mydll.c.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (mydll.c:5) pending.
(gdb) cond 1 j==3
(gdb) info b
Num     Type           Disp Enb Address    What
1       breakpoint     keep y   <PENDING>  mydll.c:5
        stop only if j==3
(gdb) r
Starting program: /home/lmckhou/runtime-TestDSF/myapp/Debug/myapp.exe 
Error in re-setting breakpoint 1: No source file named /home/lmckhou/runtime-TestDSF/myLinuxDll/src/mydll.c.
5
warning: Temporarily disabling breakpoints for unloaded shared library "/home/lmckhou/runtime-TestDSF/myLinuxDll/Debug/libmyLinuxDll"
[Inferior 1 (process 3438) exited normally]

=> breakpoint was not installed and didn't hit


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-08-03  0:51 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-24 14:45 [Patch] Cannot set pending bp if condition set explicitly Marc Khouzam
2012-07-25 15:28 ` Tom Tromey
2012-07-25 20:31   ` Marc Khouzam
2012-07-25 20:44     ` Tom Tromey
2012-07-26 19:05     ` Pedro Alves
2012-07-27  2:45       ` Marc Khouzam
2012-07-30 15:19         ` Pedro Alves
2012-07-30 15:36           ` Tom Tromey
2012-08-03  0:44           ` disable breakpoints with invalid condition (Re: [Patch] Cannot set pending bp if condition set explicitly) Pedro Alves
2012-08-03  0:51       ` [Patch] Cannot set pending bp if condition set explicitly Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox