Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@redhat.com>
To: Klee Dienes <klee@apple.com>
Cc: Daniel Jacobowitz <drow@mvista.com>, gdb-patches@sources.redhat.com
Subject: Re: [PATCH] Use read_memory_unsigned_integer when reading to CORE_ADDR
Date: Mon, 21 Oct 2002 12:08:00 -0000	[thread overview]
Message-ID: <3DB44D28.2090209@redhat.com> (raw)
In-Reply-To: <3F2B1B3E-D8F8-11D6-9DA9-00039396EEB8@apple.com>

> Perhaps something along the lines of the following?
> 
> {
>   unsigned char buf[sizeof (CORE_ADDR)];
>   if (target_read_memory (memaddr, buf, TYPE_LENGTH (builtin_type_void_data_ptr)) != 0)
>     error ("Unable to determine lower bound of array.");
>   *lower_bound = extract_typed_address (buf, builtin_type_void_data_ptr);
> }
> 
> That's a bit verbose, and it's not clear to me if sizeof (CORE_ADDR) is guaranteed to be large enough to contain a raw target pointer, but I can't really think of any better alternatives.
> 
> Aside from the intimidating comments in findvar.c, this would seem a good candidate for extract_address ... though a similar modification would have to be made to it to handle the sign-extension as well.
> 
> Or alternately, I could just leave well-enough alone, and be careful to truncate CORE_ADDRs to 32 bits in our target xfer_memory code (or the MIPS code could sign-extend it in the same place).

Just FYI, the MIPS tried to do this, and it lost badly!  It also turned 
out that the MIPS case was just a simplification of the more generic 
harvard case and hence the core of GDB is being modified, as people 
notice, to use the pointer to address and address to pointer functions.

Andrew


  parent reply	other threads:[~2002-10-21 19:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-05 19:48 Klee Dienes
2002-10-05 19:56 ` Daniel Jacobowitz
2002-10-05 23:52   ` Klee Dienes
2002-10-06  8:09     ` Daniel Jacobowitz
2002-10-06  9:41       ` Klee Dienes
2002-10-06  9:51         ` Daniel Jacobowitz
2002-10-07 14:19         ` Jim Blandy
2002-10-21 12:08         ` Andrew Cagney
2002-11-04 19:45           ` Klee Dienes
2002-11-06 14:37             ` Andrew Cagney
2002-10-21 12:08     ` Andrew Cagney [this message]
2002-10-07 14:14   ` Jim Blandy

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=3DB44D28.2090209@redhat.com \
    --to=ac131313@redhat.com \
    --cc=drow@mvista.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=klee@apple.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