From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1935 invoked by alias); 14 Sep 2008 19:35:40 -0000 Received: (qmail 1927 invoked by uid 22791); 14 Sep 2008 19:35:39 -0000 X-Spam-Check-By: sourceware.org Received: from hiauly1.hia.nrc.ca (HELO hiauly1.hia.nrc.ca) (132.246.100.193) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 14 Sep 2008 19:35:01 +0000 Received: by hiauly1.hia.nrc.ca (Postfix, from userid 1000) id 520424DE6; Sun, 14 Sep 2008 15:34:58 -0400 (EDT) Subject: Re: [PATCH] Fix dwarf register column to gdb register mapping To: randolph@tausq.org (Randolph Chung) Date: Sun, 14 Sep 2008 19:35:00 -0000 From: "John David Anglin" Cc: gdb-patches@sourceware.org In-Reply-To: <1e3eba760809131800y3dcbcc33u8c8c4ccb4e06eb11@mail.gmail.com> from "Randolph Chung" at Sep 13, 2008 06:00:41 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-Id: <20080914193459.520424DE6@hiauly1.hia.nrc.ca> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-09/txt/msg00319.txt.bz2 > When I enabled the dwarf debugging support in gdb before i caused > various errors and warnings about incorrect cfi. Do you still see that > with this enabled? Is it compiler dependent? Because of those warnings > and errors I had disabled the dwarf stuff on hppa before. Investigating some more, I see there's a problem with the floating point registers. A break on wack_double demonstrates the problem on both hppa64-hpux and hppa-linux: Starting program: /home/dave/xxx Breakpoint 1, wack_double (u=warning: Unmapped DWARF Register #108 encountered. ../../src/gdb/regcache.c:164: internal-error: register_type: Assertion `regnum >= 0 && regnum < descr->nr_cooked_registers' failed. Same problem for a break on add_double. .debug_frame for wack_double appears ok when I dump it with readelf -wf: 0000002c 00000020 00000000 FDE cie=00000000 pc=00000028..0000008c DW_CFA_advance_loc: 8 to 00000030 DW_CFA_register: r3 in r1 DW_CFA_offset_extended_sf: r2 at cfa-20 DW_CFA_advance_loc: 4 to 00000034 DW_CFA_def_cfa_register: r3 DW_CFA_advance_loc: 4 to 00000038 DW_CFA_offset: r3 at cfa+0 DW_CFA_advance_loc: 8 to 00000040 DW_CFA_offset: r49 at cfa+20 DW_CFA_offset: r48 at cfa+16 DW_CFA_nop DW_CFA_nop It gets the correct columns for the floating register saves. So, I think it's gdb which has the problem. It's possible it is confused by the fact that the stores are done using r1. I'm going to look at the effect of disabling dwarf register numbers on hppa64-hpux. Dave -- J. David Anglin dave.anglin@nrc-cnrc.gc.ca National Research Council of Canada (613) 990-0752 (FAX: 952-6602) double add_double (register double u, register double v) { return u + v; } double wack_double (register double u, register double v) { register double l = u, r = v; l = add_double (l, r); return l + r; } int main () { wack_double (-1, -2); return 0; }