This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug breakpoints/11094] cannot reexecute programs using the GDB JIT interface in shared libs
- From: "edwintorok at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: 22 Dec 2009 17:00:23 -0000
- Subject: [Bug breakpoints/11094] cannot reexecute programs using the GDB JIT interface in shared libs
- References: <20091215210108.11094.edwintorok@gmail.com>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From edwintorok at gmail dot com 2009-12-22 17:00 -------
(In reply to comment #5)
> Note that GDB turns off ASLR by default:
>
> gdb64-cvs -nx -ex 'show disable-randomization' -ex 'quit'
> GNU gdb (GDB) 7.0.50.20091211-cvs
> ...
> This GDB was configured as "x86_64-unknown-linux-gnu".
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>.
> Disabling randomization of debuggee's virtual address space is on.
>
Same here.
I think it tries to set the breakpoint too early, before the shared lib is loaded.
First run:
(gdb) b main
Breakpoint 1 at 0x4005f8: file bp_minus4.c, line 4.
(gdb) r
Starting program: /home/edwin/gdbbug/bp_minus4
Breakpoint 1, main () at bp_minus4.c:4
4 return foo();
(gdb) info sharedlibrary
>From To Syms Read Shared Object Library
0x000000381da00af0 0x000000381da16a24 Yes (*) /lib64/ld-linux-x86-64.so.2
0x00007ffff7dfa510 0x00007ffff7dfa628 Yes ./shared.so
0x000000381de1e730 0x000000381df0292c Yes (*) /lib/libc.so.6
(*): Shared library is missing debugging information.
Second run:
(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /home/edwin/gdbbug/bp_minus4
Warning:
Cannot insert breakpoint -2.
Error accessing memory address 0x7ffff7dfa5dc: Input/output error.
(gdb) info sharedlibrary
>From To Syms Read Shared Object Library
0x000000381da00af0 0x000000381da16a24 Yes (*) /lib64/ld-linux-x86-64.so.2
(*): Shared library is missing debugging information.
And here is /proc/maps for the process
$ ps aux|grep gdb
edwin 10001 0.2 0.2 37260 10264 pts/1 S+ 18:58 0:00 gdb ./bp_minus4
edwin 10020 0.0 0.0 220 24 pts/1 T 18:59 0:00
/home/edwin/gdbbug/bp_minus4
edwin 10033 0.0 0.0 7288 784 pts/2 S+ 18:59 0:00 grep gdb
$ cat /proc/10020/maps
00400000-00401000 r-xp 00000000 fd:02 5389238
/home/edwin/gdbbug/bp_minus4
00600000-00601000 rw-p 00000000 fd:02 5389238
/home/edwin/gdbbug/bp_minus4
381da00000-381da1d000 r-xp 00000000 09:03 260632
/lib/ld-2.10.2.so
381dc1c000-381dc1e000 rw-p 0001c000 09:03 260632
/lib/ld-2.10.2.so
7ffff7ffe000-7ffff7fff000 r-xp 00000000 00:00 0 [vdso]
7ffffffea000-7ffffffff000 rw-p 00000000 00:00 0 [stack]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
--
http://sourceware.org/bugzilla/show_bug.cgi?id=11094
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.