diff options
author | Tom Tromey <tromey@adacore.com> | 2021-06-25 08:01:15 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2021-06-25 08:07:21 -0600 |
commit | 8a3df5acae7ad08f691b449c7e6f8e38fb1b8cb1 (patch) | |
tree | c249b9197a9b8c7dfd719e3328bf91a5390c813f /gdb/ada-lang.c | |
parent | 134df964367c19afa2eef81a0841fe1c181a9edc (diff) | |
download | binutils-8a3df5acae7ad08f691b449c7e6f8e38fb1b8cb1.zip binutils-8a3df5acae7ad08f691b449c7e6f8e38fb1b8cb1.tar.gz binutils-8a3df5acae7ad08f691b449c7e6f8e38fb1b8cb1.tar.bz2 |
Add non-wrapping mode to ada_decode
When ada_decode encounters a name that it cannot decode, it simply
wraps it in <...>, which is used elsewhere in the Ada code to indicate
that a verbatim match should be done.
A subequent patch needed the ability to suppress this wrapping, so
this patch adds a new mode to ada_decode.
2021-06-25 Tom Tromey <tromey@adacore.com>
* ada-lang.c (ada_decode): Add wrap parameter.
* ada-lang.h (ada_decode): Add wrap parameter.
Diffstat (limited to 'gdb/ada-lang.c')
-rw-r--r-- | gdb/ada-lang.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 6ed6b65..49a7d5b 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -976,12 +976,10 @@ ada_remove_po_subprogram_suffix (const char *encoded, int *len) *len = *len - 1; } -/* If ENCODED follows the GNAT entity encoding conventions, then return - the decoded form of ENCODED. Otherwise, return "<%s>" where "%s" is - replaced by ENCODED. */ +/* See ada-lang.h. */ std::string -ada_decode (const char *encoded) +ada_decode (const char *encoded, bool wrap) { int i, j; int len0; @@ -1216,12 +1214,14 @@ ada_decode (const char *encoded) return decoded; Suppress: + if (!wrap) + return {}; + if (encoded[0] == '<') decoded = encoded; else decoded = '<' + std::string(encoded) + '>'; return decoded; - } /* Table for keeping permanent unique copies of decoded names. Once |