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: [PATCH v4] gdb/manual: Introduce location specs
Date: Fri, 27 May 2022 20:30:06 +0100	[thread overview]
Message-ID: <266eba78-e6c7-c72a-4820-bbbabe37ac04@palves.net> (raw)
In-Reply-To: <83mtf2n6lw.fsf@gnu.org>

On 2022-05-27 20:00, Eli Zaretskii wrote:

> 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.

OK, here's what I added on top of v4, locally.  WDYT?

From 97024e5cd68a1608287c28ea06693a3c18804474 Mon Sep 17 00:00:00 2001
From: Pedro Alves <pedro@palves.net>
Date: Fri, 27 May 2022 20:22:49 +0100
Subject: [PATCH] foo

Change-Id: I18ab66ae278767e2636aa76712e2d5c44ca6ee83
---
 gdb/doc/gdb.texinfo | 37 +++++++++++++++++++++++++++----------
 1 file changed, 27 insertions(+), 10 deletions(-)

diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 6deaad88d31..8f25f899263 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -9053,10 +9053,13 @@ line in the source code, but it can also indicate a function name, an
 address, a label, and more.
 
 A concrete code location in your program is uniquely identifiable by a
-set of logical attributes.  Typically, a line number, the source file
-the line belongs to, the fully-qualified and prototyped function it is
-defined in, and an instruction address.  Because each inferior has its
-own address space, also an inferior number.
+set of logical attributes.  A line number, the source file the line
+belongs to, the fully-qualified and prototyped function it is defined
+in, and an instruction address.  Because each inferior has its own
+address space, also an inferior number.  The source file attribute has
+as many directory components as possible, retrieved from the debug
+information, and in absolute form if possible, but it may also be in
+relative form.
 
 On the other hand, a @dfn{location specification} (a.k.a.@: location
 spec) is a way to find or refer to the concrete code locations in the
@@ -9065,12 +9068,22 @@ resolves the spec to actual code locations in your program by using
 the source and debug information.
 
 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, or even not specify a filename at all,
-just a line number.  Or, the spec may indicate a simple function name
-instead of a fully-qualified and prototyped function name (e.g.,
-@code{func} instead of @code{A::func(int)}).
+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, or even not specify a
+filename at all, just a line number.  To differentiate between files
+with the same base name, the spec may prepend as many directories as
+is necessary to uniquely identify the desired file.
+
+Or, the spec may indicate a simple function name instead of a
+fully-qualified and prototyped function name (e.g., @code{func}
+instead of @code{A::func(int)}).  To differentiate between functions
+with the same name, the spec may prepend as many class and namespace
+names as is necessary to uniquely identify the desired funnction,
+and/or it may specify the function parameters as well.  In addition,
+the spec may indicate that the function name should be interpreted as
+a fully qualified name.
 
 You may not have debug info for some of the instructions in the
 program, so a resolved location that itself points to such code will
@@ -9105,6 +9118,10 @@ For an inlined function, a given source line can correspond to several
 places where that function is inlined.
 @end itemize
 
+The act of finding all the actual code location that match the user
+input is called @dfn{resolving the location spec}.  The code locations
+that @value{GDBN} finds are the @dfn{resolved code locations}.
+
 Locations may be specified using three different formats: linespec
 locations, explicit locations, or address locations.
 

-- 
2.36.0


  reply	other threads:[~2022-05-27 19:30 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-26 19:42 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 [this message]
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
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=266eba78-e6c7-c72a-4820-bbbabe37ac04@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).