Re: [PATCH v4] gdb/manual: Introduce location specs

Eli Zaretskii via Gdb-patches
2022-05-27T19:01:14Z

> Date: Fri, 27 May 2022 19:50:58 +0100
> From: Pedro Alves <pedro@palves.net>
> Cc: gdb-patches@sourceware.org
>
> BTW, my text says this:
>
> +The location spec may be incomplete, and @value{GDBN} will do its best
> +to find all the locations in the program that match it. For example,
> +a location spec may just indicate a line number and a source filename
> ^^^^^^^^^^^^^^^
> +with no directory components,
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> and this example too:
>
> +@item
> +The location spec specifies a file name, and multiple files in the
> +program share the same name.

That's about location specs; I was talking about the code location,
where the missing attributes need to be resolved.

> IMO, from this it should be obvious that the code location has directory
> components that you can match.

I don't think I follow: match with what and in what way? Are you
talking about "matching" of an absolute file name with relative file
names?

> The explicit locations section already says for example:
>
> @table @code
> @item -source @var{filename}
> The value specifies the source file name. To differentiate between
> files with the same base name, prepend as many directories as is necessary
> to uniquely identify the desired file, e.g., @file{foo/bar/baz.c}. Otherwise
> @value{GDBN} will use the first file it finds with the given base
> name. This option requires the use of either @code{-function} or @code{-line}.
>
> I'm not sure we want to go into details like that in the intro section. Users won't
> be able to use any location spec format without reading the corresponding section,
> so they'll see this.

What I was talking about was not about using the location specs, it
was about explaining what it is and how it differs from the code
location. I think we have to explain the terminology before we use
it, since it is not entirely trivial.