From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6430 invoked by alias); 10 Sep 2012 12:52:31 -0000 Received: (qmail 6420 invoked by uid 22791); 10 Sep 2012 12:52:30 -0000 X-SWARE-Spam-Status: No, hits=-3.7 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,TW_BF 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; Mon, 10 Sep 2012 12:52:17 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1TB3TM-0003zE-Fg from Yao_Qi@mentor.com for gdb@sourceware.org; Mon, 10 Sep 2012 05:52:16 -0700 Received: from SVR-ORW-FEM-05.mgc.mentorg.com ([147.34.97.43]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Mon, 10 Sep 2012 05:52:16 -0700 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.1.289.1; Mon, 10 Sep 2012 05:52:15 -0700 Message-ID: <504DE251.1020702@codesourcery.com> Date: Mon, 10 Sep 2012 12:52: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: Subject: Symbol can't be found unless type 'tab' 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/msg00016.txt.bz2 Hi, I am trying to create a piece of fake dwarf information that a 8-byte variable 'i' occupies two registers, as below, and it seems right to me. Contents of the .debug_info section: Compilation Unit @ offset 0x0: Length: 0x34 (32-bit) Version: 2 Abbrev Offset: 0 Pointer Size: 4 <0>: Abbrev Number: 1 (DW_TAG_compile_unit) DW_AT_name : set-reg.c <16> DW_AT_producer : GNU C 3.3.3 <22> DW_AT_language : 2 (non-ANSI C) <1><23>: Abbrev Number: 2 (DW_TAG_base_type) <24> DW_AT_name : 8byte <2a> DW_AT_byte_size : 8 <2b> DW_AT_encoding : 7 (unsigned) <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) Contents of the .debug_loc section: Offset Begin End Expression 00000000 080483d5 080483e6 (DW_OP_reg2 (edx); DW_OP_piece: 4; DW_OP_reg3 (ebx); DW_OP_piece: 4) 00000000 However, the symbol 'i' can't be found unless I type 'tab' after command 'p'. (gdb) p i No symbol "i" in current context. (gdb) p // type 'tab' Display all 7422 possibilities? (y or n) // type 'n' (gdb) p/x i $2 = 0x45396ff4bfffeff4 Turning 'debug symtab-create' on tells me that 'tab' triggers creating symtab, and I think that is the reason 'i' can be found after typing 'tab'. What should I complete/add in my faked dwarf information so that symbol 'i' can be found directly when the executable is loaded? without typing 'tab' to resolve symbol 'i'. -- Yao