mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-27 01:28:46 +00:00
Make ada_decode not use a static buffer
This makes it safer to use in general, and also allows using it on a
background thread in the future.
Inspired by tromey's patch at:
1226cbdfa4
(however, implemented in a different way)
gdb/ChangeLog:
2019-09-23 Christian Biesinger <cbiesinger@google.com>
* ada-exp.y (write_object_remaining): Update.
* ada-lang.c (ada_decode): Return a std::string instead of a char*
and eliminate the static buffer.
(ada_decode_symbol): Update.
(ada_la_decode): Update.
(ada_sniff_from_mangled_name): Update.
(is_valid_name_for_wild_match): Update.
(ada_lookup_name_info::matches): Update and simplify.
(name_matches_regex): Update.
(ada_add_global_exceptions): Update.
* ada-lang.h (ada_decode): Update signature.
* ada-varobj.c (ada_varobj_describe_simple_array_child): Update.
* dwarf-index-write.c (debug_names::insert): Update.
This commit is contained in:
@@ -624,6 +624,7 @@ ada_varobj_describe_simple_array_child (struct value *parent_value,
|
||||
of the array index type when such type qualification is
|
||||
needed. */
|
||||
const char *index_type_name = NULL;
|
||||
std::string decoded;
|
||||
|
||||
/* If the index type is a range type, find the base type. */
|
||||
while (TYPE_CODE (index_type) == TYPE_CODE_RANGE)
|
||||
@@ -634,7 +635,10 @@ ada_varobj_describe_simple_array_child (struct value *parent_value,
|
||||
{
|
||||
index_type_name = ada_type_name (index_type);
|
||||
if (index_type_name)
|
||||
index_type_name = ada_decode (index_type_name);
|
||||
{
|
||||
decoded = ada_decode (index_type_name);
|
||||
index_type_name = decoded.c_str ();
|
||||
}
|
||||
}
|
||||
|
||||
if (index_type_name != NULL)
|
||||
|
||||
Reference in New Issue
Block a user