From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21670 invoked by alias); 3 Aug 2007 13:57:37 -0000 Received: (qmail 21660 invoked by uid 22791); 3 Aug 2007 13:57:36 -0000 X-Spam-Check-By: sourceware.org Received: from nwd2mail10.analog.com (HELO nwd2mail10.analog.com) (137.71.25.55) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 03 Aug 2007 13:57:32 +0000 Received: from nwd2mhb2.analog.com ([137.71.6.12]) by nwd2mail10.analog.com with ESMTP; 03 Aug 2007 09:57:29 -0400 X-IronPort-AV: i="4.19,217,1183348800"; d="scan'208"; a="47311828:sNHT26484591" Received: from nwd2exm4.ad.analog.com (nwd2exm4.ad.analog.com [10.64.53.123]) by nwd2mhb2.analog.com (8.9.3 (PHNE_28810+JAGae91741)/8.9.3) with ESMTP id JAA24312; Fri, 3 Aug 2007 09:57:32 -0400 (EDT) Received: from nwd2exm5.ad.analog.com ([10.64.51.20]) by nwd2exm4.ad.analog.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 3 Aug 2007 09:57:29 -0400 Received: from localhost ([10.64.204.110]) by nwd2exm5.ad.analog.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 3 Aug 2007 09:57:28 -0400 From: Robin Getz To: "Daniel Jacobowitz" Subject: Re: debugging something with multiple text sections in onecompilation unit Date: Fri, 03 Aug 2007 13:57:00 -0000 User-Agent: KMail/1.9.5 Cc: gdb@sourceware.org References: <200708030009.46899.rgetz@blackfin.uclinux.org> <20070803113743.GA16769@caradoc.them.org> In-Reply-To: <20070803113743.GA16769@caradoc.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200708031001.19652.rgetz@blackfin.uclinux.org> 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: 2007-08/txt/msg00023.txt.bz2 On Fri 3 Aug 2007 07:37, Daniel Jacobowitz pondered: > On Fri, Aug 03, 2007 at 12:09:46AM -0400, Robin Getz wrote: > > As far as we can tell - there seems to be a limitation in DWARF spec > > (or DWARF implementation of gcc/gdb) - there seems to be only only one > > single base address. All other addresses are an offset to that base > > in the same compilation unit. > > > > When we use l1_text attribute, we have two code segments in one > > compilation unit and the offset between them is determined only when > > it's loaded. So one segment cannot get symbol addresses computed > > correctly - and we can not set breakpoints in functions that are > > in L1, and debugging applications is pretty difficult. > > There is no requirement to use a single base address in DWARF, or in > GDB's implementation of it; just use .debug_aranges. GCC does the > right thing if you use __attribute__((section)). Thanks for the pointer - I will check to make sure the compiler is populating this properly (which it looks like it is). I found this discussion (after I knew what to search for) http://www.eagercon.com/dwarf/issues/001101-1.htm > You're supposed to tell GDB the section offsets, so that it can adjust > debug info appropriately. See add-symbol-file in the manual. There's > no way yet to do this automatically for a single section, though; only > by hand. I assume it should be "add-symbol-file -file filename -sl1_text address" Hmm... That stinks. Since gdb knows there are multiple discontinuous sections (via parsing .debug_aranges) why not just ask the kernel where the section was loaded? Or is it "it's possible, just not implemented" -Robin