aboutsummaryrefslogtreecommitdiff
path: root/gdb/doc
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@ericsson.com>2018-09-13 15:40:41 -0400
committerSimon Marchi <simon.marchi@ericsson.com>2018-09-13 15:42:12 -0400
commit0ae1a3211adcb8e7518b0b656b2309ebbc45e9ae (patch)
tree96c5436eeaac8f151adfd96c5fc17117b8f3b4ba /gdb/doc
parenta40bf0c2e93daac4ae4ce7dd1c43ab6135e76720 (diff)
downloadgdb-0ae1a3211adcb8e7518b0b656b2309ebbc45e9ae.zip
gdb-0ae1a3211adcb8e7518b0b656b2309ebbc45e9ae.tar.gz
gdb-0ae1a3211adcb8e7518b0b656b2309ebbc45e9ae.tar.bz2
python: Add Progspace.objfiles method
This patch adds an objfiles method to the Progspace object, which returns a sequence of the objfiles associated to that program space. I chose a method rather than a property for symmetry with gdb.objfiles(). gdb/ChangeLog: * python/py-progspace.c (PSPY_REQUIRE_VALID): New macro. (pspy_get_objfiles): New function. (progspace_object_methods): New. (pspace_object_type): Add tp_methods callback. * python/python-internal.h (build_objfiles_list): New declaration. * python/python.c (build_objfiles_list): New function. (gdbpy_objfiles): Implement using build_objfiles_list. * NEWS: Mention the Progspace.objfiles method. gdb/doc/ChangeLog: * python.texi (Program Spaces In Python): Document the Progspace.objfiles method. (Objfiles In Python): Mention that gdb.objfiles() is identical to gdb.selected_inferior().progspace.objfiles(). gdb/testsuite/ChangeLog: * gdb.python/py-progspace.exp: Test the Progspace.objfiles method.
Diffstat (limited to 'gdb/doc')
-rw-r--r--gdb/doc/ChangeLog8
-rw-r--r--gdb/doc/python.texi12
2 files changed, 19 insertions, 1 deletions
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index 4750c34..e6d5c8f 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,6 +1,14 @@
2018-09-13 Simon Marchi <simon.marchi@ericsson.com>
2018-09-13 Tom Tromey <tom@tromey.com>
+ * python.texi (Program Spaces In Python): Document the
+ Progspace.objfiles method.
+ (Objfiles In Python): Mention that gdb.objfiles() is identical
+ to gdb.selected_inferior().progspace.objfiles().
+
+2018-09-13 Simon Marchi <simon.marchi@ericsson.com>
+2018-09-13 Tom Tromey <tom@tromey.com>
+
* python.texi (Inferiors In Python): Document
Inferior.progspace.
(Program Spaces In Python): Document that
diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi
index 75d8ae1..896e27b 100644
--- a/gdb/doc/python.texi
+++ b/gdb/doc/python.texi
@@ -4079,6 +4079,14 @@ Hello.
[Inferior 1 (process 4242) exited normally]
@end smallexample
+A @code{gdb.Progspace} object has the following methods:
+
+@findex Progspace.objfiles
+@defun Progspace.objfiles ()
+Return a sequence of all the objfiles referenced by this program
+space. @xref{Objfiles In Python}.
+@end defun
+
@node Objfiles In Python
@subsubsection Objfiles In Python
@@ -4105,7 +4113,9 @@ this function returns @code{None}.
@findex gdb.objfiles
@defun gdb.objfiles ()
Return a sequence of all the objfiles current known to @value{GDBN}.
-@xref{Objfiles In Python}.
+@xref{Objfiles In Python}. This is identical to
+@code{gdb.selected_inferior().progspace.objfiles()} (@pxref{Progspaces In
+Python}) and is included for historical compatibility.
@end defun
@findex gdb.lookup_objfile