From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28843 invoked by alias); 12 Sep 2012 07:45:44 -0000 Received: (qmail 28828 invoked by uid 22791); 12 Sep 2012 07:45:42 -0000 X-SWARE-Spam-Status: No, hits=-4.4 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 12 Sep 2012 07:45:28 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1TBhdW-0004nE-JO from Yao_Qi@mentor.com ; Wed, 12 Sep 2012 00:45:26 -0700 Received: from SVR-ORW-FEM-02.mgc.mentorg.com ([147.34.96.206]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Wed, 12 Sep 2012 00:45:26 -0700 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-02.mgc.mentorg.com (147.34.96.168) with Microsoft SMTP Server id 14.1.289.1; Wed, 12 Sep 2012 00:45:25 -0700 Message-ID: <50503D6C.6070704@codesourcery.com> Date: Wed, 12 Sep 2012 07:45:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20120717 Thunderbird/14.0 MIME-Version: 1.0 To: Jan Kratochvil CC: Subject: Re: Symbol can't be found unless type 'tab' References: <504DE251.1020702@codesourcery.com> <20120910131828.GA13062@host2.jankratochvil.net> In-Reply-To: <20120910131828.GA13062@host2.jankratochvil.net> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit 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: 2012-09/txt/msg00025.txt.bz2 On 09/10/2012 09:18 PM, Jan Kratochvil wrote: > On Mon, 10 Sep 2012 14:51:29 +0200, Yao Qi wrote: >> > <1><2c>: Abbrev Number: 3 (DW_TAG_variable) >> > <2d> DW_AT_name : i >> > <2f> DW_AT_type : <0x23> >> > <33> DW_AT_location : 0x0 (location list) > I guess because GDB does not like such complicated location expression for > glboal variables. Jan, thanks for the pointer. The "symptom" is symbol is not found in psymtab, but in symtab when I press 'tab' which triggers converting psymtab to symtab. I wonder why symbol 'i' is *not* included in psymtab. Examine the source of dwarf2read.c:add_partial_symbol, especially the case block for 'DW_TAG_variable', gives me some clue, and I add attribute DW_AT_external to symbol 'i' like this, <1><33>: Abbrev Number: 3 (DW_TAG_variable) <34> DW_AT_name : i <36> DW_AT_type : <0x2a> <3a> DW_AT_external : 1 <--- here <3b> DW_AT_location : 0x0 (location list) and then symbol 'i' can be found by GDB without typing extra 'tab'. -- Yao