From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 59591 invoked by alias); 4 Jul 2019 05:03:09 -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 59581 invoked by uid 89); 4 Jul 2019 05:03:08 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-15.8 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_STOCKGEN,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 04 Jul 2019 05:03:07 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 45C9C81F13 for ; Thu, 4 Jul 2019 05:03:06 +0000 (UTC) Received: from f29-4.lan (ovpn-117-224.phx2.redhat.com [10.3.117.224]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 261BC86BA5 for ; Thu, 4 Jul 2019 05:03:06 +0000 (UTC) Date: Thu, 04 Jul 2019 05:03:00 -0000 From: Kevin Buettner To: gdb-patches@sourceware.org Subject: Re: [PATCH v2 1/5] Prefer symtab symbol over minsym for function names in non-contiguous blocks Message-ID: <20190703220305.0266c944@f29-4.lan> In-Reply-To: <20190704045503.1250-2-kevinb@redhat.com> References: <20190704045503.1250-1-kevinb@redhat.com> <20190704045503.1250-2-kevinb@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2019-07/txt/msg00087.txt.bz2 I find the diff easier to read when the -w switch is used. So here's just the patch using -w: diff --git a/gdb/stack.c b/gdb/stack.c index b3d113d3b4..e0a7403ec0 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -1134,46 +1134,6 @@ find_frame_funname (struct frame_info *frame, enum language *funlang, func = get_frame_function (frame); if (func) - { - /* In certain pathological cases, the symtabs give the wrong - function (when we are in the first function in a file which - is compiled without debugging symbols, the previous function - is compiled with debugging symbols, and the "foo.o" symbol - that is supposed to tell us where the file with debugging - symbols ends has been truncated by ar because it is longer - than 15 characters). This also occurs if the user uses asm() - to create a function but not stabs for it (in a file compiled - with -g). - - So look in the minimal symbol tables as well, and if it comes - up with a larger address for the function use that instead. - I don't think this can ever cause any problems; there - shouldn't be any minimal symbols in the middle of a function; - if this is ever changed many parts of GDB will need to be - changed (and we'll create a find_pc_minimal_function or some - such). */ - - struct bound_minimal_symbol msymbol; - - /* Don't attempt to do this for inlined functions, which do not - have a corresponding minimal symbol. */ - if (!block_inlined_p (SYMBOL_BLOCK_VALUE (func))) - msymbol - = lookup_minimal_symbol_by_pc (get_frame_address_in_block (frame)); - else - memset (&msymbol, 0, sizeof (msymbol)); - - if (msymbol.minsym != NULL - && (BMSYMBOL_VALUE_ADDRESS (msymbol) - > BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (func)))) - { - /* We also don't know anything about the function besides - its address and name. */ - func = 0; - funname.reset (xstrdup (MSYMBOL_PRINT_NAME (msymbol.minsym))); - *funlang = MSYMBOL_LANGUAGE (msymbol.minsym); - } - else { const char *print_name = SYMBOL_PRINT_NAME (func); @@ -1195,7 +1155,6 @@ find_frame_funname (struct frame_info *frame, enum language *funlang, if (funname == NULL) funname.reset (xstrdup (print_name)); } - } else { struct bound_minimal_symbol msymbol;