This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA 03/23] Use gdb_file_up in find_and_open_script
- 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: Sun, 23 Jul 2017 10:08:45 -0600
- Subject: Re: [RFA 03/23] Use gdb_file_up in find_and_open_script
- Authentication-results: sourceware.org; auth=none
- References: <20170503224626.2818-1-tom@tromey.com> <20170503224626.2818-4-tom@tromey.com> <8e575587-67d5-3d19-a70b-646a6b712e07@redhat.com>
>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
>> -extern int find_and_open_script (const char *file, int search_path,
>> - FILE **streamp, char **full_path);
>> +extern gdb_file_up
>> + find_and_open_script (const char *file, int search_path,
>> + gdb::unique_xmalloc_ptr<char> *full_path);
>>
Pedro> Though I wonder whether using gdb::optional wouldn't look clearer:
Pedro> /* The script that was opened. */
Pedro> struct open_script
Pedro> {
Pedro> gdb_file_up stream;
Pedro> gdb::unique_xmalloc_ptr<char> full_path;
Pedro> };
[...]
I went ahead and did it this way.
Tom