This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Use unique_xmalloc_ptr for read_string
- From: Tom Tromey <tom at tromey dot com>
- To: Simon Marchi <simon dot marchi at polymtl dot ca>
- Cc: Tom Tromey <tom at tromey dot com>, gdb-patches at sourceware dot org
- Date: Mon, 18 Jun 2018 13:15:22 -0600
- Subject: Re: [RFA] Use unique_xmalloc_ptr for read_string
- References: <20180521204146.17553-1-tom@tromey.com> <afae0a935a6c6313970adcddb31b62a5@polymtl.ca>
>>>>> "Simon" == Simon Marchi <simon.marchi@polymtl.ca> writes:
Simon> On 2018-05-21 16:41, Tom Tromey wrote:
>> This changes read_string's "buffer" out-parameter to be a
>> unique_xmalloc_ptr, then updates the users. This allows for the
>> removal of some cleanups.
>>
>> I chose unique_xmalloc_ptr rather than byte_vector here due to the way
>> Guile unwinding seems to work.
Simon> Hmm yeah I'm not too sure how Guile exceptions, work. Would the
Simon> destructor of a an object local to gdbscm_value_to_string run, if
Simon> scm_from_stringn was to throw an exception, I guess that's the
Simon> question?
Yes - well, I think they would not be run, because guile exceptions are
longjmp based.
Also I think some replacement for
GDBSCM_HANDLE_GDB_EXCEPTION_WITH_CLEANUPS that uses destructors will need
to be found.
Tom