Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Looking for a gdb function to handle alias addresses
@ 2003-12-30 22:19 Paul Koning
  2003-12-30 23:00 ` Daniel Jacobowitz
  2003-12-31 17:36 ` Andrew Cagney
  0 siblings, 2 replies; 7+ messages in thread
From: Paul Koning @ 2003-12-30 22:19 UTC (permalink / raw)
  To: gdb

Gentlepeople,

I'm working on a kernel dump analyzer integrated with gdb (similar to
the corefile support -- but with a pile of added wrinkles many of
which are specific to our particular platform).

One thing we run into from time to time is that there are several
legal addresses for the same object.  The target is MIPS-based, so an
obvious one is that a KSEG1 address (0xa0000000-0xbfffffff) aliases a
KSEG0 address (KSEG1 - 0x02000000).  Similarly, in MIPS64 there are
64-bit addresses of various forms that also alias, sometimes in more
complex ways than simply a numeric bias.

The ELF image of course has its symbols associated with one of these
addresses, typically the KSEG0 address.  As a result, when I'm dealing
with an alias address, the mapping of address to symbol doesn't work
right.  It's easy to get the right data from the dump file, but for
commands like "bt" to work, the symbol references have to come out
right. 

So... is there a standard gdb hook (say, part of the gdbarch
machinery) that is supposed to take an alias address and map it to the
"canonical" form which is the one expected to be found in the symtab?

I thought of tweaking gdbarch_frame_saved_pc, but then I end up with
false (numeric) addresses showing up in "bt" -- the canonical ones
rather than the ones that are really in the call stack.

Is there a function that's called at a later spot, so I can get the
raw addresses in the callstack and yet have them resolved to symbols
correctly?  Similarly, would that allow things like "disassemble
<alias>" to work with the symbol names "correctly" shown in the
disassembly output?

If this doesn't currently exist, could anyone offer hints as to where
such a beast could be added (and what form, roughly, it should take)?

Thanks,
	paul


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-12-31 18:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-30 22:19 Looking for a gdb function to handle alias addresses Paul Koning
2003-12-30 23:00 ` Daniel Jacobowitz
2003-12-31 15:26   ` Paul Koning
2003-12-31 16:37     ` Daniel Jacobowitz
2003-12-31 16:53       ` Paul Koning
2003-12-31 17:36 ` Andrew Cagney
2003-12-31 18:31   ` Paul Koning

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox