From c6dc63a16299e22fcb5bc13b34cb402a1bfcf6b9 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sat, 9 Sep 2017 10:14:52 -0600 Subject: Remove cleanups from find_frame_funname This changes find_frame_funname to return a unique_xmalloc_ptr and then fixes up the callers. This removes several cleanups. ChangeLog 2017-09-11 Tom Tromey * ada-lang.c (is_known_support_routine): Update. (ada_unhandled_exception_name_addr_from_raise): Update. * guile/scm-frame.c (gdbscm_frame_name): Update. * python/py-frame.c (frapy_name): Update. (frapy_function): Update. * stack.h (find_frame_funname): Update. * stack.c (find_frame_funname): Return unique_xmalloc_ptr. (print_frame): Update. --- gdb/guile/scm-frame.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'gdb/guile') diff --git a/gdb/guile/scm-frame.c b/gdb/guile/scm-frame.c index b2af743..594d16e 100644 --- a/gdb/guile/scm-frame.c +++ b/gdb/guile/scm-frame.c @@ -418,7 +418,7 @@ static SCM gdbscm_frame_name (SCM self) { frame_smob *f_smob; - char *name = NULL; + gdb::unique_xmalloc_ptr name; enum language lang = language_minimal; struct frame_info *frame = NULL; SCM result; @@ -429,11 +429,10 @@ gdbscm_frame_name (SCM self) { frame = frscm_frame_smob_to_frame (f_smob); if (frame != NULL) - find_frame_funname (frame, &name, &lang, NULL); + name = find_frame_funname (frame, &lang, NULL); } CATCH (except, RETURN_MASK_ALL) { - xfree (name); GDBSCM_HANDLE_GDB_EXCEPTION (except); } END_CATCH @@ -445,10 +444,7 @@ gdbscm_frame_name (SCM self) } if (name != NULL) - { - result = gdbscm_scm_from_c_string (name); - xfree (name); - } + result = gdbscm_scm_from_c_string (name.get ()); else result = SCM_BOOL_F; -- cgit v1.1