This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug breakpoints/15185] Dprintf should parse its string for validity right away


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]