From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28808 invoked by alias); 22 Jan 2002 15:21:32 -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 28776 invoked from network); 22 Jan 2002 15:21:30 -0000 Received: from unknown (HELO localhost.cygnus.com) (24.114.42.213) by sources.redhat.com with SMTP; 22 Jan 2002 15:21:30 -0000 Received: from cygnus.com (localhost [127.0.0.1]) by localhost.cygnus.com (Postfix) with ESMTP id 56CD53F17; Tue, 22 Jan 2002 10:21:29 -0500 (EST) Message-ID: <3C4D8379.2030207@cygnus.com> Date: Tue, 22 Jan 2002 07:21:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:0.9.7) Gecko/20020103 X-Accept-Language: en-us MIME-Version: 1.0 To: fnf@redhat.com Cc: gdb-patches@sources.redhat.com Subject: Re: [RFC] "info registers" is misleading References: <200201220651.g0M6pMe17608@fred.ninemoons.com> Content-Type: multipart/mixed; boundary="------------040502070407000300030607" X-SW-Source: 2002-01/txt/msg00690.txt.bz2 This is a multi-part message in MIME format. --------------040502070407000300030607 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 740 Fred, Have a look through gdb/521. http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gdb&pr=251&return_url=http%3A%2F%2Fsources.redhat.com%2Fcgi-bin%2Fgnatsweb.pl%3Fdatabase%3Dgdb%26category%3Dall%26severity%3Dall%26priority%3Dall%26responsible%3Dall%26submitter_id%3Dall%26state%3Dall%26ignoreclosed%3DIgnore%2520Closed%26class%3Dall%26synopsis%3D%26multitext%3D%26columns%3Dcategory%26columns%3Dstate%26columns%3Dresponsible%26columns%3Dsynopsis%26displaydate%3DDisplay%2520Current%2520Date%26cmd%3Dsubmit%2520query%26sortby%3DResponsible%26.cgifields%3Dcolumns%26.cgifields%3Doriginatedbyme%26.cgifields%3Ddisplaydate%26.cgifields%3Dignoreclosed (I don't know of the attached link will work or not) Andrew --------------040502070407000300030607 Content-Type: text/html; charset=ISO-8859-1; name="View PR 251 - gnatsweb" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename="View PR 251 - gnatsweb" Content-Base: "http://sources.redhat.com/cgi-bin/gnat sweb.pl?cmd=view%20audit-trail&data base=gdb&pr=251&return_url=http%3A% 2F%2Fsources.redhat.com%2Fcgi-bin%2 Fgnatsweb.pl%3Fdatabase%3Dgdb%26cat egory%3Dall%26severity%3Dall%26prio rity%3Dall%26responsible%3Dall%26su bmitter_id%3Dall%26state%3Dall%26ig noreclosed%3DIgnore%2520Closed%26cl ass%3Dall%26synopsis%3D%26multitext %3D%26columns%3Dcategory%26columns% 3Dstate%26columns%3Dresponsible%26c olumns%3Dsynopsis%26displaydate%3DD isplay%2520Current%2520Date%26cmd%3 Dsubmit%2520query%26sortby%3DRespon sible%26.cgifields%3Dcolumns%26.cgi fields%3Doriginatedbyme%26.cgifield s%3Ddisplaydate%26.cgifields%3Digno reclosed" Content-Location: "http://sources.redhat.com/cgi-bin/gnat sweb.pl?cmd=view%20audit-trail&data base=gdb&pr=251&return_url=http%3A% 2F%2Fsources.redhat.com%2Fcgi-bin%2 Fgnatsweb.pl%3Fdatabase%3Dgdb%26cat egory%3Dall%26severity%3Dall%26prio rity%3Dall%26responsible%3Dall%26su bmitter_id%3Dall%26state%3Dall%26ig noreclosed%3DIgnore%2520Closed%26cl ass%3Dall%26synopsis%3D%26multitext %3D%26columns%3Dcategory%26columns% 3Dstate%26columns%3Dresponsible%26c olumns%3Dsynopsis%26displaydate%3DD isplay%2520Current%2520Date%26cmd%3 Dsubmit%2520query%26sortby%3DRespon sible%26.cgifields%3Dcolumns%26.cgi fields%3Doriginatedbyme%26.cgifield s%3Ddisplaydate%26.cgifields%3Digno reclosed" Content-length: 10070 Vi= ew PR 251 - gnatsweb
=
gdb  User: guest  Access: viewconf gnatsweb
MAIN PAGECREATEQUERYADV. QUERYLOGIN AGAINHELP

View Problem Report: 251

or send email to interested parties


Reporter's email: ac131313@cygnus.com
CC these people
on PR status email:
   
Number: 251
Category: gdb
Synopsis: The $fp problem
Confidential: no
Severity: serious
Priority: medium
Responsible: unassigned
State: open
Class: sw-bug
Submitter-Id: net
Arrival-Date: Fri Nov 30 20:18:01 PST 2001
Closed-Date:
Last-Modified:
Originator: EOF causes recursive internal error
Release: unknown-1.0
Organization:
Environment:
Description: Some targets, such as ARM, have a ``frame pointer register''= ; or $fp.  That register might be used as the frame base address but n= ot necessarily (-fomit-frame-pointer).

Separatly, GDB provides a number of built-in registers including $fp. = Here $fp is the current functions frame base as computed using debug info = and other magic.

According to the doco: ``When ever possible, these four standard register n= ames [$fp is one] are available on your machine even though the machine has= different cannonical mnemonics, so long as there is no conflict.''=

Problem is, GDB got it wrong.  Instead, the user finds that:

        info registers fp

prints the target $fp while

        print $fp

prints the GDB built-in FP.  I.e. the target register does not overrid= e the built-in register.
File Attachments:
How-To-Repeat:
Fix: (this is strictly theory but I don't think it is far off :-)

The problem occures because FP_REGNUM is overloaded.

target_map_name_to_register("fp") first searches the target archi= tecture register name space and then the built-in register name space. = ; Problem is, it returns FP_REGNUM for both cases.

Consequently, code such as read_relative_register_raw_bytes_for_frame() wil= l always intercept a read of FP_REGNUM and map that onto the built-in regis= ter.

The fix is to kick the built-in FP regnum out of the target architecture= 9;s range of registers.

That is, if the target architecture has an $fp register, it is designated b= y FP_REGNUM - in the range [0 .. NUM_REGS + NUM_PSEUDO_REGS).  If ther= e is no architecture specific $fp, then the $fp register is identified usin= g BUILTIN_FP_REGNUM - in [NUM_REGS + NUM_PSUEDO_REGS ..).

Since the code checking for the built-in register would be testing for BUIL= TIN_FP_REGNUM it would blissfully ignore (not intercept) any accesses to th= e target architectures FP_REGNUM.
Release-Note:
Unformatted:

or send email to interested parties

Audit Trail:

=

--------------040502070407000300030607--