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] MI ignores conditions for pending breakpoints
Date: Sat, 21 Jul 2012 03:04:00 -0000	[thread overview]
Message-ID: <F7CE05678329534C957159168FA70DEC597936B72B@EUSAACMS0703.eamcs.ericsson.se> (raw)

Hi,

I got a bug report that conditions were ignored for pending breakpoints.
It turns out to only happen for MI and I added a example session at the end
of this mail.

The below patch fixes this by storing the condition string for pending bp.
The extra_string should receive the same treatment, but I'll send that in
a separate patch.

No regressions on Ubuntu 32bit (actually, I got better results, but I think
it has to do with intermittent failures).

Is this ok for HEAD and 7_5?

Thanks

Marc

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

	* breakpoint.c (create_breakpoint): Store condition for pending
	breakpoints.

### 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    21 Jul 2012 02:30:14 -0000
@@ -9557,7 +9557,18 @@
       init_raw_breakpoint_without_location (b, gdbarch, type_wanted, ops);
 
       b->addr_string = copy_arg;
-      b->cond_string = NULL;
+      if (parse_condition_and_thread)
+       b->cond_string = NULL;
+      else
+       {
+         /* Create a private copy of condition string.  */
+         if (cond_string)
+           {
+             cond_string = xstrdup (cond_string);
+             make_cleanup (xfree, cond_string);
+           }
+         b->cond_string = cond_string;
+       }
       b->extra_string = NULL;
       b->ignore_count = ignore_count;
       b->disposition = tempflag ? disp_del : disp_donttouch;


Broken session:
--------------
> gdb myapp.exe
GNU gdb (GDB) 7.5.50.20120720-cvs
(gdb) interpreter-exec mi "-break-insert -f -c 1==2 /home/lmckhou/runtime-TestDSF/myLinuxDll/src/mydll.c:3"
&"No source file named /home/lmckhou/runtime-TestDSF/myLinuxDll/src/mydll.c.\n"
^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="<PENDING>",pending="/home/lmckhou/runtime-TestDSF/myLinuxDll/src/mydll.c:3",times="0",original-location="/home/lmckhou/runtime-TestDSF/myLinuxDll/src/mydll.c:3"}
(gdb) info b
Num     Type           Disp Enb Address    What
1       breakpoint     keep y   <PENDING>  /home/lmckhou/runtime-TestDSF/myLinuxDll/src/mydll.c:3

=> Note that there is no condition shown with the breakpoint above

(gdb) r
Starting program: /home/lmckhou/runtime-TestDSF/myapp/Debug/myapp.exe 
warning: Cannot call inferior functions, you have broken Linux kernel i386 NX (non-executable pages) support!
Breakpoint 1, foo () at ../src/mydll.c:3
3               int j = 0;

=> Breakpoint hits although condition was 1==2


             reply	other threads:[~2012-07-21  3:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-21  3:04 Marc Khouzam [this message]
2012-07-23 19:08 ` Tom Tromey
2012-07-24 17:42   ` Marc Khouzam
2012-07-25 13:11     ` Marc Khouzam
2012-07-25 15:50       ` Tom Tromey
2012-07-25 17:45         ` Marc Khouzam
2012-07-25 17:49           ` Tom Tromey
2012-07-25 18:26             ` Marc Khouzam
2012-07-25 18:43               ` Tom Tromey
2012-07-25 18:38                 ` Marc Khouzam

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=F7CE05678329534C957159168FA70DEC597936B72B@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