[v2,0/2,gdb/exp] Fix ignoring of incorrect namespace prefix

Message ID 20260408070211.124957-1-tdevries@suse.de
Headers
Series Fix ignoring of incorrect namespace prefix |

Message

Tom de Vries April 8, 2026, 7:02 a.m. UTC
  Hafiz Abid Qadeer reported a problem with namespace handling using a Fortran
program [1].  I wrote an equivalent program in C++, and reproduced the
reported problem with both.  While investigating the problem, I ran into
another problem, for which I filed PR34051.

This series contains two patches.

The first patch refactors a complex assignment in
cp_lookup_symbol_via_imports.

The second patch fixes PR34051, in that same assignment.

Tested on aarch64-linux.

A v1 was submitted here [2].

New in v2:
- updated type of directive_match to bool

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34051

[1] https://sourceware.org/bugzilla/show_bug.cgi?id=34034
[2] v1 https://sourceware.org/pipermail/gdb-patches/2026-April/226370.html

Tom de Vries (2):
  [gdb] Break up complex assignment in cp_lookup_symbol_via_imports
  [gdb/exp] Fix ignoring of incorrect namespace prefix

 gdb/cp-namespace.c                 | 28 ++++++++---
 gdb/testsuite/gdb.cp/nsusing-2.cc  | 39 ++++++++++++++++
 gdb/testsuite/gdb.cp/nsusing-2.exp | 75 ++++++++++++++++++++++++++++++
 3 files changed, 135 insertions(+), 7 deletions(-)
 create mode 100644 gdb/testsuite/gdb.cp/nsusing-2.cc
 create mode 100644 gdb/testsuite/gdb.cp/nsusing-2.exp


base-commit: 2db79d8000d40451b313ad6c3b6c029bcf82e643