aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/python-internal.h
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/python/python-internal.h
parenta40bf0c2e93daac4ae4ce7dd1c43ab6135e76720 (diff)
downloadbinutils-0ae1a3211adcb8e7518b0b656b2309ebbc45e9ae.zip
binutils-0ae1a3211adcb8e7518b0b656b2309ebbc45e9ae.tar.gz
binutils-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/python/python-internal.h')
-rw-r--r--gdb/python/python-internal.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h
index 3874fdc..785ad17 100644
--- a/gdb/python/python-internal.h
+++ b/gdb/python/python-internal.h
@@ -549,6 +549,10 @@ struct symtab_and_line *sal_object_to_symtab_and_line (PyObject *obj);
struct frame_info *frame_object_to_frame_info (PyObject *frame_obj);
struct gdbarch *arch_object_to_gdbarch (PyObject *obj);
+/* Return a Python list containing an Objfile object for each objfile in
+ PSPACE. */
+gdbpy_ref<> build_objfiles_list (program_space *pspace);
+
void gdbpy_initialize_gdb_readline (void);
int gdbpy_initialize_auto_load (void)
CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION;