public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@palves.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gdb-patches@sourceware.org
Subject: Re: RTe: Location Specs (Was: [pushed v5] gdb/manual: Introduce location specs)
Date: Thu, 2 Jun 2022 12:10:54 +0100	[thread overview]
Message-ID: <e9d2ec35-a68a-7403-ab88-ebfe9d88ca37@palves.net> (raw)
In-Reply-To: <83wne0fgmd.fsf@gnu.org>

On 2022-06-01 18:17, Eli Zaretskii wrote:

> ----------------------------------------------------------------------
> @node Location Specifications
> @section Location Specifications
> @cindex specifying location
> @cindex locspec
> @cindex source location
> @cindex code location
> 
> @cindex location spec
> Several @value{GDBN} commands accept arguments that specify a location
> or locations of your program's code.  Since @value{GDBN} is a
> source-level debugger, a location specification usually indicates some
> line in some source file, but it can also do that indirectly, by
> specifying a function name, an address, a label, etc.  The different
> forms of specifying a location that @value{GDBN} recognizes are
> collectively known as forms of @dfn{location specification}, or
> @dfn{location spec}.  This section documents the forms of specifying
> locations that @value{GDBN} recognizes.
> 
> @cindex location resolution
> @cindex resolution of location spec
> When you specify a location, @value{GDBN} needs to find the place in
> your program, known as @dfn{code location}, that corresponds to the
> given location spec.  We call this process of finding actual code
> locations corresponding to a location spec @dfn{location resolution}.
> 
> A concrete code location in your program is uniquely identifiable by a
> set of several attributes: its source line number, the name of its
> source file, the fully-qualified and prototyped function in which it
> is defined, and an instruction address.  Because each inferior has its
> own address space, the inferior number is also a necessary part of
> these attributes.  By contrast, location specs you type will many

I built the manual here with the patch, to read in the html form in the browser,
and found this paragraph very long and dense.  I find it much more readable if we have a
paragraph break here (line break + empty line), before "By contract".  Above we talk
about actual code locations.  And below we talk about location specs.  

If you look for "By contrast" in the manual, you will see that the only two
other instances also start a new text block.

> times omit some of these attributes.  For example, it is customary to
> specify just the source line number to mean a line in the current
> source file, or specify just the basename of the file, omitting its
> directories.  In other words, a location spec is usually incomplete, a
> kind of blueprint, and @value{GDBN} needs to complete the missing
> attributes by using the implied defaults, and by considering the
> source code and the debug information available to it.  This is what
> location resolution is about.
> 



> ----------------------------------------------------------------------
> 
> diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
> index 5f09f3a..3395735 100644
> --- a/gdb/doc/gdb.texinfo
> +++ b/gdb/doc/gdb.texinfo
> @@ -9056,73 +9056,67 @@
>  @node Location Specifications
>  @section Location Specifications
>  @cindex specifying location
> -@cindex location spec
>  @cindex locspec
>  @cindex source location
>  @cindex code location
>  
> +@cindex location spec
>  Several @value{GDBN} commands accept arguments that specify a location
>  or locations of your program's code.  Since @value{GDBN} is a
>  source-level debugger, a location specification usually indicates some
> -line in the source code, but it can also indicate a function name, an
> -address, a label, and more.
> +line in some source file, but it can also do that indirectly, by
> +specifying a function name, an address, a label, etc.  

This is changing the meaning of what was said.  It is now reading as if
the line number is what are are after, and that function, address, etc.
are merely means to get to the line number.  While before, we were saying that
usually you specify the line number, but you can also specify some
function, or even a precise address.  The new text gives a lot more emphasis to
the resolved line number.

I think it's a difference in the interpretation of "indicate".  The original
text uses it to mean the arguments the user can specify (otherwise it wouldn't
be talking about "a label" or function _name_), while in your version you seem
to be using "indicate" to mean the line number you want the spec to resolve to.

There are commands that accept location specs and want to resolve them to
addresses, others to lines, etc., and you can specify a line to find the address,
and conversely you can also specify an address to find a line.

Maybe we should say _that_ somehow, instead of the "Since @value{GDBN} is a
source-level debugger, a location specification usually indicates some
line" sentence, which I find kind of an unnecessary assertion.  Specifying
function names to break at the function's entry is very usual too, for example.

Or we can just keep the same wording as before.

>  
>  @item
>  For a C@t{++} constructor, the @value{NGCC} compiler generates several
> -instances of the function body, used in different cases.
> +instances of the function body, used in different cases, but their
> +source-level names are identical, unless you qualify them.

What do you mean by "qualify" here?


Otherwise this looks great!

  reply	other threads:[~2022-06-02 11:10 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-26 19:42 [PATCH v4] gdb/manual: Introduce location specs Pedro Alves
2022-05-27 14:16 ` Eli Zaretskii
2022-05-27 15:04   ` Pedro Alves
2022-05-27 15:52     ` Eli Zaretskii
2022-05-27 17:11       ` Pedro Alves
2022-05-27 17:31         ` Eli Zaretskii
2022-05-27 17:51           ` Pedro Alves
2022-05-27 18:23             ` Eli Zaretskii
2022-05-27 18:42               ` Pedro Alves
2022-05-27 18:50                 ` Pedro Alves
2022-05-27 19:00                   ` Eli Zaretskii
2022-05-27 19:30                     ` Pedro Alves
2022-05-28  7:43                       ` Eli Zaretskii
2022-05-30 14:38                         ` Pedro Alves
2022-05-27 18:55                 ` Eli Zaretskii
2022-05-27 19:05                   ` Pedro Alves
2022-05-27 19:14                     ` Eli Zaretskii
2022-05-27 19:17                       ` Pedro Alves
2022-05-27 19:34                         ` Eli Zaretskii
2022-05-27 19:38                           ` Pedro Alves
2022-05-28  7:39 ` Eli Zaretskii
2022-05-30 14:44   ` [pushed v5] " Pedro Alves
2022-05-30 16:15     ` Eli Zaretskii
2022-05-31 11:05       ` [PATCH] Improve clear command's documentation Pedro Alves
2022-05-31 12:36         ` Eli Zaretskii
2022-05-31 13:04           ` Pedro Alves
2022-05-31 13:42             ` Eli Zaretskii
2022-05-31 14:47               ` Pedro Alves
2022-05-31 16:06                 ` Eli Zaretskii
2022-05-31 11:13       ` [PATCH] Explicitly mention yet-unloaded shared libraries in location spec examples Pedro Alves
2022-05-31 11:47         ` Eli Zaretskii
2022-05-31 11:17       ` [pushed v5] gdb/manual: Introduce location specs Pedro Alves
2022-05-31 11:31       ` [PATCH] Improve break-range's documentation Pedro Alves
2022-05-31 11:55         ` Eli Zaretskii
2022-05-31 12:03           ` Pedro Alves
2022-05-31 12:09             ` Eli Zaretskii
2022-06-01 17:17     ` RTe: Location Specs (Was: [pushed v5] gdb/manual: Introduce location specs) Eli Zaretskii
2022-06-02 11:10       ` Pedro Alves [this message]
2022-06-02 11:49         ` Eli Zaretskii
2022-06-02 12:40           ` Pedro Alves
2022-06-02 12:56             ` Eli Zaretskii
2022-06-02 13:44               ` Pedro Alves
2022-06-02 16:37                 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e9d2ec35-a68a-7403-ab88-ebfe9d88ca37@palves.net \
    --to=pedro@palves.net \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).