From 5fea97943259a2bd997f92ffa66116b5c0d4eaab Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Thu, 22 Sep 2022 08:43:47 -0600 Subject: Improve Ada support in .gdb_index The cooked index work changed how .gdb_index is constructed, and in the process broke .gdb_index support. This is PR symtab/29179. This patch partially fixes the problem. It arranges for Ada names to be encoded in the form expected by the index code. In particular, linkage names for Ada are emitted, including the "main" name; names are Ada-encoded; and names are no longer case-folded, something that prevented operator names from round-tripping correctly. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29179 --- gdb/ada-lang.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'gdb/ada-lang.c') diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 1f26394..adacf1d 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -1146,12 +1146,14 @@ ada_fold_name (gdb::string_view name, bool throw_on_error = false) return fold_storage.c_str (); } -/* The "encoded" form of DECODED, according to GNAT conventions. */ +/* The "encoded" form of DECODED, according to GNAT conventions. If + FOLD is true (the default), case-fold any ordinary symbol. Symbols + with <...> quoting are not folded in any case. */ std::string -ada_encode (const char *decoded) +ada_encode (const char *decoded, bool fold) { - if (decoded[0] != '<') + if (fold && decoded[0] != '<') decoded = ada_fold_name (decoded); return ada_encode_1 (decoded, true); } -- cgit v1.1