From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2923 invoked by alias); 25 Jul 2003 22:42:39 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 2909 invoked from network); 25 Jul 2003 22:42:36 -0000 Received: from unknown (HELO gw-nl5.philips.com) (212.153.235.109) by sources.redhat.com with SMTP; 25 Jul 2003 22:42:36 -0000 Received: from smtpscan-nl3.philips.com (smtpscan-nl3.philips.com [130.139.36.23]) by gw-nl5.philips.com (Postfix) with ESMTP id 8621B54BD2 for ; Fri, 25 Jul 2003 22:34:17 +0200 (MET DST) Received: from smtpscan-nl3.philips.com (localhost [127.0.0.1]) by localhost.philips.com (Postfix) with ESMTP id 22C5B19C48 for ; Fri, 25 Jul 2003 22:34:17 +0200 (MEST) Received: from smtprelay-nl2.philips.com (smtprelay-eur2.philips.com [130.139.36.35]) by smtpscan-nl3.philips.com (Postfix) with ESMTP id CAFC519C46 for ; Fri, 25 Jul 2003 22:34:16 +0200 (MEST) Received: from hbg001soh.diamond.philips.com (e1soh01.diamond.philips.com [130.143.165.45]) by smtprelay-nl2.philips.com (8.9.3-p1/8.8.5-1.2.2m-19990317) with ESMTP id WAA11493 for ; Fri, 25 Jul 2003 22:34:16 +0200 (MEST) From: daniel.van.gerpen@philips.com To: gdb@sources.redhat.com Subject: dwarfread / multiple compilation units MIME-Version: 1.0 Message-ID: Date: Fri, 25 Jul 2003 22:42:00 -0000 Content-Type: text/plain; charset="us-ascii" X-SW-Source: 2003-07/txt/msg00307.txt.bz2 Hi, I stumbled onto several problems using the Gnu Debugger 5.3 with code from the Diab Compiler 4.4b. One problem is the following: The compiler option -Xsplit-section creates a separate section for each function to allow the linker to remove it during linking when it is not used. The option also splits the debug information for types into different compilation units: compilation unit A [...] 00A14E46: TAG_typedef | AT_sibling ref(0x00A14E67) | AT_name "Cfoo" | AT_user_def_type ref(0x00A14E67) 00A14E67: TAG_class_type [...] compilation unit B 00A160DE: TAG_compile_unit | AT_sibling ref(0x00A16397) | AT_name "../SRC/main.cpp" | AT_low_pc adr(0x41EF5140) | AT_high_pc adr(0x41EF52E8) | AT_producer "Diab Data, Inc:dplus Rel 4.4b:PPC860" | AT_language LANG_C_PLUS_PLUS | AT_comp_dir | AT_stmt_list 00 05 7D A6 | AT_source_file_names 0x00007734 | AT_source_info 0x00012EF0 | AT_main_unit ref(0x00A08C6A) 00A1618D: TAG_global_subroutine | AT_sibling ref(0x00A16393) | AT_name "bar" [...] 00A161EB: TAG_lexical_block | AT_sibling ref(0x00A16231) | AT_low_pc adr(0x41EF51E4) | AT_high_pc adr(0x41EF5204) 00A16203: TAG_local_variable | AT_sibling ref(0x00A1622D) | AT_name "foo" | AT_user_def_type ref(0x00A14E46) /* reference into compilation unit A */ [...] In dwarfread.c the function lookup_utype() now complains about a bad die reference, because read_ofile_symtab() only reads the dies from one compilation unit (unit B). The result is that gdb only shows the variable "foo" to be of type "int" instead of type "Cfoo". Maybe someone already has a patch for this? If not, what would be an appropriate solution? I have been pondering about a possible fix. To read all dies from all compilation units could be a problem for code with a huge amount of debug information. A better way would be to reload the missing information when it is needed. But I am not sure how to load dies from other compilation units for example in lookup_utype(). Daniel van Gerpen