This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA 2/4] Change gdbscm_exception_message_to_string to return a unique_xmalloc_ptr
- From: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tom at tromey dot com>, gdb-patches at sourceware dot org
- Date: Tue, 17 Jul 2018 14:08:34 +0100
- Subject: Re: [RFA 2/4] Change gdbscm_exception_message_to_string to return a unique_xmalloc_ptr
- References: <20180527152009.4228-1-tom@tromey.com> <20180527152009.4228-3-tom@tromey.com>
On 05/27/2018 04:20 PM, Tom Tromey wrote:
> ChangeLog
> 2018-05-26 Tom Tromey <tom@tromey.com>
>
> * guile/scm-param.c (pascm_signal_setshow_error): Update.
> * guile/guile-internal.h (gdbscm_exception_message_to_string):
> Update.
> * guile/scm-cmd.c (cmdscm_function): Update.
> * guile/scm-pretty-print.c
> (ppscm_print_exception_unless_memory_error): Update.
> * guile/scm-exception.c (gdbscm_exception_message_to_string):
> Return unique_xmalloc_ptr.
OK.
> @@ -601,9 +598,9 @@ gdbscm_exception_message_to_string (SCM exception)
> }
>
> gdbscm_print_exception_message (port, SCM_BOOL_F, key, args);
> - result = gdbscm_scm_to_c_string (scm_get_output_string (port));
> + gdb::unique_xmalloc_ptr<char> result
> + (gdbscm_scm_to_c_string (scm_get_output_string (port)));
> scm_close_port (port);
> -
> return result;
> }
Did you try making gdbscm_scm_to_c_string return a unique_ptr too?
Thanks,
Pedro Alves