Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@cygnus.com>
To: Per Bothner <per@bothner.com>
Cc: Nick Duffek <nsd@redhat.com>, gdb@sources.redhat.com
Subject: Re: Harvard proposal
Date: Fri, 23 Feb 2001 17:25:00 -0000	[thread overview]
Message-ID: <3A970CE6.6B2D2F34@cygnus.com> (raw)
In-Reply-To: <m2itmiusrc.fsf@kelso.bothner.com>

Per Bothner wrote:
> So we need to agree what CORE_ADDR is.  If most people think that
> ultimately CORE_ADDR should be a struct, it is because CORE_ADDR is
> the data type that gdb uses internally to represent an address.  So
> either I've misunderstood you, or you got it backwards:
> ADDR_IN_REAL_DATA and ADDR_IN_REAL_INSN take an integer argument and
> *return* a CORE_ADDR; they do not *take* CORE_ADDRs.

A CORE_ADDR is a cannonical address within the target address space.  A
CORE_ADDR should, in theory, be able to identify every target byte (or
if someone gets it working - word).

The definition was developed in part to address targets that intermixed
32 and 64 bit ISA modes with 32 and 64 bit debug/object formats (read
mips64 in elf32).   Since every pointer, symbol value, ... moving in
towards GDB is eventually converted into a cannonical CORE_ADDR direct
comparisons between addresses from different sources (PC, symtab) are
made possible.

Nick Duffek wrote:
> I agree.  The problem is that CORE_ADDR has multiple personalities:
[....]
>  (2) An integer wide enough to hold a real hardware address.  This is
>       what ADDR_IN_REAL_* expects as a CORE_ADDR parameter.

GDB has several types.  CORE_ADDR, LONGEST, DOUBLEST, .... CORE_ADDR and
LONGEST are used pretty interchangably - they are both large integers so
there is nothing, other than, convention, to stop people doing this.

However, as with traditional C, I'd suggest following the convention of
CORE_ADDR (void*) for pointers and LONGEST (long) for offsets.

	Andrew


  parent reply	other threads:[~2001-02-23 17:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-10 12:19 Nick Duffek
2001-02-10 13:27 ` Per Bothner
2001-02-10 17:11   ` Nick Duffek
2001-02-23 17:25   ` Andrew Cagney [this message]
2001-02-23 20:27     ` Per Bothner
2001-02-26  8:34       ` Andrew Cagney
2001-02-26  8:49         ` Per Bothner
2001-02-26 10:13           ` Andrew Cagney
2001-02-13 13:22 ` Andrew Cagney
2001-02-13 13:35   ` Nick Duffek

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=3A970CE6.6B2D2F34@cygnus.com \
    --to=ac131313@cygnus.com \
    --cc=gdb@sources.redhat.com \
    --cc=nsd@redhat.com \
    --cc=per@bothner.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