Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@redhat.com>
To: Kevin Buettner <kevinb@redhat.com>, "Martin M. Hunt" <hunt@redhat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA] string_to_core_addr fix
Date: Mon, 21 Oct 2002 13:06:00 -0000	[thread overview]
Message-ID: <3DB45E39.9000102@redhat.com> (raw)
In-Reply-To: <1021011065646.ZM14913@localhost.localdomain>

> 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



  reply	other threads:[~2002-10-21 20:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-10 15:09 Martin M. Hunt
2002-10-10 15:40 ` Kevin Buettner
2002-10-10 21:31   ` Martin M. Hunt
2002-10-11  0:08     ` Kevin Buettner
2002-10-21 13:06       ` Andrew Cagney [this message]
2002-10-22 20:08         ` Martin M. Hunt
2002-10-22 22:35           ` Andrew Cagney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3DB45E39.9000102@redhat.com \
    --to=ac131313@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=hunt@redhat.com \
    --cc=kevinb@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox