From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13874 invoked by alias); 23 Mar 2010 21:35:43 -0000 Received: (qmail 13865 invoked by uid 22791); 23 Mar 2010 21:35:42 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER X-Spam-Check-By: sourceware.org Received: from mtagate4.de.ibm.com (HELO mtagate4.de.ibm.com) (195.212.17.164) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 23 Mar 2010 21:35:37 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate4.de.ibm.com (8.13.1/8.13.1) with ESMTP id o2NLZXwv029552 for ; Tue, 23 Mar 2010 21:35:33 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o2NLZXhj1687578 for ; Tue, 23 Mar 2010 22:35:33 +0100 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id o2NLZXiP002784 for ; Tue, 23 Mar 2010 22:35:33 +0100 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id o2NLZWXB002778; Tue, 23 Mar 2010 22:35:32 +0100 Message-Id: <201003232135.o2NLZWXB002778@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Tue, 23 Mar 2010 22:35:32 +0100 Subject: Re: [patch] Add support for imported declaration and correct search order To: swagiaal@redhat.com (Sami Wagiaalla) Date: Tue, 23 Mar 2010 21:35:00 -0000 From: "Ulrich Weigand" Cc: tromey@redhat.com (Tom Tromey), gdb-patches@sourceware.org In-Reply-To: <4BA92962.6050206@redhat.com> from "Sami Wagiaalla" at Mar 23, 2010 04:49:38 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-03/txt/msg00800.txt.bz2 Sami Wagiaalla wrote: > On 03/23/2010 04:31 PM, Ulrich Weigand wrote: > > This test is now failing for me: > > > > print x > > $5 = 55 > > (gdb) FAIL: gdb.cp/shadow.exp: Print imported namespace x > > > > (Same value as with GDB 7.1, except the test was KFAILed there ...) > > > > I can try to reproduce it. Which compiler are you using ? GCC 4.1 (the RHEL 5.4 system compiler). > > Any suggestions where to look? > > > > In lookup_symbol_aux_local the call to cp_lookup_symbol_imports is > failing so the local variable in the outer block is being found. IIRC > the import statement was not nested correctly with older compilers so > that would be my first guess. That might well be the case. Here's the debug info I'm seeing: The section .debug_info contains: Compilation Unit @ offset 0x0: Length: 479 Version: 2 Abbrev Offset: 0 Pointer Size: 8 <0>: Abbrev Number: 1 (DW_TAG_compile_unit) DW_AT_stmt_list : 0 DW_AT_producer : GNU C++ 4.1.2 20080704 (Red Hat 4.1.2-46) DW_AT_language : 4 (C++) DW_AT_name : /home/uweigand/fsf/gdb-head/gdb/testsuite/gdb.cp/shadow.cc <1><76>: Abbrev Number: 2 (DW_TAG_class_type) DW_AT_sibling : DW_AT_name : B DW_AT_byte_size : 4 DW_AT_decl_file : 1 DW_AT_decl_line : 10 <2><80>: Abbrev Number: 3 (DW_TAG_member) DW_AT_name : x DW_AT_decl_file : 1 DW_AT_decl_line : 12 DW_AT_type : DW_AT_data_member_location: 2 byte block: 23 0 (DW_OP_plus_uconst: 0) <2><8c>: Abbrev Number: 4 (DW_TAG_subprogram) DW_AT_external : 1 DW_AT_name : func DW_AT_decl_file : 1 DW_AT_decl_line : 15 DW_AT_MIPS_linkage_name: _ZN1B4funcEv DW_AT_type : DW_AT_declaration : 1 <3>: Abbrev Number: 5 (DW_TAG_formal_parameter) DW_AT_type : DW_AT_artificial : 1 <3>: Abbrev Number: 6 (DW_TAG_imported_module) DW_AT_decl_file : 1 DW_AT_decl_line : 29 DW_AT_import : <3>: Abbrev Number: 7 (DW_TAG_imported_declaration) DW_AT_decl_file : 1 DW_AT_decl_line : 33 DW_AT_import : <1>: Abbrev Number: 8 (DW_TAG_base_type) DW_AT_name : int DW_AT_byte_size : 4 DW_AT_encoding : 5 (signed) <1>: Abbrev Number: 9 (DW_TAG_pointer_type) DW_AT_byte_size : 8 DW_AT_type : <76> <1>: Abbrev Number: 10 (DW_TAG_namespace) DW_AT_sibling : DW_AT_name : A DW_AT_decl_file : 1 DW_AT_decl_line : 2 <2>: Abbrev Number: 11 (DW_TAG_variable) DW_AT_name : x DW_AT_decl_file : 1 DW_AT_decl_line : 3 DW_AT_MIPS_linkage_name: (indirect string, offset: 0x0): _ZN1A1xE DW_AT_type : DW_AT_external : 1 DW_AT_declaration : 1 <2>: Abbrev Number: 11 (DW_TAG_variable) DW_AT_name : x DW_AT_decl_file : 1 DW_AT_decl_line : 3 DW_AT_MIPS_linkage_name: (indirect string, offset: 0x0): _ZN1A1xE DW_AT_type : DW_AT_external : 1 DW_AT_declaration : 1 <1>: Abbrev Number: 12 (DW_TAG_subprogram) DW_AT_sibling : <15a> DW_AT_specification: <8c> DW_AT_low_pc : 0x10000620 DW_AT_high_pc : 0x100006f0 DW_AT_frame_base : 0 (location list) <2><10f>: Abbrev Number: 13 (DW_TAG_formal_parameter) DW_AT_name : this DW_AT_type : <15a> DW_AT_artificial : 1 DW_AT_location : 2 byte block: 91 30 (DW_OP_fbreg: 48) <2><11d>: Abbrev Number: 14 (DW_TAG_lexical_block) DW_AT_low_pc : 0x10000658 DW_AT_high_pc : 0x100006d8 <3><12e>: Abbrev Number: 15 (DW_TAG_variable) DW_AT_name : x DW_AT_decl_file : 1 DW_AT_decl_line : 21 DW_AT_type : DW_AT_location : 2 byte block: 91 64 (DW_OP_fbreg: -28) <3><13a>: Abbrev Number: 14 (DW_TAG_lexical_block) DW_AT_low_pc : 0x1000067c DW_AT_high_pc : 0x100006d8 <4><14b>: Abbrev Number: 15 (DW_TAG_variable) DW_AT_name : x DW_AT_decl_file : 1 DW_AT_decl_line : 25 DW_AT_type : DW_AT_location : 2 byte block: 91 60 (DW_OP_fbreg: -32) <1><15a>: Abbrev Number: 16 (DW_TAG_const_type) DW_AT_type : <1><15f>: Abbrev Number: 17 (DW_TAG_subprogram) DW_AT_sibling : <194> DW_AT_external : 1 DW_AT_name : main DW_AT_decl_file : 1 DW_AT_decl_line : 43 DW_AT_type : DW_AT_low_pc : 0x100005d4 DW_AT_high_pc : 0x10000620 DW_AT_frame_base : 0x4d (location list) <2><184>: Abbrev Number: 15 (DW_TAG_variable) DW_AT_name : theB DW_AT_decl_file : 1 DW_AT_decl_line : 45 DW_AT_type : <76> DW_AT_location : 2 byte block: 91 60 (DW_OP_fbreg: -32) <1><194>: Abbrev Number: 10 (DW_TAG_namespace) DW_AT_sibling : <1b5> DW_AT_name : :: DW_AT_decl_file : 2 DW_AT_decl_line : 0 <2><19e>: Abbrev Number: 18 (DW_TAG_variable) DW_AT_name : x DW_AT_decl_file : 1 DW_AT_decl_line : 6 DW_AT_type : DW_AT_external : 1 DW_AT_declaration : 1 <2><1a9>: Abbrev Number: 18 (DW_TAG_variable) DW_AT_name : y DW_AT_decl_file : 1 DW_AT_decl_line : 7 DW_AT_type : DW_AT_external : 1 DW_AT_declaration : 1 <1><1b5>: Abbrev Number: 19 (DW_TAG_variable) DW_AT_specification: <19e> DW_AT_location : 9 byte block: 3 0 0 0 0 10 1 b 4 (DW_OP_addr: 10010b04) <1><1c4>: Abbrev Number: 19 (DW_TAG_variable) DW_AT_specification: <1a9> DW_AT_location : 9 byte block: 3 0 0 0 0 10 1 c 7c (DW_OP_addr: 10010c7c) <1><1d3>: Abbrev Number: 19 (DW_TAG_variable) DW_AT_specification: DW_AT_location : 9 byte block: 3 0 0 0 0 10 1 b 0 (DW_OP_addr: 10010b00) Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com