aboutsummaryrefslogtreecommitdiff
path: root/gdb/stack.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2017-10-09 15:57:36 +0100
committerPedro Alves <palves@redhat.com>2017-10-09 15:57:36 +0100
commit109483d9eec3f0d0c3eaafd5d829435059167c52 (patch)
tree4c41fa833332e7c4ae832313e3027eb70d5bcf2b /gdb/stack.c
parentc474ea1a5f1524668cb8ce91c3682cb0cb837e08 (diff)
downloadgdb-109483d9eec3f0d0c3eaafd5d829435059167c52.zip
gdb-109483d9eec3f0d0c3eaafd5d829435059167c52.tar.gz
gdb-109483d9eec3f0d0c3eaafd5d829435059167c52.tar.bz2
Make cp_remove_params return a gdb::unique_xmalloc_ptr
Use the type system instead of callers needing to know how the returned string's memory is supposed to be managed. gdb/ChangeLog: 2017-10-09 Pedro Alves <palves@redhat.com> * cp-support.c (cp_remove_params): Return a gdb::unique_xmalloc_ptr. Use bool. (overload_list_add_symbol): Adjust to use gdb::unique_xmalloc_ptr. * cp-support.h (cp_remove_params): Now returns a gdb::unique_xmalloc_ptr. * dwarf2read.c (find_slot_in_mapped_hash): Now returns bool. Adjust to cp_remove_params returning a gdb::unique_xmalloc_ptr. * psymtab.c (psymtab_search_name): Adjust to cp_remove_params returning a gdb::unique_xmalloc_ptr. (lookup_partial_symbol): Adjust to use gdb::unique_xmalloc_ptr. * stack.c (find_frame_funname): Adjust to cp_remove_params returning a gdb::unique_xmalloc_ptr.
Diffstat (limited to 'gdb/stack.c')
-rw-r--r--gdb/stack.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/gdb/stack.c b/gdb/stack.c
index 53dc829..4e40e32 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -1101,10 +1101,7 @@ find_frame_funname (struct frame_info *frame, enum language *funlang,
stored in the symbol table, but we stored a version
with DMGL_PARAMS turned on, and here we don't want to
display parameters. So remove the parameters. */
- char *func_only = cp_remove_params (print_name);
-
- if (func_only)
- funname.reset (func_only);
+ funname = cp_remove_params (print_name);
}
/* If we didn't hit the C++ case above, set *funname
@@ -1434,7 +1431,7 @@ info_frame_command (char *addr_exp, int from_tty)
stored in the symbol table, but we stored a version
with DMGL_PARAMS turned on, and here we don't want to
display parameters. So remove the parameters. */
- func_only.reset (cp_remove_params (funname));
+ func_only = cp_remove_params (funname);
if (func_only)
funname = func_only.get ();