This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug breakpoints/15185] Dprintf should parse its string for validity right away
- From: "marc.khouzam at ericsson dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Mon, 08 Jul 2013 15:47:34 +0000
- Subject: [Bug breakpoints/15185] Dprintf should parse its string for validity right away
- Auto-submitted: auto-generated
- References: <bug-15185-4717 at http dot sourceware dot org/bugzilla/>
http://sourceware.org/bugzilla/show_bug.cgi?id=15185
--- Comment #2 from Marc Khouzam <marc.khouzam at ericsson dot com> ---
GNU gdb (GDB) 7.6.50.20130627-cvs
Reading symbols from /home/lmckhou/loopfirst...done.
(gdb) l
warning: Source file is more recent than executable.
1 #include <unistd.h>
2 #include <stdio.h>
3
4 int main() {
5 int max = 900;
6 for (int i=0;i<max;i++) {
7 printf("i is %d\n",i);
8 sleep(1);
9 }
10 return 0;
11 }
(gdb) dprintf 7,"hello$d",i <------------ Notice teh $d instead of %d
Dprintf 1 at 0x40055c: file loopfirst.cc, line 7.
(gdb) info b
Num Type Disp Enb Address What
1 dprintf keep y 0x000000000040055c in main() at loopfirst.cc:7
printf "hello$d",i
(gdb) r
Starting program: /home/lmckhou/loopfirst
Wrong number of arguments for specified format-string
--
You are receiving this mail because:
You are on the CC list for the bug.