From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17223 invoked by alias); 1 Jun 2007 12:20:58 -0000 Received: (qmail 17208 invoked by uid 22791); 1 Jun 2007 12:20:57 -0000 X-Spam-Check-By: sourceware.org Received: from mx.qwghlm.org (HELO mx.qwghlm.org) (212.69.37.249) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 01 Jun 2007 12:20:52 +0000 Received: from mwk by mx.qwghlm.org with local (Exim 3.36 #1 (Debian)) id 1Hu67d-0008TF-00 for ; Fri, 01 Jun 2007 13:20:49 +0100 Date: Fri, 01 Jun 2007 12:20:00 -0000 From: Matt Kern To: gdb@sourceware.org Subject: DWARF2 FDE Address Mismatch Message-ID: <20070601122049.GA32523@pling.qwghlm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.9i 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/msg00006.txt.bz2 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? Regards, Matt -- Matt Kern http://www.undue.org/