[PATCHv2 1/2] gdb/guile: perform tilde expansion when sourcing guile scripts

Simon Marchi simon.marchi@polymtl.ca
Fri May 7 14:55:38 GMT 2021


On 2021-05-07 6:29 a.m., Andrew Burgess wrote:
> @@ -737,8 +738,10 @@ source_script_with_search (const char *file, int from_tty, int search_path)
>       anyway so that error messages show the actual file used.  But only do
>       this if we (may have) used search_path, as printing the full path in
>       errors for the non-search case can be more noise than signal.  */
> +  gdb::unique_xmalloc_ptr<char> file_to_open = gdb_tilde_expand_up (file);
>    source_script_from_stream (opened->stream.get (), file,
> -			     search_path ? opened->full_path.get () : file);
> +			     search_path ? opened->full_path.get ()
> +			     : file_to_open.get ());

A minor detail, but the gdb_tilde_expand_up call is only necessary when
search_path is false.  So if there's a easy way to avoid it otherwise,
it would be nice.  But other than that, LGTM.

Simon


More information about the Gdb-patches mailing list