This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA 2/4] Change gdbscm_exception_message_to_string to return a unique_xmalloc_ptr


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]