public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Farre <simon.farre.cx@gmail.com>
To: gdb-patches@sourceware.org
Cc: Simon Farre <simon.farre.cx@gmail.com>
Subject: [PATCH 5/5] [dap & linetable]: Added docs
Date: Tue, 16 Jan 2024 20:13:05 +0100	[thread overview]
Message-ID: <20240116191305.126345-5-simon.farre.cx@gmail.com> (raw)
In-Reply-To: <20240116191305.126345-1-simon.farre.cx@gmail.com>

Added docs for the new `gdb.lookup_linetable` as well as the new
accessor method `LineTableEntry.column`.
---
 gdb/doc/python.texi | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi
index 71431878dd3..3206aef3b4f 100644
--- a/gdb/doc/python.texi
+++ b/gdb/doc/python.texi
@@ -6422,6 +6422,18 @@ mapping of source lines to their executable locations in memory.  To
 acquire the line table information for a particular symbol table, use
 the @code{linetable} function (@pxref{Symbol Tables In Python}).
 
+Python code can request a symtab's linetable by calling
+@code{gdb.lookup_linetable} passing in the filename.  The parameter
+@var{filename} can be a substring of the symtab's @code{fullname}.
+If multiple symtabs' fullnames share that substring, the first one
+found is returned.
+
+@defun gdb.lookup_linetable (filename)
+Return the @code{gdb.LineTable} of a symtab whose fullname matches
+@var{filename}.  If no symtab could be found using @var{filename}
+as a substring this function returns @code{None}.
+@end defun
+
 A @code{gdb.LineTable} is iterable.  The iterator returns
 @code{LineTableEntry} objects that correspond to the source line and
 address for each line table entry.  @code{LineTableEntry} objects have
@@ -6433,6 +6445,12 @@ corresponds to the actual line of source.  This attribute is not
 writable.
 @end defvar
 
+@defvar LineTableEntry.column
+The source column number for this line table entry.  This number
+corresponds to the actual column of source.  This attribute is not
+writable.
+@end defvar
+
 @defvar LineTableEntry.pc
 The address that is associated with the line table entry where the
 executable code for that source line resides in memory.  This
-- 
2.43.0


  parent reply	other threads:[~2024-01-16 19:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-16 19:13 [PATCH 1/5] [dap & linetable]: Add column to linetable entry Simon Farre
2024-01-16 19:13 ` [PATCH 2/5] [dap & linetable]: Add column to maint info linetable output Simon Farre
2024-01-16 19:13 ` [PATCH 3/5] [dap & linetable]: Change gdb.LineTableEntry & Add gdb.lookup_linetable Simon Farre
2024-01-16 19:13 ` [PATCH 4/5] [dap & linetable]: Add breakpointLocations request Simon Farre
2024-01-16 19:13 ` Simon Farre [this message]
2024-01-16 19:27   ` [PATCH 5/5] [dap & linetable]: Added docs 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=20240116191305.126345-5-simon.farre.cx@gmail.com \
    --to=simon.farre.cx@gmail.com \
    --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).