aboutsummaryrefslogtreecommitdiff
path: root/gdb/ada-lang.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2022-09-22 08:43:47 -0600
committerTom Tromey <tromey@adacore.com>2022-10-17 08:01:39 -0600
commit5fea97943259a2bd997f92ffa66116b5c0d4eaab (patch)
tree9092b5386d358ff88a47b7394083533cb64b50ab /gdb/ada-lang.c
parentacd121de32c3924347f228d8f27000a09b9c8949 (diff)
downloadbinutils-5fea97943259a2bd997f92ffa66116b5c0d4eaab.zip
binutils-5fea97943259a2bd997f92ffa66116b5c0d4eaab.tar.gz
binutils-5fea97943259a2bd997f92ffa66116b5c0d4eaab.tar.bz2
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
Diffstat (limited to 'gdb/ada-lang.c')
-rw-r--r--gdb/ada-lang.c8
1 files changed, 5 insertions, 3 deletions
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);
}