Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Paul Koning <Paul_Koning@dell.com>
To: gdb@sourceware.org
Subject: Symbol tables for separately linked pieces
Date: Thu, 10 Jul 2008 14:27:00 -0000	[thread overview]
Message-ID: <18550.7195.371436.629820@gargle.gargle.HOWL> (raw)

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


             reply	other threads:[~2008-07-10 14:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-10 14:27 Paul Koning [this message]
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

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=18550.7195.371436.629820@gargle.gargle.HOWL \
    --to=paul_koning@dell.com \
    --cc=gdb@sourceware.org \
    /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