This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug breakpoints/15180] New: Agent style dprintf does not respectconditions
- From: "marc.khouzam at ericsson dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Sat, 23 Feb 2013 13:41:47 +0000
- Subject: [Bug breakpoints/15180] New: Agent style dprintf does not respectconditions
- Auto-submitted: auto-generated
http://sourceware.org/bugzilla/show_bug.cgi?id=15180
Bug #: 15180
Summary: Agent style dprintf does not respect conditions
Product: gdb
Version: HEAD
Status: NEW
Severity: normal
Priority: P2
Component: breakpoints
AssignedTo: unassigned@sourceware.org
ReportedBy: marc.khouzam@ericsson.com
Classification: Unclassified
When I set a condition on an "agent"-style dprintf, the condition does not seem
to be respected, and I get extra printouts.
> gdb.7.6 loopfirst
GNU gdb (GDB) 7.5.50.20130223-cvs
(gdb) target extended-remote :9999
Remote debugging using :9999
Reading symbols from /lib/ld-linux.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib/ld-linux.so.2
0x00110850 in ?? () from /lib/ld-linux.so.2
(gdb) set dprintf-style agent
(gdb) l
1 #include <unistd.h>
2 #include <stdio.h>
3
4 int main() {
5 for (int i=0;i<20;i++) {
6 printf("hello");
7 printf("friend\n");
8 printf("home\n");
9 sleep(1);
10 }
(gdb) dprintf 8,"i is %d\n",i
Dprintf 1 at 0x804855f: file loopfirst.cc, line 8.
(gdb) cond 1 i>5
(gdb) info b
Num Type Disp Enb Address What
1 dprintf keep y 0x0804855f in main() at loopfirst.cc:8
stop only if i>5 (host evals)
agent-printf "i is %d\n",i
(gdb) c
Continuing.
[Inferior 1 (process 8361) exited normally]
I would expect to see the "i is %d" printout only once i hits 6, but this is
what I see on the gdbserver window. Notice that the dprintf prints from i == 0
but also the extra printouts "Found breakpoint condition"
Process /home/lmckhou/loopfirst created; pid = 8361
Listening on port 9999
Remote debugging from host 127.0.0.1
Found breakpoint condition.
Found breakpoint condition.
Found breakpoint condition.
hellofriend
i is 0
home
hellofriend
i is 1
home
hellofriend
i is 2
home
hellofriend
i is 3
home
hellofriend
i is 4
home
hellofriend
i is 5
home
hellofriend
i is 6
home
hellofriend
i is 7
[and so on]
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.