From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31676 invoked by alias); 23 Feb 2013 13:41:49 -0000 Received: (qmail 31651 invoked by uid 48); 23 Feb 2013 13:41:48 -0000 From: "marc.khouzam at ericsson dot com" To: gdb-prs@sourceware.org Subject: [Bug breakpoints/15180] New: Agent style dprintf does not respect conditions Date: Sat, 23 Feb 2013 13:41:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: breakpoints X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: marc.khouzam at ericsson dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org X-SW-Source: 2013-q1/txt/msg00308.txt.bz2 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 2 #include 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.