/* Rust language support definitions for GDB, the GNU debugger.
- Copyright (C) 2016-2021 Free Software Foundation, Inc.
+ Copyright (C) 2016-2022 Free Software Foundation, Inc.
This file is part of GDB.
/* See language.h. */
- bool sniff_from_mangled_name (const char *mangled,
- char **demangled) const override
+ bool sniff_from_mangled_name
+ (const char *mangled, gdb::unique_xmalloc_ptr<char> *demangled)
+ const override
{
*demangled = gdb_demangle (mangled, DMGL_PARAMS | DMGL_ANSI);
return *demangled != NULL;
/* See language.h. */
- char *demangle_symbol (const char *mangled, int options) const override
+ gdb::unique_xmalloc_ptr<char> demangle_symbol (const char *mangled,
+ int options) const override
{
return gdb_demangle (mangled, options);
}
{
type = check_typedef (TYPE_TARGET_TYPE (check_typedef (type)));
std::string name = type_to_string (type);
- return gdb::unique_xmalloc_ptr<char>
- (xstrprintf ("*(%s as *mut %s)", core_addr_to_string (addr),
- name.c_str ()));
+ return xstrprintf ("*(%s as *mut %s)", core_addr_to_string (addr),
+ name.c_str ());
}
/* See language.h. */