From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id qQC4Jj4sc2neDhEAWB0awg (envelope-from ) for ; Fri, 23 Jan 2026 03:07:26 -0500 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=DBUz/DJq; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 995031E08D; Fri, 23 Jan 2026 03:07:26 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 2316C1E08D for ; Fri, 23 Jan 2026 03:07:26 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id AE3B54BBCDDD for ; Fri, 23 Jan 2026 08:07:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AE3B54BBCDDD Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=DBUz/DJq Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) by sourceware.org (Postfix) with ESMTPS id 61A714BA540B for ; Fri, 23 Jan 2026 08:06:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 61A714BA540B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 61A714BA540B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=192.198.163.18 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1769155564; cv=none; b=XpXTJS4zYKL6pxmLuldr3oun4hYgH6t8svMm2EiWOhYQQrsAJiA7OqKdynmDwxoob16F+QkeKc9Yz4n52G3BPOdqi3T6CEsXTqUmm4Q3UJ5NwguEZph5NTcHRtltRXQ1llbOgloInf3V12HbbEmEUHRyEh/hNqr72bJrCT8m5O0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1769155564; c=relaxed/simple; bh=Jzhpsl/+dtgryxOAIUcMvwl5t7mh9GdZCK29NRmFNmI=; h=DKIM-Signature:MIME-Version:From:To:Subject:Date:Message-Id: MIME-Version; b=HPrnn/5vH7YcjGJQfl7DLlqoL8yT/ZZPj8FLXAcXbPLXTLNUE0naF08P3VUgXP2hezksJxucd46QDIZ9Jy4IVfcqNKQnThMWTpay1cN/vHhOdipaZn5a2MDBSNJB/p2E5tMGCstZhY1JGqS8kDBzPlHy2IfmtLZGE5vfywY6PgQ= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1769155564; x=1800691564; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=Jzhpsl/+dtgryxOAIUcMvwl5t7mh9GdZCK29NRmFNmI=; b=DBUz/DJq+IiUN0i9Aai3EkLPp7MN5l7mcz5ALcbP4vrGrGar8WoLuV7V 4dSuHZgCt0SgNAhj2DcQ8Y7J9r7/klwXuDIaPUYuqLGQS20DxaVxgmHVE NoetEtpZ28Vxp1wgssANZ/3X1fJ5QyCRdVpnNBuG/KH6ucBvYzwc7ItHE XDxJxtbvstVJqqAbamgBRUptcI3u/wCDygMA5g2sM/rR/U7M0PKsMUWdV hokF2gqchg6dMbTRwQdiyKTKl9LMXub1F1b0B7bDnd0M7eTi4I5Eh/EYL 9EtdZnsvageN8p1IofJ7Jv3Aw3Es6F00egRifL2P6O3xIEA69RncfREjf g==; X-CSE-ConnectionGUID: E+JM6jt2SmaUvmZvmSGL8w== X-CSE-MsgGUID: 6QCiR7HdTqSOCO6U1A4+6Q== X-IronPort-AV: E=McAfee;i="6800,10657,11679"; a="69603056" X-IronPort-AV: E=Sophos;i="6.21,248,1763452800"; d="scan'208";a="69603056" Content-Type: multipart/mixed; boundary="===============5302949247298530459==" MIME-Version: 1.0 Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jan 2026 00:06:04 -0800 X-CSE-ConnectionGUID: roOX5uacRE+p1/QY/TBnOw== X-CSE-MsgGUID: pkj5ZmCeRMmzBSUZ3OO6WA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,248,1763452800"; d="scan'208";a="206785337" Received: from gkldtt-dev-004.igk.intel.com (HELO localhost) ([10.123.221.202]) by orviesa009-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jan 2026 00:06:03 -0800 From: Christina Schimpe To: gdb-patches@sourceware.org Cc: thiago.bauermann@linaro.org Subject: [PATCH v2 4/9] gdb: Refactor 'find_symbol_funname' and 'info_frame_command_core' in stack.c. Date: Fri, 23 Jan 2026 08:05:26 +0000 Message-Id: <20260123080532.878738-5-christina.schimpe@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260123080532.878738-1-christina.schimpe@intel.com> References: <20260123080532.878738-1-christina.schimpe@intel.com> MIME-Version: 1.0 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org --===============5302949247298530459== Content-Transfer-Encoding: 8bit To avoid code duplication, create a new function 'stack.c:find_symbol_funname', which will be used in 'stack.c:find_frame_funname'. The function will also be used in a following commit. --- gdb/stack.c | 44 ++++++++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/gdb/stack.c b/gdb/stack.c index ffca1cb0865..805142b2f9b 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -1273,6 +1273,33 @@ get_last_displayed_sal () return sal; } +/* Find the function name for the symbol SYM. */ + +static gdb::unique_xmalloc_ptr +find_symbol_funname (const symbol *sym) +{ + gdb::unique_xmalloc_ptr funname; + const char *print_name = sym->print_name (); + + if (sym->language () == language_cplus) + { + /* It seems appropriate to use print_name () here, + to display the demangled name that we already have + stored in the symbol table, but we stored a version + with DMGL_PARAMS turned on, and here we don't want to + display parameters. So remove the parameters. */ + funname = cp_remove_params (print_name); + } + + if (funname == nullptr) + { + /* If we didn't hit the C++ case above, set *funname here. */ + funname = make_unique_xstrdup (print_name); + } + + return funname; +} + /* Attempt to obtain the name, FUNLANG and optionally FUNCP of the function corresponding to FRAME. */ @@ -1291,25 +1318,10 @@ find_frame_funname (const frame_info_ptr &frame, enum language *funlang, func = get_frame_function (frame); if (func) { - const char *print_name = func->print_name (); - *funlang = func->language (); if (funcp) *funcp = func; - if (*funlang == language_cplus) - { - /* It seems appropriate to use print_name() here, - to display the demangled name that we already have - stored in the symbol table, but we stored a version - with DMGL_PARAMS turned on, and here we don't want to - display parameters. So remove the parameters. */ - funname = cp_remove_params (print_name); - } - - /* If we didn't hit the C++ case above, set *funname - here. */ - if (funname == NULL) - funname = make_unique_xstrdup (print_name); + funname = find_symbol_funname (func); } else { -- 2.34.1 --===============5302949247298530459== Content-Type: multipart/alternative; boundary="===============6407340648868984410==" MIME-Version: 1.0 Content-Disposition: inline --===============6407340648868984410== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Intel Deutschland GmbH Registered Address: Dornacher Stra=C3=9Fe 1, 85622 Feldkirchen, Germany Tel: +49 89 991 430, www.intel.de Managing Directors: Harry Demas, Jeffrey Schneiderman, Yin Chong Sorrell Chairperson of the Supervisory Board: Nicole Lau Registered Seat: Munich Commercial Register: Amtsgericht M=C3=BCnchen HRB 186928 --===============6407340648868984410== Content-Type: text/html; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable
Intel Deutschland GmbH
Registered Address: Dornacher Stra=C3= =9Fe 1, 85622 Feldkirchen, Germany
Tel: +49 89 991 430, www.intel.deManaging Directors: Harry Demas, Jeffrey Schneiderman, Yin Chong Sorrell<= div>Chairperson of the Supervisory Board: Nicole Lau
Registered Seat: M= unich
Commercial Register: Amtsgericht M=C3=BCnchen HRB 186928 --===============6407340648868984410==-- --===============5302949247298530459==--