From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13903 invoked by alias); 23 Oct 2002 03:08: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 13894 invoked from network); 23 Oct 2002 03:08:31 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 23 Oct 2002 03:08:31 -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 g9N2lAw02998 for ; Tue, 22 Oct 2002 22:47:10 -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 g9N38Uf22933; Tue, 22 Oct 2002 23:08:30 -0400 Received: from localhost.localdomain (romulus-int.sfbay.redhat.com [172.16.27.46]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id g9N38T002116; Tue, 22 Oct 2002 23:08:30 -0400 Subject: Re: [RFA] string_to_core_addr fix From: "Martin M. Hunt" To: Andrew Cagney Cc: Kevin Buettner , gdb-patches@sources.redhat.com In-Reply-To: <3DB45E39.9000102@redhat.com> References: <200210101507.46548.hunt@redhat.com> <1021010223959.ZM14496@localhost.localdomain> <200210102129.52218.hunt@redhat.com> <1021011065646.ZM14913@localhost.localdomain> <3DB45E39.9000102@redhat.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Tue, 22 Oct 2002 20:08:00 -0000 Message-Id: <1035342441.19691.112.camel@localhost.localdomain> Mime-Version: 1.0 X-SW-Source: 2002-10/txt/msg00452.txt.bz2 On Mon, 2002-10-21 at 13:06, Andrew Cagney wrote: > Insight parse_and_eval_address() was simply bogus. See the thread > around the original introduction of these functions. I looked. All I found was something about parse_and_eval_address() being broken for harvard arch. > A short summary is > that parse_and_eval_address() does conversions like you describe and > none are needed. Instead functions that parse in, write out, raw > CORE_ADDR values are needed. I believe we have target addrs and CORE_ADDRs, where CORE_ADDRs are sometimes target addrs sign-extended to 64-bits. Is that not right? If the user types something like "x/10i 0xA0000000" on a Mips architecture, is the address not sign-extended to a 64-bit CORE_ADDR? >From memory, you print out a target addr by using paddr_nz. If you wanted to print a CORE_ADDR you would use core_addr_to_string_nz. You can read in a CORE_ADDR with string_to_core_addr. So how do you read in a target addr and have it converted to a CORE_ADDR? > I believe that this change is wrong and should be reverted. By your definition of string_to_core_addr below, I agree. However, this bug has been here a long time and I would like some agreement on how it should properly be fixed. The bug is simply that Insight gets CORE_ADDRs for any symbol lookup. It must convert them to strings and uses paddr_nz. Then the user does something with that address and Insight converts that address string back into a CORE_ADDR incorrectly (it doesn't sign-extend to 64-bits, therefore my patch). > Per above, string_to_core_addr() and core_addr_to_string() scan/print > raw CORE_ADDR values. If there is some sort of conversion problem going > on then this indicates that something isn't writing out / reading a raw > CORE_ADDR value correctly (or some code is trying to use the function > incorrectly). > > Andrew > >