forked from Imagelibrary/binutils-gdb
Use unique_xmalloc_ptr<char> when demangling
I noticed that some methods in language_defn could use unique_xmalloc_ptr<char> rather than a plain 'char *'. This patch implements this change, fixing up the fallout and changing gdb_demangle to also return this type. In one spot, std::string is used to simplify some related code, and in another, an auto_obstack is used to avoid manual management. Regression tested on x86-64 Fedora 34.
This commit is contained in:
@@ -188,6 +188,6 @@ extern struct cmd_list_element *maint_cplus_cmd_list;
|
||||
|
||||
/* A wrapper for bfd_demangle. */
|
||||
|
||||
char *gdb_demangle (const char *name, int options);
|
||||
gdb::unique_xmalloc_ptr<char> gdb_demangle (const char *name, int options);
|
||||
|
||||
#endif /* CP_SUPPORT_H */
|
||||
|
||||
Reference in New Issue
Block a user