[v3,0/2] Improve handling of using directives

Message ID 20221122113319.1760546-1-blarsen@redhat.com
Headers
Series Improve handling of using directives |

Message

Bruno Larsen Nov. 22, 2022, 11:33 a.m. UTC
  This series tries to fix two of the main issues I saw when trying to get
gdb.cp/nsusing.exp working with clang. The first issue was that GDB
wouldn't care about when the 'using' directive happened in the code,
even if we were stopped before it, it was considered valid. The second
was that GDB would find the first reasonable variable in the imported
declarations and leave early, not caring about whether that variable was
ambiguous or not. Each of my patches fixes one of those issues.

Changelog for v3:
 * changed map key to use std::string, so we get an ordered output.
 * Improved documentation on some spots
 * Fix bug where gdb could return a partial list of the ambiguous symbols

Changelog for v2:
 * factored out some code to avoid unnecessary repetition.
 * made it so ambiguous variables are explicitly reported
 * fixed formatting issues.

Bruno Larsen (2):
  gdb/c++: validate 'using' directives based on the current line
  gdb/c++: Detect ambiguous variables in imported namespaces

 gdb/cp-namespace.c               | 99 ++++++++++++++++++++++++--------
 gdb/dwarf2/read.c                | 30 +++++++++-
 gdb/namespace.c                  | 25 ++++++++
 gdb/namespace.h                  | 16 +++++-
 gdb/testsuite/gdb.cp/nsusing.cc  |  3 +-
 gdb/testsuite/gdb.cp/nsusing.exp | 25 +++++++-
 6 files changed, 167 insertions(+), 31 deletions(-)
  

Comments

Bruno Larsen Dec. 7, 2022, 1:53 p.m. UTC | #1
Ping!