Received: from eggs.gnu.org ([2001:4830:134:3::10]:40538) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBIGa-0005ex-5G for qemu-devel@nongnu.org; Tue, 22 Dec 2015 03:25:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aBIGW-0001aQ-4T for qemu-devel@nongnu.org; Tue, 22 Dec 2015 03:25:56 -0500 Received: from indium.canonical.com ([91.189.90.7]:43359) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBIGV-0001aM-Ud for qemu-devel@nongnu.org; Tue, 22 Dec 2015 03:25:52 -0500 Received: from loganberry.canonical.com ([91.189.90.37]) by indium.canonical.com with esmtp (Exim 4.76 #1 (Debian)) id 1aBIGU-0005ap-Jc for ; Tue, 22 Dec 2015 08:25:50 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id 831482E80C3 for ; Tue, 22 Dec 2015 08:25:50 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Tue, 22 Dec 2015 08:18:29 -0000 From: Maxim Ostapenko Sender: bounces@canonical.com References: <20151221142914.18731.60931.malonedeb@wampee.canonical.com> Message-Id: <20151222081829.26009.38092.malone@gac.canonical.com> Errors-To: bounces@canonical.com Subject: [Qemu-devel] [Bug 1528239] Re: Unable to debug PIE binaries with QEMU gdb stub. Reply-To: Bug 1528239 <1528239@bugs.launchpad.net> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org GDB server itself actually supports PIE binaries. -- = You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1528239 Title: Unable to debug PIE binaries with QEMU gdb stub. Status in QEMU: New Bug description: The issue occurs on current trunk: max@max:~/build/qemu$ cat test.c #include int main() { printf("Hello, world!\n"); return 0; } max@max:~/build/qemu$ gcc test.c -fPIC -pie -o bad.x max@max:~/build/qemu$ ./x86_64-linux-user/qemu-x86_64 -g 1234 bad.x = ............................. = max@max:~/build/qemu$ gdb GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1 .........................................................................= ............... (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/ld-linux-x86-64.so.2...warning: the debug inf= ormation found in "/lib64/ld-2.19.so" does not match "/lib64/ld-linux-x86-6= 4.so.2" (CRC mismatch). Reading symbols from /usr/lib/debug//lib/x86_64-linux-gnu/ld-2.19.so...do= ne. done. Loaded symbols for /lib64/ld-linux-x86-64.so.2 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/ld-linux-x86-64.so.2 (gdb) c Continuing. [Inferior 1 (Remote target) exited normally] (gdb) = = max@max:~/build/qemu$ cat config.log # Configured with: '/home/max/src/qemu/configure' '--prefix=3D/home/max/i= nstall/qemu' '--target-list=3Darm-linux-user,aarch64-linux-user,x86_64-linu= x-user' '--static' = W/O QEMU or -pie flag breakpoint on main works fine. To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1528239/+subscriptions