Bug 15292 - Pending dprintf don't work
Summary: Pending dprintf don't work
Status: VERIFIED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: breakpoints (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: 7.6
Assignee: teawater
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-21 17:20 UTC by Marc Khouzam
Modified: 2014-01-10 15:51 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Khouzam 2013-03-21 17:20:49 UTC
Setting a dprintf that is marked PENDING will not properly become activated.

> gdb.7.6 ~/runtime-TestDSF/myapp/Debug/myapp.exe
GNU gdb (GDB) 7.6.50.20130318-cvs
Reading symbols from /home/lmckhou/runtime-TestDSF/myapp/Debug/myapp.exe...done.
(gdb) dprintf mydll.c:2,"h"
No source file named mydll.c.
Make dprintf pending on future shared library load? (y or [n]) y
Dprintf 1 (mydll.c:2,"h") pending.
(gdb) info b
Num     Type           Disp Enb Address    What
1       dprintf        keep y   <PENDING>  mydll.c:2,"h"
(gdb) start
Temporary breakpoint 2 at 0x40074d: file ../src/myapp.c, line 15.
Starting program: /home/lmckhou/runtime-TestDSF/myapp/Debug/myapp.exe 

Temporary breakpoint 2, main () at ../src/myapp.c:15
15           int i = 0;
(gdb) n
18           handle = dlopen("/home/lmckhou/runtime-TestDSF/myLinuxDll/Debug/libmyLinuxDll", RTLD_LAZY);
(gdb) n
19           if (!handle) {
(gdb) info b
Num     Type           Disp Enb Address            What
1       dprintf        keep y   0x00007ffff7633560 in foo at ../src/mydll.c:2
(gdb)

or

> gdb.7.5 ~/runtime-TestDSF/myapp/Debug/myapp.exe
GNU gdb (GDB) 7.5.1
Reading symbols from /home/lmckhou/runtime-TestDSF/myapp/Debug/myapp.exe...done.
(gdb) dprintf mydll.c:2,"h"
No source file named mydll.c.
Make dprintf pending on future shared library load? (y or [n]) y
Dprintf 1 (mydll.c:2,"h") pending.
(gdb) info b
Num     Type           Disp Enb Address    What
1       dprintf        keep y   <PENDING>  mydll.c:2,"h"
(gdb) start
Temporary breakpoint 2 at 0x40074d: file ../src/myapp.c, line 15.
Starting program: /home/lmckhou/runtime-TestDSF/myapp/Debug/myapp.exe 

Temporary breakpoint 2, main () at ../src/myapp.c:15
15           int i = 0;
(gdb) n
18           handle = dlopen("/home/lmckhou/runtime-TestDSF/myLinuxDll/Debug/libmyLinuxDll", RTLD_LAZY);
(gdb) n
19           if (!handle) {
(gdb) info b
Num     Type           Disp Enb Address            What
1       dprintf        keep y   0x00007ffff7633560 in foo at ../src/mydll.c:2
        (agent printf) ,"h"
(gdb) show dprintf-style 
The style of usage for dynamic printf is "gdb".
Comment 3 Marc Khouzam 2014-01-10 15:51:00 UTC
Looks good. Thanks!