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/16465] New: -dprintf-insert does not store the string for pending dprintf


https://sourceware.org/bugzilla/show_bug.cgi?id=16465

            Bug ID: 16465
           Summary: -dprintf-insert does not store the string for pending
                    dprintf
           Product: gdb
           Version: 7.4
            Status: NEW
          Severity: normal
          Priority: P2
         Component: breakpoints
          Assignee: unassigned at sourceware dot org
          Reporter: marc.khouzam at ericsson dot com

Bug 15292 fixed pending dprintf for the CLI, but it seems they don't work
properly for the MI interface.   What seems to happen is that the string to
print does not get stored so when the dprintf gets activated, it has nothing to
print.

Below is a session that compares pending dprintf using the CLI vs MI
interfaces:

> gdb.7.7 ~/runtime-TestDSF/myapp/Debug/myapp.exe
GNU gdb (GDB) 7.7.50.20140110-cvs
(gdb)  interpreter-exec mi "-dprintf-insert -f mydll.c:1 \"hello\""
&"No source file named mydll.c.\n"
^done,bkpt={number="1",type="dprintf",disp="keep",enabled="y",addr="<PENDING>",pending="mydll.c:1",times="0",original-location="mydll.c:1"}
(gdb) dprintf mydll.c:2,"hello"
No source file named mydll.c.
Make dprintf pending on future shared library load? (y or [n]) y
Dprintf 2 (mydll.c:2,"hello") pending.
(gdb) info b
Num     Type           Disp Enb Address    What
1       dprintf        keep y   <PENDING>  mydll.c:1
2       dprintf        keep y   <PENDING>  mydll.c:2,"hello"
(gdb) b 18
Breakpoint 3 at 0x400754: file ../src/myapp.c, line 18.
(gdb) r
Starting program: /home/lmckhou/runtime-TestDSF/myapp/Debug/myapp.exe 

Breakpoint 3, main () at ../src/myapp.c:18
18           handle =
dlopen("/home/lmckhou/runtime-TestDSF/myLinuxDll/Debug/libmyLinuxDll",
RTLD_LAZY);
(gdb) n
Error in re-setting breakpoint 1: Format string required
19           if (!handle) {
(gdb) inf b
Num     Type           Disp Enb Address            What
1       dprintf        keep y   0x00007ffff7633560 in foo at ../src/mydll.c:1
2       dprintf        keep y   0x00007ffff7633560 in foo at ../src/mydll.c:2
        printf "hello"
3       breakpoint     keep y   0x0000000000400754 in main at ../src/myapp.c:18
        breakpoint already hit 1 time

-- 
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]