From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31607 invoked by alias); 24 Oct 2013 06:59:51 -0000 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 Received: (qmail 31595 invoked by uid 89); 24 Oct 2013 06:59:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-vc0-f180.google.com Received: from mail-vc0-f180.google.com (HELO mail-vc0-f180.google.com) (209.85.220.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 24 Oct 2013 06:59:49 +0000 Received: by mail-vc0-f180.google.com with SMTP id lc6so1053644vcb.39 for ; Wed, 23 Oct 2013 23:59:47 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.220.58.1 with SMTP id e1mr672997vch.0.1382597986927; Wed, 23 Oct 2013 23:59:46 -0700 (PDT) Received: by 10.220.245.196 with HTTP; Wed, 23 Oct 2013 23:59:46 -0700 (PDT) Date: Thu, 24 Oct 2013 06:59:00 -0000 Message-ID: Subject: [PATCH]Add symbol whose field 'has_type' has been set to partial symbol table From: hex To: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 X-SW-Source: 2013-10/txt/msg00747.txt.bz2 This patch intends to add symbol whose field 'has_type' has been set to partial symbol table. e.g. // test.c const int var = 3; // Then compile it with `gcc -g -c test.c`(For the lastest GCC, we need use 'gcc -g -O1 -c test.' to get the following DIE) We could see the DIE of 'var' is as following: <1><25>: Abbrev Number: 2 (DW_TAG_variable) <26> DW_AT_name : var <2a> DW_AT_decl_file : 1 <2b> DW_AT_decl_line : 1 <2c> DW_AT_type : <0x31> <30> DW_AT_const_value : 3 Latest GDB will not add it to partial symbol table because its symbol satisfies 'pdi->d.locdesc == NULL'. I think we need add it to partial symbol table. 2013-10-24 Jun Gong * dwarf2read.c(add_partial_symbol): Add symbol whose field 'has_type' has been set to partial symbol table. --- gdb-7.6.50.20131021.orig/gdb/dwarf2read.c 2013-10-16 10:55:27.000000000 +0800 +++ gdb-7.6.50.20131021/gdb/dwarf2read.c 2013-10-24 14:29:18.737067814 +0800 @@ -6733,8 +6733,9 @@ add_partial_symbol (struct partial_die_i } else { - /* Static Variable. Skip symbols without location descriptors. */ - if (pdi->d.locdesc == NULL) + /* Static Variable. Skip symbols without location descriptors or + has_type not set. */ + if (pdi->d.locdesc == NULL && pdi->has_type == 0) { xfree (built_actual_name); return;