From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22673 invoked by alias); 1 Jun 2007 13:44:01 -0000 Received: (qmail 22664 invoked by uid 22791); 1 Jun 2007 13:44:00 -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, 01 Jun 2007 13:43:59 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 6F89E98219; Fri, 1 Jun 2007 13:43:57 +0000 (GMT) Received: from false.org (nc-76-4-218-255.dyn.embarqhsd.net [76.4.218.255]) by nan.false.org (Postfix) with ESMTP id 3B5FC98212; Fri, 1 Jun 2007 13:43:53 +0000 (GMT) Date: Fri, 01 Jun 2007 13:44:00 -0000 From: Daniel Jacobowitz To: Matt Kern Cc: gdb@sourceware.org Subject: Re: DWARF2 FDE Address Mismatch Message-ID: <20070601134355.GC2734@them.org> Mail-Followup-To: Matt Kern , gdb@sourceware.org References: <20070601122049.GA32523@pling.qwghlm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070601122049.GA32523@pling.qwghlm.org> User-Agent: Mutt/1.5.13 (2006-08-11) 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-06/txt/msg00010.txt.bz2 On Fri, Jun 01, 2007 at 01:20:49PM +0100, Matt Kern wrote: > I am in the process of porting a new MCU/processor to gcc/gdb. It has a > a Harvard architecture with a 24 bit code address space (word aligned > instructions) and a 16 bit data address space. Our toolchain emits ELF > binaries with code and data VMAs based at zero. The program loads as > though it is a ROM image located entirely in code space. > > The setup we have gone for involves having all pointers be 16 bits. > Code pointers actually address "trampolines" to the respective > functions. Our preferred debug format is DWARF2; we have therefore set > DWARF2_ADDR_SIZE to 4 in order to correctly represent our full range of > code addresses. Without this setting, addresses are stored as > POINTER_SIZE / BITS_PER_UNIT == 2 bytes. > > The output produced by gcc looks to be correct at this juncture. > However, we have problems loading the DWARF2 info in gdb. Most notably, > gdb defaults cie->encoding to DW_EH_PE_absptr (which is sizeof(void*) == > 2 bytes). The encoding can be changed by augmentation, but gcc only > emits this for EH data; DWARF2_ADDR_SIZE applies to non-EH data. > > In short it looks like GDB DWARF2 support lacks a mechanism to override > the address size (comparable to DWARF2_ADDR_SIZE in gcc). Is my > understanding correct? Yes, that looks true. Perhaps it should be using TARGET_ADDR_BIT instead. -- Daniel Jacobowitz CodeSourcery