Re: Add --with-relocated-sources configure option

Eli Zaretskii
2009-04-20T21:10:54Z

> Date: Mon, 20 Apr 2009 20:26:08 +0000 (UTC)
> From: "Joseph S. Myers" <joseph@codesourcery.com>
>
> gdb/doc:
> 2009-04-20 Joseph Myers <joseph@codesourcery.com>
>
> * gdb.texinfo (Source Path): Document --with-relocated-sources.

This part is okay (assuming that the code is approved), with a few
comments:

> +@cindex @samp{--with-relocated-sources}
> +You can configure a default source path substitution rule by
> +configuring @value{GDBN} with the

This needs an additional index entry which does not require to
remember the name of the option by heart. Something like

@cindex default source path substitution

> +@samp{--with-relocated-sources=@var{path}} option. The @var{path}
> +should be the name of a directory under @value{GDBN}'s configured
> +binary prefix (set with @samp{--prefix} or @samp{--exec-prefix}), and
> +paths in debug information under @var{path} will be relocated
> +automatically if the installed @value{GDBN} is moved to a new
> +location.

First, GNU coding standards frown on using ``path'' for file names or
directory names (see the node "GNU Manuals" in standards.texi).

Second, the second part of the last sentence above, the one which
starts with "and paths", got me confused. Let's see if I understood
your intent. Assuming I configured GDB like this:

./configure --prefix=/some/dir --with-relocated-sources=/some/dir/bar

then, even if the GDB tree is moved to /elsewhere/foo, GDB will
automagically find its sources in /elsewhere/foo/bar. Is that true?

If it's true, then I suggest (1) to drop the word "binary" in "binary
prefix", and (2) rephrase the "will be relocated automatically" part,
because nothing is actually relocated; rather, GDB substitutes the new
path for the old without any explicit command from the user. The text
as written suggests that files are somehow moved (``relocated'')
somewhere.

> This is useful if @value{GDBN}, libraries or executables
> +with debug information and corresponding source code are being
> +distributed together.

Don't you mean that this is useful if they are also _moved_ to a
different location together?

Thanks.