Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH v2 0/1] gdb, fortran: Fix local variable lookup in Fortran parser
@ 2026-04-30 16:29 Abdul Basit Ijaz
  2026-04-30 16:29 ` [PATCH v2 1/1] " Abdul Basit Ijaz
  0 siblings, 1 reply; 4+ messages in thread
From: Abdul Basit Ijaz @ 2026-04-30 16:29 UTC (permalink / raw)
  To: gdb-patches; +Cc: abdul.b.ijaz, tom, kevinb

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-05-04  7:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-04-30 16:29 [PATCH v2 0/1] gdb, fortran: Fix local variable lookup in Fortran parser Abdul Basit Ijaz
2026-04-30 16:29 ` [PATCH v2 1/1] " Abdul Basit Ijaz
2026-05-01 17:47   ` Kevin Buettner
2026-05-04  7:05     ` Ijaz, Abdul B

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox