From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21504 invoked by alias); 3 Aug 2007 11:37:53 -0000 Received: (qmail 21496 invoked by uid 22791); 3 Aug 2007 11:37:52 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 03 Aug 2007 11:37:47 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id B54D598123; Fri, 3 Aug 2007 11:37:46 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 3CDD498122; Fri, 3 Aug 2007 11:37:45 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.67) (envelope-from ) id 1IGvTT-0004N1-CU; Fri, 03 Aug 2007 07:37:43 -0400 Date: Fri, 03 Aug 2007 11:37:00 -0000 From: Daniel Jacobowitz To: Robin Getz Cc: gdb@sourceware.org Subject: Re: debugging something with multiple text sections in one compilation unit Message-ID: <20070803113743.GA16769@caradoc.them.org> Mail-Followup-To: Robin Getz , gdb@sourceware.org References: <200708030009.46899.rgetz@blackfin.uclinux.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200708030009.46899.rgetz@blackfin.uclinux.org> User-Agent: Mutt/1.5.15 (2007-04-09) 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/msg00019.txt.bz2 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)). 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. -- Daniel Jacobowitz CodeSourcery