Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@cygnus.com>
To: Eli Zaretskii <eliz@is.elta.co.il>
Cc: Kevin Buettner <kevinb@cygnus.com>,
	Naushit_Sakarvadia@quintum.com, gdb@sources.redhat.com
Subject: Re: 8 bit read
Date: Thu, 26 Jul 2001 06:17:00 -0000	[thread overview]
Message-ID: <3B60182F.5000504@cygnus.com> (raw)
In-Reply-To: <Pine.SUN.3.91.1010726094010.28739B-100000@is>

>> Is it possible to come up with a single number (address) which
>> represents ($fs:foo)?
> 
> 
> No, because CORE_ADDR is not wide enough to engulf both.  Making
> CORE_ADDR wider is something I'd prefer to avoid, since it will affect
> Binutils as well.


What Kevin is suggesting here is, from GDB's point of view, the correct 
approach.  A CORE_ADDR is a cannonical address - any pointer expression 
is converted to that cannonical value.  On the x86, it could carry an 
indication that the offset part belongs to either code, I/O, .. space.



> It means to use a non-default segment selector to read and write
> memory.


That really means do a virtual->real address translation on all 
addresses as they head towards the target.  The d10v target managed 
this.  I'd view it as a proof of concept.


>> IMO, it would probably be better to redefine CORE_ADDR to have an
>> explicit segment descriptor and address field.
> 
> 
> Yes, but redefining CORE_ADDR is an adventure I'd like to avoid ;-)


It is still an adventure GDB should take. It is like tiddles (TPID) - it 
is going to hurt :-)


> Btw, is there any provision in GDB to add a constant to each address
> recorded in the debug info, so that CORE_ADDR holds addresses with
> that constant added?  (In the case of DJGPP, that constant is the base
> address of the data segment, and is only known at run time.)


The readers can at least do sign-extension.  The 32 bit MIPS makes use 
of this.


> If this is possible, I could use linear addresses instead of offsets
> from the segment's base, and then CORE_ADDR would be wide enough to
> hold addresses outside the data segment as well (assuming they all
> belong to a single Page Directory).


If I understand what you're saying correctly, you'd need a virtual 
(segment:offset) to physical translation somewhere down in the target code.

	Andrew


  reply	other threads:[~2001-07-26  6:17 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-23  9:04 Naushit Sakarvadia
2001-07-23  9:56 ` Daniel Jacobowitz
2001-07-23 11:50 ` Andrew Cagney
2001-07-24  4:49   ` Eli Zaretskii
2001-07-24  9:25     ` Kevin Buettner
2001-07-24 11:11       ` Eli Zaretskii
2001-07-24 14:11         ` Kevin Buettner
2001-07-25  1:45           ` Eli Zaretskii
2001-07-25 11:40             ` Kevin Buettner
2001-07-25 23:39               ` Eli Zaretskii
2001-07-26  6:17                 ` Andrew Cagney [this message]
2001-07-26  6:45                   ` Eli Zaretskii
2001-07-26  6:53                     ` Andrew Cagney
2001-07-26  6:59                       ` Eli Zaretskii
2001-07-26  7:09                         ` Andrew Cagney
2001-07-26  7:01                     ` Andrew Cagney
2001-07-26  9:20                     ` Kevin Buettner
2001-07-26  9:25                       ` Eli Zaretskii

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=3B60182F.5000504@cygnus.com \
    --to=ac131313@cygnus.com \
    --cc=Naushit_Sakarvadia@quintum.com \
    --cc=eliz@is.elta.co.il \
    --cc=gdb@sources.redhat.com \
    --cc=kevinb@cygnus.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