[binutils-gdb] gdb/doc: extend the description for Progspace.filename

Andrew Burgess aburgess@sourceware.org
Thu Sep 28 14:34:26 GMT 2023


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ce65386db6653171334434ae488a0c0e10a60871

commit ce65386db6653171334434ae488a0c0e10a60871
Author: Andrew Burgess <aburgess@redhat.com>
Date:   Mon Aug 28 16:58:12 2023 +0100

    gdb/doc: extend the description for Progspace.filename
    
    Extend the description for Progspace.filename in the documentation to
    mention what the returned string is actually the filename
    for (e.g. that it is the filename passed to the 'symbol-file' or
    'file' command).
    
    Also document that this attribute will be None if no symbol file is
    currently loaded.
    
    Reviewed-By: Eli Zaretskii <eliz@gnu.org>
    Approved-By: Tom Tromey <tom@tromey.com>

Diff:
---
 gdb/doc/python.texi       | 7 ++++++-
 gdb/python/py-progspace.c | 2 +-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi
index 5e88fd09e48..1b4b8a3fa14 100644
--- a/gdb/doc/python.texi
+++ b/gdb/doc/python.texi
@@ -5070,7 +5070,12 @@ Each progspace is represented by an instance of the @code{gdb.Progspace}
 class.
 
 @defvar Progspace.filename
-The file name of the progspace as a string.
+The file name, as a string, of the main symbol file (from which debug
+symbols have been loaded) for the progspace, e.g.@: the argument to
+the @kbd{symbol-file} or @kbd{file} commands.
+
+If there is no main symbol table currently loaded, then this attribute
+will be @code{None}.
 @end defvar
 
 @defvar Progspace.pretty_printers
diff --git a/gdb/python/py-progspace.c b/gdb/python/py-progspace.c
index b98ac8dde61..2b1d1605ca0 100644
--- a/gdb/python/py-progspace.c
+++ b/gdb/python/py-progspace.c
@@ -572,7 +572,7 @@ static gdb_PyGetSetDef pspace_getset[] =
   { "__dict__", gdb_py_generic_dict, NULL,
     "The __dict__ for this progspace.", &pspace_object_type },
   { "filename", pspy_get_filename, NULL,
-    "The progspace's main filename, or None.", NULL },
+    "The filename of the progspace's main symbol file, or None.", nullptr },
   { "pretty_printers", pspy_get_printers, pspy_set_printers,
     "Pretty printers.", NULL },
   { "frame_filters", pspy_get_frame_filters, pspy_set_frame_filters,


More information about the Gdb-cvs mailing list