From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 36349 invoked by alias); 17 May 2019 15:08:50 -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 36341 invoked by uid 89); 17 May 2019 15:08:50 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.3 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_STOCKGEN,SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1384 X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 17 May 2019 15:08:49 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 1E9BAAEF9; Fri, 17 May 2019 15:08:47 +0000 (UTC) Subject: [PING][PATCH][gdb/symtab] Support DW_AT_main_subprogram with -readnow. From: Tom de Vries To: gdb-patches@sourceware.org Cc: Tom Tromey References: <20190505102520.GA5031@delia> Message-ID: <3a5ffc45-84f5-3dae-8c64-285192938140@suse.de> Date: Fri, 17 May 2019 15:08:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <20190505102520.GA5031@delia> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2019-05/txt/msg00426.txt.bz2 On 05-05-19 12:25, Tom de Vries wrote: > Hi, > > DW_AT_main_subprogram is supported in normal mode in read_partial_die, but not > in -readnow mode. > > Fix this by adding support for DW_AT_main_subprogram in read_func_scope. > > Tested on x86_64-linux with native and RFC target board readnow ( > https://sourceware.org/ml/gdb-patches/2019-05/msg00073.html ). > > OK for trunk? > > Thanks, > - Tom > > [gdb/symtab] Support DW_AT_main_subprogram with -readnow. > > gdb/ChangeLog: > > 2019-05-05 Tom de Vries > > PR symtab/16264 > PR symtab/24517 > * dwarf2read.c (read_func_scope): Handle DW_AT_main_subprogram. > > --- > gdb/dwarf2read.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c > index b5ea9e3cc0..3e611b0842 100644 > --- a/gdb/dwarf2read.c > +++ b/gdb/dwarf2read.c > @@ -13741,6 +13741,10 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) > newobj->name = new_symbol (die, read_type_die (die, cu), cu, > (struct symbol *) templ_func); > > + if (dwarf2_flag_true_p (die, DW_AT_main_subprogram, cu)) > + set_objfile_main_name (objfile, SYMBOL_LINKAGE_NAME (newobj->name), > + cu->language); > + > /* If there is a location expression for DW_AT_frame_base, record > it. */ > attr = dwarf2_attr (die, DW_AT_frame_base, cu); >