This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch] Cannot set pending bp if condition set explicitly


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?


2012-07-20  Marc Khouzam  <>

	* 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.
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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]