From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10254 invoked by alias); 2 May 2003 01:09:53 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 10229 invoked from network); 2 May 2003 01:09:52 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 2 May 2003 01:09:52 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h4219q304802 for ; Thu, 1 May 2003 21:09:52 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h4219pI00814; Thu, 1 May 2003 21:09:51 -0400 Received: from localhost.localdomain (vpn50-6.rdu.redhat.com [172.16.50.6]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h4219oO28852; Thu, 1 May 2003 21:09:50 -0400 Received: (from kev@localhost) by localhost.localdomain (8.11.6/8.11.6) id h4219jD27039; Thu, 1 May 2003 18:09:45 -0700 Date: Fri, 02 May 2003 01:09:00 -0000 From: Kevin Buettner Message-Id: <1030502010944.ZM27038@localhost.localdomain> In-Reply-To: Andrew Cagney "Re: register_offset_hack() vs REGISTER_BYTE()" (May 1, 8:58pm) References: <1030502003824.ZM26690@localhost.localdomain> <3EB1C2C8.5080502@redhat.com> To: Andrew Cagney , Kevin Buettner Subject: Re: register_offset_hack() vs REGISTER_BYTE() Cc: gdb@sources.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-05/txt/msg00012.txt.bz2 On May 1, 8:58pm, Andrew Cagney wrote: > > I'm seeing the following internal error: > > > > .../frame.c:591: internal-error: Failed to compute the register number > > corresponding to 0x296 > > > > This is happening because the *addrp value in the following loop (which > > is in frame_register() in frame.c)... > > > > for (regnum = 0; regnum < NUM_REGS + NUM_PSEUDO_REGS; regnum++) > > { > > if (*addrp == register_offset_hack (current_gdbarch, regnum)) > > { > > *realnump = regnum; > > return; > > } > > } > > > > ...is set using a value obtained from REGISTER_BYTE(). (See > > sentinel_frame_prev_register in sentinel-frame.c.) But the > > value obtained from register_offset_hack() was computed by using the > > register's virtual type. > > Er, for a legacy architecture, register_offset_hack(i) (aka > current_regcache->descr->register_offset) should be REGISTER_BYTE(i). > See init_legacy_regcache_descr. > > Sounds like the MIPS is sneeking past: > > /* If an old style architecture, fill in the remainder of the > register cache descriptor using the register macros. */ > if (!gdbarch_pseudo_register_read_p (gdbarch) > && !gdbarch_pseudo_register_write_p (gdbarch) > && !gdbarch_register_type_p (gdbarch)) > { > descr->legacy_p = 1; > init_legacy_regcache_descr (gdbarch, descr); > return descr; > } Hmm, yes. I just added some pseudo registers... Kevin