* address space support
@ 2008-04-20 10:11 Doug Evans
2008-04-21 17:19 ` Daniel Jacobowitz
2008-04-21 17:57 ` Ulrich Weigand
0 siblings, 2 replies; 5+ messages in thread
From: Doug Evans @ 2008-04-20 10:11 UTC (permalink / raw)
To: gdb
At Transmeta we had a hack to implement address spaces. I.e.,
CORE_ADDR isn't enough to fully describe all the bits of "memory" one
might want to examine. One could do things like "x/x
<addr-space-name>:<address>". Using that we also hacked in support for
x86 segments, so one could do "x/x fs:1234".
We didn't want to maintain a ton of local mods so we took a minimalist
route. Other ways that have been discussed in the past are things like
turning CORE_ADDR into a struct:
typedef struct { int address_space ; OLD_CORE_ADDR address; } NEW_CORE_ADDR;
or some such (appropriately typed, named, etc.).
But that's a ton of work, and not necessarily a maintainable way to go
(the common case is addresses are just ints). Hacking CORE_ADDR by
putting the address space in the upper bits doesn't necessarily work either.
So I don't have a specific proposal, I'm just taking a survey of where
things have left off.
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: address space support
2008-04-20 10:11 address space support Doug Evans
@ 2008-04-21 17:19 ` Daniel Jacobowitz
2008-04-21 19:25 ` Michael Snyder
2008-04-21 17:57 ` Ulrich Weigand
1 sibling, 1 reply; 5+ messages in thread
From: Daniel Jacobowitz @ 2008-04-21 17:19 UTC (permalink / raw)
To: Doug Evans; +Cc: gdb
On Sat, Apr 19, 2008 at 09:38:26AM -0700, Doug Evans wrote:
> But that's a ton of work, and not necessarily a maintainable way to go
> (the common case is addresses are just ints). Hacking CORE_ADDR by
> putting the address space in the upper bits doesn't necessarily work
> either.
May not necessarily work but that's the state of the art. All the
targets with address spaces in GDB today have relatively small
addressable areas so there are some bits to use. And we use the same
convention for CORE_ADDR that GNU binutils uses in the ELF symbol
table, generally.
Also see "@code" and "@data", though there's nothing in the manual
about them... TYPE_FLAG_CODE_SPACE and TYPE_FLAG_DATA_SPACE.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: address space support
2008-04-21 17:19 ` Daniel Jacobowitz
@ 2008-04-21 19:25 ` Michael Snyder
2008-04-22 20:07 ` Eli Zaretskii
0 siblings, 1 reply; 5+ messages in thread
From: Michael Snyder @ 2008-04-21 19:25 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: Doug Evans, gdb
On Sun, 2008-04-20 at 10:32 -0400, Daniel Jacobowitz wrote:
> On Sat, Apr 19, 2008 at 09:38:26AM -0700, Doug Evans wrote:
> > But that's a ton of work, and not necessarily a maintainable way to go
> > (the common case is addresses are just ints). Hacking CORE_ADDR by
> > putting the address space in the upper bits doesn't necessarily work
> > either.
>
> May not necessarily work but that's the state of the art. All the
> targets with address spaces in GDB today have relatively small
> addressable areas so there are some bits to use. And we use the same
> convention for CORE_ADDR that GNU binutils uses in the ELF symbol
> table, generally.
>
> Also see "@code" and "@data", though there's nothing in the manual
> about them... TYPE_FLAG_CODE_SPACE and TYPE_FLAG_DATA_SPACE.
Erm, yeah -- those were something I did in 2001, when I was
at Red Hat. See ChangeLog-2001.
I'd vaguely hoped that the work might be extensible to
include general address spaces...
Sorry about the missing docs -- Eli, why didn't you
catch me on that one? ;-)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: address space support
2008-04-21 19:25 ` Michael Snyder
@ 2008-04-22 20:07 ` Eli Zaretskii
0 siblings, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2008-04-22 20:07 UTC (permalink / raw)
To: Michael Snyder; +Cc: drow, dje, gdb
> From: Michael Snyder <msnyder@specifix.com>
> Cc: Doug Evans <dje@sebabeach.org>, gdb@sourceware.org
> Date: Mon, 21 Apr 2008 10:57:15 -0700
>
> Sorry about the missing docs -- Eli, why didn't you
> catch me on that one? ;-)
Sorry, I don't always have time to read every message in all the
detail.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: address space support
2008-04-20 10:11 address space support Doug Evans
2008-04-21 17:19 ` Daniel Jacobowitz
@ 2008-04-21 17:57 ` Ulrich Weigand
1 sibling, 0 replies; 5+ messages in thread
From: Ulrich Weigand @ 2008-04-21 17:57 UTC (permalink / raw)
To: Doug Evans; +Cc: gdb
Doug Evans wrote:
> At Transmeta we had a hack to implement address spaces. I.e.,
> CORE_ADDR isn't enough to fully describe all the bits of "memory" one
> might want to examine. One could do things like "x/x
> <addr-space-name>:<address>". Using that we also hacked in support for
> x86 segments, so one could do "x/x fs:1234".
>
> We didn't want to maintain a ton of local mods so we took a minimalist
> route. Other ways that have been discussed in the past are things like
> turning CORE_ADDR into a struct:
>
> typedef struct { int address_space ; OLD_CORE_ADDR address; } NEW_CORE_ADDR;
>
> or some such (appropriately typed, named, etc.).
>
> But that's a ton of work, and not necessarily a maintainable way to go
> (the common case is addresses are just ints). Hacking CORE_ADDR by
> putting the address space in the upper bits doesn't necessarily work either.
My current out-of-tree patch to support combined PPU/SPU debugging
on the Cell/B.E. does use the latter method (encode address space into
the upper bits of CORE_ADDR). I'd certainly prefer to see a more
generic method supported by core GDB as well ...
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-04-21 19:25 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-20 10:11 address space support Doug Evans
2008-04-21 17:19 ` Daniel Jacobowitz
2008-04-21 19:25 ` Michael Snyder
2008-04-22 20:07 ` Eli Zaretskii
2008-04-21 17:57 ` Ulrich Weigand
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox