[v3,5/5,dap,&,linetable] : Added docs

Message ID 20240122133115.201205-5-simon.farre.cx@gmail.com
State New
Headers
Series [v3,1/5,dap,&,linetable] : Add column to linetable entry |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 fail Testing failed

Commit Message

Simon Farre Jan. 22, 2024, 1:31 p.m. UTC
  Added docs for the new `gdb.lookup_linetable` as well as the new
accessor method `LineTableEntry.column`.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31271
---
 gdb/doc/python.texi | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
  

Patch

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