From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25133 invoked by alias); 20 Dec 2003 15:27:46 -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 25082 invoked from network); 20 Dec 2003 15:27:45 -0000 Received: from unknown (HELO walton.kettenis.dyndns.org) (213.93.115.144) by sources.redhat.com with SMTP; 20 Dec 2003 15:27:45 -0000 Received: from elgar.kettenis.dyndns.org (elgar.kettenis.dyndns.org [192.168.0.2]) by walton.kettenis.dyndns.org (8.12.6p3/8.12.6) with ESMTP id hBKFRVtb000531; Sat, 20 Dec 2003 16:27:31 +0100 (CET) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: from elgar.kettenis.dyndns.org (localhost [127.0.0.1]) by elgar.kettenis.dyndns.org (8.12.6p3/8.12.6) with ESMTP id hBKFRViI000717; Sat, 20 Dec 2003 16:27:31 +0100 (CET) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: (from kettenis@localhost) by elgar.kettenis.dyndns.org (8.12.6p3/8.12.6/Submit) id hBKFRHgI000712; Sat, 20 Dec 2003 16:27:17 +0100 (CET) Date: Sat, 20 Dec 2003 15:27:00 -0000 Message-Id: <200312201527.hBKFRHgI000712@elgar.kettenis.dyndns.org> From: Mark Kettenis To: dje@watson.ibm.com CC: cagney@gnu.org, gcc@gcc.gnu.org, gdb-patches@sources.redhat.com, Ulrich.Weigand@de.ibm.com, geoffk@geoffk.org In-reply-to: <200312182258.hBIMwgT25422@makai.watson.ibm.com> (message from David Edelsohn on Thu, 18 Dec 2003 17:58:42 -0500) Subject: Re: Incorrect DWARF-2 register numbers on PPC64? References: <200312182258.hBIMwgT25422@makai.watson.ibm.com> X-SW-Source: 2003-12/txt/msg00456.txt.bz2 Date: Thu, 18 Dec 2003 17:58:42 -0500 From: David Edelsohn >>>>> Andrew Cagney writes: > Argh! Someone teach GCC about the PPC64 DWARF register numbering > please! Before it is too late! Now it is using the PPC32 LR register > number, which just happens to be the PPC64 FPSCR register. The 32-bit PowerPC System V ABI defines DWARF Register Number Mapping that does not appear to be implemented in GCC or GDB. This issue probably requires more thought and discussion about whether PPC64 should be compatible with PPC32 or PPC64 should be compliant with the ABI or both PPC32 and PPC64 should be compliant with the ABI. Ah, You're right. I should have looked a little better. So currently GCC uses the same mapping for DWARF as it does for stabs. Seems like there is a problem with GDB; we do some remapping for stabs (see rs6000-tdep.c:rs6000_stab_reg_to_regnum), but don't remap for DWARF. We probably should at least fix that until things are cleared up. Personally I find it a bit awkward to use a non-standard register mapping if there is a mapping defined in the ABI, so I'm in favour of using the mapping defined in the System V ABI. I don't know if this is possible though, since changing the mapping might break exception handling[1]. Mark [1] From casual inspection this doesn't seem to be the case. The general purpose registers will still be mapped in the same way, and the return address column is encoded in the debug info itself.