aboutsummaryrefslogtreecommitdiff
path: root/gdb/ada-lang.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2022-03-15 09:03:14 -0600
committerTom Tromey <tromey@adacore.com>2022-04-04 12:28:31 -0600
commit81eaa5061095f972d48e8160a4f677bd3e6ace51 (patch)
tree7e10646f2c2844fa23f4467d3bfa812db88bc6e5 /gdb/ada-lang.c
parent59dfe8ad84c6a9ef17a1ba4a8f443ac3cb9f6fd5 (diff)
downloadgdb-81eaa5061095f972d48e8160a4f677bd3e6ace51.zip
gdb-81eaa5061095f972d48e8160a4f677bd3e6ace51.tar.gz
gdb-81eaa5061095f972d48e8160a4f677bd3e6ace51.tar.bz2
Handle ghost entities in symbol lookup
Normally, SPARK ghost entities are removed from the executable. However, with -gnata, they will be preserved. In this situation, it's handy to be able to inspect them. This patch allows this by removing the "___ghost_" prefix in the appropriate places.
Diffstat (limited to 'gdb/ada-lang.c')
-rw-r--r--gdb/ada-lang.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index a3a1a2b..f80ec5b 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -1323,6 +1323,11 @@ ada_decode (const char *encoded, bool wrap)
if we see this prefix. */
if (startswith (encoded, "_ada_"))
encoded += 5;
+ /* The "___ghost_" prefix is used for ghost entities. Normally
+ these aren't preserved but when they are, it's useful to see
+ them. */
+ if (startswith (encoded, "___ghost_"))
+ encoded += 9;
/* If the name starts with '_', then it is not a properly encoded
name, so do not attempt to decode it. Similarly, if the name
@@ -6016,6 +6021,9 @@ wild_match (const char *name, const char *patn)
const char *p;
const char *name0 = name;
+ if (startswith (name, "___ghost_"))
+ name += 9;
+
while (1)
{
const char *match = name;
@@ -13218,6 +13226,10 @@ do_full_match (const char *symbol_search_name,
if (startswith (symbol_search_name, "_ada_")
&& !startswith (lname, "_ada"))
symbol_search_name += 5;
+ /* Likewise for ghost entities. */
+ if (startswith (symbol_search_name, "___ghost_")
+ && !startswith (lname, "___ghost_"))
+ symbol_search_name += 9;
int uscore_count = 0;
while (*lname != '\0')