From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 816 invoked by alias); 10 Jul 2008 14:27:45 -0000 Received: (qmail 795 invoked by uid 22791); 10 Jul 2008 14:27:44 -0000 X-Spam-Check-By: sourceware.org Received: from aussmtpmrkps320.us.dell.com (HELO aussmtpmrkps320.us.dell.com) (143.166.224.254) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 10 Jul 2008 14:26:38 +0000 X-IronPort-AV: E=Sophos;i="4.30,332,1212382800"; d="scan'208";a="368301445" Received: from unknown (HELO M31.equallogic.com) ([12.110.134.31]) by aussmtpmrkps320.us.dell.com with SMTP; 10 Jul 2008 09:26:37 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18550.7195.371436.629820@gargle.gargle.HOWL> Date: Thu, 10 Jul 2008 14:27:00 -0000 From: Paul Koning To: gdb@sourceware.org Subject: Symbol tables for separately linked pieces X-Mailer: VM 7.17 under 21.4 (patch 19) "Constant Variable" XEmacs Lucid X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-07/txt/msg00064.txt.bz2 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