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


>>>>> "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


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