Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Marc Khouzam <marc.khouzam@ericsson.com>
To: "'gdb-patches@sourceware.org'" <gdb-patches@sourceware.org>
Subject: [Patch] Cannot set pending bp if condition set explicitly
Date: Tue, 24 Jul 2012 14:45:00 -0000	[thread overview]
Message-ID: <F7CE05678329534C957159168FA70DEC5C24CAEA18@EUSAACMS0703.eamcs.ericsson.se> (raw)

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


             reply	other threads:[~2012-07-24 14:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-24 14:45 Marc Khouzam [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F7CE05678329534C957159168FA70DEC5C24CAEA18@EUSAACMS0703.eamcs.ericsson.se \
    --to=marc.khouzam@ericsson.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox