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: Tom Tromey <tom at tromey dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: Tom Tromey <tom at tromey dot com>, gdb-patches at sourceware dot org
- Date: Tue, 17 Jul 2018 13:10:24 -0600
- 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> <4f3db9e6-4c5a-c29c-46ab-8ce6e1032b3a@redhat.com>
>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
>> 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;
>> }
Pedro> Did you try making gdbscm_scm_to_c_string return a unique_ptr too?
Yes, but this runs into the use of
GDBSCM_HANDLE_GDB_EXCEPTION_WITH_CLEANUPS in (at least) gdbscm_value_field.
I haven't looked into what to do about this.
Tom