From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10559 invoked by alias); 21 Oct 2002 20:06:27 -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 10552 invoked from network); 21 Oct 2002 20:06:25 -0000 Received: from unknown (HELO touchme.toronto.redhat.com) (216.138.202.10) by sources.redhat.com with SMTP; 21 Oct 2002 20:06:25 -0000 Received: from localhost.redhat.com (to-dhcp51.toronto.redhat.com [172.16.14.151]) by touchme.toronto.redhat.com (Postfix) with ESMTP id C67F8800090; Mon, 21 Oct 2002 16:06:24 -0400 (EDT) Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 1CD243DEE; Mon, 21 Oct 2002 16:06:18 -0400 (EDT) Message-ID: <3DB45E39.9000102@redhat.com> Date: Mon, 21 Oct 2002 13:06:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.0) Gecko/20020824 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Kevin Buettner , "Martin M. Hunt" Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] string_to_core_addr fix References: <200210101507.46548.hunt@redhat.com> <1021010223959.ZM14496@localhost.localdomain> <200210102129.52218.hunt@redhat.com> <1021011065646.ZM14913@localhost.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-10/txt/msg00349.txt.bz2 > On Oct 10, 9:29pm, Martin M. Hunt wrote: > > >> For years we used parse_and_eval_address() in Insight until earlier this year >> when those calls were replaced with string_to_core_addr(), breaking all mips >> targets. parse_and_eval_address() internally calls INTEGER_TO_ADDRESS() so I >> probably should use that. In fact I decided to just do what >> parse_and_eval_address() did but apparently submitted the wrong version. Insight parse_and_eval_address() was simply bogus. See the thread around the original introduction of these functions. 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. Switching to string_to_core_addr() and core_addr_to_string() flushed out a heap of address conversion problems for the d10v, and I beleive, the MIPS. >> Revised patch attached. >> >> Index: utils.c >> =================================================================== >> RCS file: /cvs/src/src/gdb/utils.c,v >> retrieving revision 1.80 >> diff -u -p -r1.80 utils.c >> --- utils.c 20 Sep 2002 00:24:01 -0000 1.80 >> +++ utils.c 11 Oct 2002 04:29:51 -0000 >> @@ -2649,6 +2649,8 @@ string_to_core_addr (const char *my_stri >> internal_error (__FILE__, __LINE__, "invalid decimal"); >> } >> } >> + if (INTEGER_TO_ADDRESS_P ()) >> + addr = INTEGER_TO_ADDRESS (builtin_type_void_data_ptr, &addr); >> return addr; >> } > > > Okay, this version looks reasonable. (Approved.) Make sure you > update the ChangeLog entry to match. I believe that this change is wrong and should be reverted. 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