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 03/23] Use gdb_file_up in find_and_open_script


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


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