From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11712 invoked by alias); 12 Sep 2005 19:47:45 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 11701 invoked by uid 22791); 12 Sep 2005 19:47:38 -0000 Received: from sibelius.xs4all.nl (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Mon, 12 Sep 2005 19:47:38 +0000 Received: from elgar.sibelius.xs4all.nl (root@elgar.sibelius.xs4all.nl [192.168.0.2]) by sibelius.xs4all.nl (8.13.4/8.13.4) with ESMTP id j8CJlVe3004027; Mon, 12 Sep 2005 21:47:31 +0200 (CEST) Received: from elgar.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by elgar.sibelius.xs4all.nl (8.13.4/8.13.3) with ESMTP id j8CJlVpw032657; Mon, 12 Sep 2005 21:47:31 +0200 (CEST) Received: (from kettenis@localhost) by elgar.sibelius.xs4all.nl (8.13.4/8.13.4/Submit) id j8CJlT1H030779; Mon, 12 Sep 2005 21:47:29 +0200 (CEST) Date: Mon, 12 Sep 2005 19:47:00 -0000 Message-Id: <200509121947.j8CJlT1H030779@elgar.sibelius.xs4all.nl> From: Mark Kettenis To: rth@twiddle.net CC: amodra@bigpond.net.au, gdb-patches@gcc.gnu.org, rth@twiddle.net In-reply-to: <20050912125047.GA5411@twiddle.net> (message from Richard Henderson on Mon, 12 Sep 2005 05:50:47 -0700) Subject: Re: ppc32 debugging ppc64, part 1 References: <20050912125047.GA5411@twiddle.net> X-SW-Source: 2005-09/txt/msg00089.txt.bz2 > Date: Mon, 12 Sep 2005 05:50:47 -0700 > From: Richard Henderson > > This is just enough modifications to not immediately fail > debugging a 64-bit process from a 32-bit debugger. > > We don't get very far in the actual debugging: > > (gdb) b main > warning: Breakpoint address adjusted from 0x10093aa0 to 0x10000370. > Breakpoint 1 at 0x10000370 > (gdb) run > Starting program: /home/rth/work/gcc/bld-binu64/gdb/z > warning: Breakpoint address adjusted from 0x10093a40 to 0x100001c0. > warning: Breakpoint 1 address previously adjusted from 0x10093aa0 to 0x10000370. > Breakpoint 1, 0x0000000010000370 in ?? () > (gdb) ppc > 0x10000370 <__libc_tsd_CTYPE_B+268436264>: std r31,-8(r1) > > But this is better than the original: > > Starting program: /home/rth/work/gcc/bld-binu64/gdb/z > warning: Breakpoint address adjusted from 0x10093a40 to 0x100001c0. > Failed to read a valid object file image from memory. > > Program received signal SIGTRAP, Trace/breakpoint trap. > 0x100001c00002d932 in ?? () > > > Comments? Hmm, this is really odd. From what I see above and the changes to the code you made, the implementation of ptrace seems to be just plain broken, either in the kernel or in glibc, probably both. Anyway, I'd really like to see people moving away from using PTRACE_XFER_TYPE and PTRACE_ARG3_TYPE in favour of PTRACE_TYPE_RET and PTRACE_TYPE_ARG3. I wouldn't be surprised if it became clear what's wrong with ptrace(2) on Linux ppc if you realize that PTRACE_XFER_TYPE really is the return type of ptrace(2). This code really should be using PTRACE_GETREGS and friends (like you indicate in the patch) but those are not implemented I assume? I'd really wish this would be fixed in the kernel, instead of being worked around in GDB :-(. Mark