gdb/python: new Progspace.executable_filename attribute
authorAndrew Burgess <aburgess@redhat.com>
Thu, 7 Sep 2023 14:47:07 +0000 (15:47 +0100)
committerAndrew Burgess <aburgess@redhat.com>
Thu, 28 Sep 2023 14:33:13 +0000 (15:33 +0100)
commit4e02aca0c5ed0c23f8d8a3e30dc317967193a5f0
treeab9774fa3de282f47ba23c0044c7f8cceb7f8dec
parent5ce85461a143e0d564b6dfa6407374851899d491
gdb/python: new Progspace.executable_filename attribute

Add a new Progspace.executable_filename attribute that contains the
path to the executable for this program space, or None if no
executable is set.

The path within this attribute will be set by the "exec-file" and/or
"file" commands.

Accessing this attribute for an invalid program space will raise an
exception.

This new attribute is similar too, but not the same as the existing
gdb.Progspace.filename attribute.  If I could change the past, I'd
change the 'filename' attribute to 'symbol_filename', which is what it
actually represents.  The old attribute will be set by the
'symbol-file' command, while the new attribute is set by the
'exec-file' command.  Obviously the 'file' command sets both of these
attributes.

Reviewed-By: Eli Zaretskii <eliz@gnu.org>
Approved-By: Tom Tromey <tom@tromey.com>
gdb/NEWS
gdb/doc/python.texi
gdb/python/py-progspace.c
gdb/testsuite/gdb.python/py-exec-file.c [new file with mode: 0644]
gdb/testsuite/gdb.python/py-exec-file.exp [new file with mode: 0644]