aboutsummaryrefslogtreecommitdiff
path: root/gdb/guile
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/guile')
-rw-r--r--gdb/guile/lib/gdb.scm1
-rw-r--r--gdb/guile/scm-objfile.c17
2 files changed, 18 insertions, 0 deletions
diff --git a/gdb/guile/lib/gdb.scm b/gdb/guile/lib/gdb.scm
index e95914a..8f238be 100644
--- a/gdb/guile/lib/gdb.scm
+++ b/gdb/guile/lib/gdb.scm
@@ -271,6 +271,7 @@
objfile?
objfile-valid?
objfile-filename
+ objfile-progspace
objfile-pretty-printers
set-objfile-pretty-printers!
current-objfile
diff --git a/gdb/guile/scm-objfile.c b/gdb/guile/scm-objfile.c
index 8e94b96..080b905 100644
--- a/gdb/guile/scm-objfile.c
+++ b/gdb/guile/scm-objfile.c
@@ -252,6 +252,19 @@ gdbscm_objfile_filename (SCM self)
return gdbscm_scm_from_c_string (objfile_name (o_smob->objfile));
}
+/* (objfile-progspace <gdb:objfile>) -> <gdb:progspace>
+ Returns the objfile's progspace.
+ Throw's an exception if the underlying objfile is invalid. */
+
+static SCM
+gdbscm_objfile_progspace (SCM self)
+{
+ objfile_smob *o_smob
+ = ofscm_get_valid_objfile_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
+
+ return psscm_scm_from_pspace (o_smob->objfile->pspace);
+}
+
/* (objfile-pretty-printers <gdb:objfile>) -> list
Returns the list of pretty-printers for this objfile. */
@@ -388,6 +401,10 @@ Return #t if the objfile is valid (hasn't been deleted from gdb)." },
"\
Return the file name of the objfile." },
+ { "objfile-progspace", 1, 0, 0, gdbscm_objfile_progspace,
+ "\
+Return the progspace that the objfile lives in." },
+
{ "objfile-pretty-printers", 1, 0, 0, gdbscm_objfile_pretty_printers,
"\
Return a list of pretty-printers of the objfile." },