From: "Martin M. Hunt" <hunt@redhat.com>
To: Andrew Cagney <ac131313@redhat.com>
Cc: Kevin Buettner <kevinb@redhat.com>, gdb-patches@sources.redhat.com
Subject: Re: [RFA] string_to_core_addr fix
Date: Tue, 22 Oct 2002 20:08:00 -0000 [thread overview]
Message-ID: <1035342441.19691.112.camel@localhost.localdomain> (raw)
In-Reply-To: <3DB45E39.9000102@redhat.com>
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
>
>
next prev parent reply other threads:[~2002-10-23 3:08 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
2002-10-22 20:08 ` Martin M. Hunt [this message]
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=1035342441.19691.112.camel@localhost.localdomain \
--to=hunt@redhat.com \
--cc=ac131313@redhat.com \
--cc=gdb-patches@sources.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