From patchwork Fri Mar 9 21:16:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 26259 Received: (qmail 27424 invoked by alias); 9 Mar 2018 21:16:18 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 27382 invoked by uid 89); 9 Mar 2018 21:16:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-22.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, KAM_STOCKGEN, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 09 Mar 2018 21:16:15 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 732B1EBFF4 for ; Fri, 9 Mar 2018 21:16:14 +0000 (UTC) Received: from localhost.localdomain (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 19CC02026DFD for ; Fri, 9 Mar 2018 21:16:13 +0000 (UTC) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 01/11] eval.c: reverse minsym and sym Date: Fri, 9 Mar 2018 21:16:02 +0000 Message-Id: <20180309211612.12941-2-palves@redhat.com> In-Reply-To: <20180309211612.12941-1-palves@redhat.com> References: <20180309211612.12941-1-palves@redhat.com> I noticed that in evaluate_funcall, where we handle OP_VAR_MSYM_VALUE/OP_VAR_VALUE to figure out the symbol's name gets the minimal_symbol/symbol backwards. Happens to be harmless in practice because the symbol name is recorded in the common initial sequence (in the general_symbol_info field). gdb/ChangeLog: yyyy-mm-dd Pedro Alves * eval.c (evaluate_funcall): Swap OP_VAR_MSYM_VALUE/OP_VAR_VALUE if then/else bodies in var_func_name extraction. --- gdb/eval.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gdb/eval.c b/gdb/eval.c index 4899011a58f..a50299cbfdb 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -1046,13 +1046,13 @@ evaluate_funcall (type *expect_type, expression *exp, int *pos, { if (op == OP_VAR_MSYM_VALUE) { - symbol *sym = exp->elts[*pos + 2].symbol; - var_func_name = SYMBOL_PRINT_NAME (sym); + minimal_symbol *msym = exp->elts[*pos + 2].msymbol; + var_func_name = MSYMBOL_PRINT_NAME (msym); } else if (op == OP_VAR_VALUE) { - minimal_symbol *msym = exp->elts[*pos + 2].msymbol; - var_func_name = MSYMBOL_PRINT_NAME (msym); + symbol *sym = exp->elts[*pos + 2].symbol; + var_func_name = SYMBOL_PRINT_NAME (sym); } argvec[0] = evaluate_subexp_with_coercion (exp, pos, noside);