From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29631 invoked by alias); 10 Jul 2008 14:58:10 -0000 Received: (qmail 29608 invoked by uid 22791); 10 Jul 2008 14:58:09 -0000 X-Spam-Check-By: sourceware.org Received: from s200aog11.obsmtp.com (HELO s200aog11.obsmtp.com) (207.126.144.125) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 10 Jul 2008 14:57:25 +0000 Received: from source ([167.4.1.35]) (using TLSv1) by eu1sys200aob011.postini.com ([207.126.147.11]) with SMTP; Thu, 10 Jul 2008 14:57:17 UTC Received: from zeta.dmz-us.st.com (ns4.st.com [167.4.80.115]) by beta.dmz-us.st.com (STMicroelectronics) with ESMTP id 32964DB20; Thu, 10 Jul 2008 14:57:17 +0000 (GMT) Received: from mail1.bri.st.com (mail1.bri.st.com [164.129.8.218]) by zeta.dmz-us.st.com (STMicroelectronics) with ESMTP id A199448D47; Thu, 10 Jul 2008 14:57:16 +0000 (GMT) Received: from [164.129.12.194] (bri0669.bri.st.com [164.129.12.194]) by mail1.bri.st.com (MOS 3.8.7a) with ESMTP id CKK30115 (AUTH stubbsa); Thu, 10 Jul 2008 15:56:00 +0100 (BST) Message-ID: <487622FE.8050209@st.com> Date: Thu, 10 Jul 2008 14:58:00 -0000 From: Andrew STUBBS User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: Paul Koning Cc: gdb@sourceware.org Subject: Re: Symbol tables for separately linked pieces References: <18550.7195.371436.629820@gargle.gargle.HOWL> In-Reply-To: <18550.7195.371436.629820@gargle.gargle.HOWL> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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/msg00065.txt.bz2 Paul Koning wrote: > 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. It's easy enough to switch between two sets of symbols using the symbol-file command: (gdb) symbol-file a.elf .... (gdb) symbol-file b.elf .... The symbol-file command throws away all previous symbols (including those from add-symbol-file), and loads new ones. This way there never are any duplicate symbols to get in the way. This solution is less satisfactory when the context change occurs frequently, so I've been wondering if there would be a better way to do it myself. Some sort of context sensitive thing maybe (select symbols from the same source as the current function symbol), or perhaps explicitly by name ("break a.elf:main"). Andrew