From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28509 invoked by alias); 5 May 2019 11:42:22 -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 28500 invoked by uid 89); 5 May 2019 11:42:22 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-15.5 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_1,SPF_PASS autolearn=ham version=3.3.1 spammy= 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; Sun, 05 May 2019 11:42:21 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 7C7DAAD4F; Sun, 5 May 2019 11:42:19 +0000 (UTC) Subject: [RFC] How to fix gdb.dwarf2/main-subprogram.exp with cc-with-gdb-index/cc-with-debug-names From: Tom de Vries To: gdb-patches@sourceware.org Cc: Tom Tromey , Pedro Alves , Simon Marchi References: <20190505102520.GA5031@delia> Message-ID: Date: Sun, 05 May 2019 11:42: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/msg00157.txt.bz2 [ was: Re: [PATCH][gdb/symtab] Support DW_AT_main_subprogram with -readnow. ] Hi, DW_AT_main_subprogram is supported in normal mode (in read_partial_die),and tested by test-case gdb.dwarf2/main-subprogram.exp. DW_AT_main_subprogram is currently not supported in -readnow mode, but I've submitted a fix for that (in read_func_scope). Still, the test-case gdb.dwarf2/main-subprogram.exp fails with executables that contain an index, either .gdb_index or .debug_names (which is exercised by target boards cc-with-gdb-index and cc-with-debug-names). I wonder whether and if so, how this should be fixed. ISTM that we want gdb to behave the same, functionality-wise, in normal mode, -readnow mode, and with an index. AFAIU, to fix this, then when loading an executable with index into gdb and issuing the start command, we'll need to read the debug info until finding the DW_AT_main_subprogram, but reading the debug info scanning just for one attribute seems rather inefficient to me. Any comments or advice here? Thanks, - Tom