Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH v2 0/1] gdb/dwarf: Use the function scope for DW_TAG_imported_declaration
@ 2026-05-04  8:34 Abdul Basit Ijaz
  2026-05-04  8:34 ` [PATCH v2 1/1] " Abdul Basit Ijaz
  0 siblings, 1 reply; 3+ messages in thread
From: Abdul Basit Ijaz @ 2026-05-04  8:34 UTC (permalink / raw)
  To: gdb-patches; +Cc: abdul.b.ijaz, tom

All Fortran imported variable aliases (`use module, alias => var`)
were being added to "global scope", regardless of whether they appeared
in:
- Program/module scope (should be global)
- Function scope (should be local)

This caused conflicts when different functions had the same alias name
pointing to different variables.

This patch modifies the case for DW_TAG_imported_declaration in the
function new_symbol () to use cu->list_in_scope instead of global
symbols for all languages.  This ensures that function-scoped aliases
use the current scope rather than being forced into the global scope.

Changes since V1:
- Fixes the feedback from Tom:
https://sourceware.org/pipermail/gdb-patches/2026-May/227098.html

Thanks & Best Regards,
Abdul Basit

Abdul Basit Ijaz (1):
  gdb/dwarf: Use the function scope for DW_TAG_imported_declaration

 gdb/dwarf2/read.c                             | 10 +++
 .../gdb.fortran/module_declarations.exp       | 62 +++++++++++++++++++
 .../gdb.fortran/module_declarations.f90       | 59 ++++++++++++++++++
 3 files changed, 131 insertions(+)
 create mode 100644 gdb/testsuite/gdb.fortran/module_declarations.exp
 create mode 100644 gdb/testsuite/gdb.fortran/module_declarations.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] 3+ messages in thread

end of thread, other threads:[~2026-05-05 14:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-04  8:34 [PATCH v2 0/1] gdb/dwarf: Use the function scope for DW_TAG_imported_declaration Abdul Basit Ijaz
2026-05-04  8:34 ` [PATCH v2 1/1] " Abdul Basit Ijaz
2026-05-05 14:23   ` Tom Tromey

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