gdb/gdbsupport: make xstrprintf and xstrvprintf return a unique_ptr
The motivation is to reduce the number of places where unmanaged pointers are returned from allocation type routines. All of the callers are updated. There should be no user visible changes after this commit.
This commit is contained in:
parent
2bb7589ddf
commit
8579fd136a
34 changed files with 119 additions and 151 deletions
|
@ -602,8 +602,7 @@ language_defn::watch_location_expression (struct type *type,
|
|||
/* Generates an expression that assumes a C like syntax is valid. */
|
||||
type = check_typedef (TYPE_TARGET_TYPE (check_typedef (type)));
|
||||
std::string name = type_to_string (type);
|
||||
return gdb::unique_xmalloc_ptr<char>
|
||||
(xstrprintf ("* (%s *) %s", name.c_str (), core_addr_to_string (addr)));
|
||||
return xstrprintf ("* (%s *) %s", name.c_str (), core_addr_to_string (addr));
|
||||
}
|
||||
|
||||
/* See language.h. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue