Unable to debug PIE binaries with QEMU gdb stub.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QEMU |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
The issue occurs on current trunk:
max@max:
#include <stdio.h>
int main() {
printf("Hello, world!\n");
return 0;
}
max@max:
max@max:
.......
max@max:
GNU gdb (Ubuntu 7.7.1-0ubuntu5~
.......
(gdb) file bad.x
Reading symbols from bad.x...(no debugging symbols found)...done.
(gdb) b main
Breakpoint 1 at 0x779
(gdb) target remote localhost:1234
Remote debugging using localhost:1234
Reading symbols from /lib64/
Reading symbols from /usr/lib/
done.
Loaded symbols for /lib64/
Error in re-setting breakpoint 1: Cannot access memory at address 0x775
Error in re-setting breakpoint 1: Cannot access memory at address 0x775
0x0000004000a042d0 in _start () from /lib64/
(gdb) c
Continuing.
[Inferior 1 (Remote target) exited normally]
(gdb)
max@max:
# Configured with: '/home/
W/O QEMU or -pie flag breakpoint on main works fine.
GDB server itself actually supports PIE binaries.