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] Add -s option to source command.


On Fri, Apr 9, 2010 at 12:48 AM, Eli Zaretskii <eliz@gnu.org> wrote:
>> Date: Thu, 8 Apr 2010 15:49:41 -0700
>> From: Doug Evans <dje@google.com>
>> Cc: gdb-patches@sourceware.org
>>
>>
>> --- NEWS ? ? ?1 Apr 2010 14:11:22 -0000 ? ? ? 1.367
>> +++ NEWS ? ? ?8 Apr 2010 22:40:59 -0000
>> @@ -3,6 +3,10 @@
>>
>> ?*** Changes since GDB 7.1
>>
>> +* The source command now accepts a -s option to force searching for the
>> + ?script in the source search path even if the script name specifies
>> + ?a directory.
>> +
>
> This part is okay.
>
>> --- doc/gdb.texinfo ? 8 Apr 2010 21:08:40 -0000 ? ? ? 1.697
>> +++ doc/gdb.texinfo ? 8 Apr 2010 22:41:00 -0000
>
> This part is okay, with a couple of comments:
>
>> @@ -19373,7 +19373,7 @@ using the @code{script-extension} settin
>> ?@table @code
>> ?@kindex source
>> ?@cindex execute commands from a file
>> -@item source [@code{-v}] @var{filename}
>> +@item source [@code{-s}] [@code{-v}] @var{filename}
>
> Please remove the @code markup from the switches, it is redundant
> (because this is "@table @code" already, so every @item gets the @code
> markup by default). ?Yes, the old text was also wrong.

Righto.

>> +If @code{-s} is specified, then @value{GDBN} searches for @var{filename}
>> +on the search path even if @var{filename} specifies a directory.
>
> I presume it searches for the basename of @var{filename}, right? ?If
> so, please tell that explicitly.

The search includes the full path that the user provided.

How's this text?

If @code{-s} is specified, then @value{GDBN} searches for @var{filename}
on the search path even if @var{filename} specifies a directory.
The search is done by appending @var{filename} to each element of the
search path.  So, for example, if @var{filename} is @file{mylib/myscript}
and the search path contains @file{/home/user} then @value{GDBN} will
look for the script @file{/home/user/mylib/myscript}.
The search is also done if @var{filename} is an absolute path.
For example, if @var{filename} is @file{/tmp/myscript} and
the search path contains @file{/home/user} then @value{GDBN} will
look for the script @file{/home/user/tmp/myscript}.

> Also, the comments in the
> implementation say that symlinks are not resolved; if that's how we
> want this to work, it should also be mentioned, I think.

The symlink comment is an implementation detail, it doesn't affect how
source -s behaves.


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