Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Symbol tables for separately linked pieces
@ 2008-07-10 14:27 Paul Koning
  2008-07-10 14:58 ` Andrew STUBBS
  2008-07-12  2:35 ` Michael Snyder
  0 siblings, 2 replies; 8+ messages in thread
From: Paul Koning @ 2008-07-10 14:27 UTC (permalink / raw)
  To: gdb

I have an application that consists of two parts, a main program which
is one ELF image and a subsystem which is separately linked as an ELF
image of its own.  The latter is loade into a portion of the address
space of the former at startup.  The symbol table of the subsystem
image reflects its final load address.

The question is how to handle this with GDB.  I've used the
add-symbol-file command, and that works up to a point.

The difficulty lies in the reason why the subsystem is separately
linked int he first place -- it has name conflicts with symbols in the
main program.

What I need to be able to do is this:

1. When debugging in the subsystem, have its symbol table loaded "on
   top" -- so any name lookups are resolved first from that symbol
   table and only after that from the other (main program) table.

2. When I switch to debugging in the main program, I want to be able
   to tell GDB to deactivate the subsystem symbol table temporarily
   (or perhaps better yet, keep it around "on the bottom") so a
   name that exists in both is now resolved from the main program.

I've hacked up something like this by "context switching" the
object_files and symfile_objfile variables, but that seems to be a bit
fragile.  I sometimes run into GDB internal errors with this approach.

So the questions are:

1. Does GDB have a way to do this?
2. If not, any hints about a clean way to add this?
3. If I were to add this, would it be of general interest (i.e.,
   something I should submit)?

Thanks,
	paul


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

end of thread, other threads:[~2008-07-14 19:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-10 14:27 Symbol tables for separately linked pieces Paul Koning
2008-07-10 14:58 ` Andrew STUBBS
2008-07-10 15:07   ` Daniel Jacobowitz
2008-07-10 15:56     ` Paul Koning
2008-07-10 16:13       ` Daniel Jacobowitz
2008-07-10 17:10         ` Stan Shebs
2008-07-14 19:04           ` Tom Tromey
2008-07-12  2:35 ` Michael Snyder

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