From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id lYaqA66D82l0jgYAWB0awg (envelope-from ) for ; Thu, 30 Apr 2026 12:30:38 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=lYAlrEq3; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id E5BE11E067; Thu, 30 Apr 2026 12:30:37 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H2,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 9B2EA1E067 for ; Thu, 30 Apr 2026 12:30:36 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 55517436A067 for ; Thu, 30 Apr 2026 16:30:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 55517436A067 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=lYAlrEq3 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) by sourceware.org (Postfix) with ESMTPS id BC7EB4371D44 for ; Thu, 30 Apr 2026 16:30:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BC7EB4371D44 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 BC7EB4371D44 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=192.198.163.9 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777566610; cv=none; b=qJI76OS6IR8JKraof51pzkMfA3UG9lUzmj8sTBdIw+WwxKutKKBXaW0/z1UfzRY8qemL1dWGzsur73yVDkE5ydJu9MmCv0ScoWs4x+dTVciEm0pvU33/ZFg131cDlqjM6gSvomTJwGyWON7ikhcN6WQrHddRBq2PfaqJ6I6EjTE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777566610; c=relaxed/simple; bh=XUq0Go6YZAKeSxym5ccvdWgS4uBE7VqL4sHnOfkA0NI=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=t31BCEcB9J8tWg6zIGV8U9pkwCuFirVj69v8/xG8tk7GbiVEQUy3uauW+9isJOA5qJYbefGR+3xj6E7+eIOUqHbq2rF49w0ZssEAlDkZx9dzzNqNudn8H1cfQB5o6cshdWspE3IxMr+ggNDlVysVP8Py5SzTiImVRBHlnlcBGaY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BC7EB4371D44 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1777566610; x=1809102610; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=XUq0Go6YZAKeSxym5ccvdWgS4uBE7VqL4sHnOfkA0NI=; b=lYAlrEq3UWO/xpV2G3O9dnrSKC7RENzUmz8MPDSl4fnjKLhYIAv1vrJb Fhlk1/NpsNpJRaHoF5N9dgb8mPGHclS7rUucauAi4tMkqRDa48nmTlYg3 4RRwAiMVTNwsoJ3Ih5s8y4/vwHobDM4qXbOHfn7YcnjcjKCuM1qTAGmx5 paso+/NgYunT1B42G0GsaFuLyOuCjz81tNWD/wPNVGzL2AX2d3tul62cZ 8v1JRh+Dwg+eLzWHsI084JACVh+gJh7fGkTjkx/bqGEaHHvKqq3wN2nVl CZgkh2ivXclN0KZpeCN/yiuRNguOKPh/qOGX80KVxA7+kAVrKiov/PAaD g==; X-CSE-ConnectionGUID: cVHgCrclT8icQOKvYO7Njg== X-CSE-MsgGUID: BGg0GpWRQ/ymrzOgHd6TIg== X-IronPort-AV: E=McAfee;i="6800,10657,11772"; a="89216506" X-IronPort-AV: E=Sophos;i="6.23,208,1770624000"; d="scan'208";a="89216506" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Apr 2026 09:30:09 -0700 X-CSE-ConnectionGUID: 6bAJQb8GS96jxdBJrYssFw== X-CSE-MsgGUID: wirDnp73RgaZcRqVFkoRbA== X-ExtLoop1: 1 Received: from unknown (HELO localhost) ([10.245.116.136]) by fmviesa003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Apr 2026 09:30:07 -0700 From: Abdul Basit Ijaz To: gdb-patches@sourceware.org Cc: abdul.b.ijaz@intel.com, tom@tromey.com, kevinb@redhat.com Subject: [PATCH v2 0/1] gdb, fortran: Fix local variable lookup in Fortran parser Date: Thu, 30 Apr 2026 18:29:54 +0200 Message-Id: <20260430162955.295647-1-abdul.b.ijaz@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 This change fixes https://sourceware.org/bugzilla/show_bug.cgi?id=34059. The Fortran expression parser in GDB ("gdb/f-exp.y") previously performed symbol lookup in this order when parsing identifiers: - SEARCH_STRUCT_DOMAIN (types/structs) - SEARCH_VFT ("C-like" name lookups for variables/types/functions) - SEARCH_MODULE_DOMAIN (modules) It searched for "types before variables", causing type names from shared libraries to shadow local variable names. This issue is fixed in the Fortran expression parser in GDB ("gdb/f-exp.y") by prioritizing SEARCH_VFT over other search domains during symbol lookup. Changes since V1: - Fix this feedback from Kevin: https://sourceware.org/pipermail/gdb-patches/2026-April/227028.html Thanks & Best Regards, Abdul Basit Abdul Basit Ijaz (1): gdb, fortran: Fix local variable lookup in Fortran parser gdb/f-exp.y | 2 +- .../gdb.fortran/var-type-precedence-lib.c | 30 ++++++++++ .../gdb.fortran/var-type-precedence.exp | 60 +++++++++++++++++++ .../gdb.fortran/var-type-precedence.f90 | 40 +++++++++++++ 4 files changed, 131 insertions(+), 1 deletion(-) create mode 100644 gdb/testsuite/gdb.fortran/var-type-precedence-lib.c create mode 100644 gdb/testsuite/gdb.fortran/var-type-precedence.exp create mode 100644 gdb/testsuite/gdb.fortran/var-type-precedence.f90 -- 2.34.1 Intel Deutschland GmbH Registered Address: Dornacher Strasse 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 Muenchen HRB 186928