diff options
author | Andy Wingo <wingo@igalia.com> | 2015-03-11 14:20:06 +0100 |
---|---|---|
committer | Andy Wingo <wingo@igalia.com> | 2015-03-11 14:20:06 +0100 |
commit | 85642ba08c459bb2f9d1e7beffa1871c9a93ca66 (patch) | |
tree | 23a625556fd3e2f894ac3d656f654ed8d2d8a0e8 /gdb/guile/scm-objfile.c | |
parent | 92fab5a61707cd3b487219ea9efa0e410cde3bc4 (diff) | |
download | gdb-85642ba08c459bb2f9d1e7beffa1871c9a93ca66.zip gdb-85642ba08c459bb2f9d1e7beffa1871c9a93ca66.tar.gz gdb-85642ba08c459bb2f9d1e7beffa1871c9a93ca66.tar.bz2 |
Add objfile-progspace to Guile interface
This commit adds an objfile-progspace accessor to the (gdb) Guile
module.
gdb/testsuite/ChangeLog:
* gdb.guile/scm-objfile.exp: Add objfile-progspace test.
gdb/doc/ChangeLog:
* guile.texi (Objfiles In Guile): Document objfile-progspace.
gdb/ChangeLog:
* guile/scm-objfile.c (gdbscm_objfile_progspace): New function.
(objfile_functions): Bind gdbscm_objfile_progspace to
objfile-progspace.
* guile/lib/gdb.scm: Add objfile-progspace to exports.
Diffstat (limited to 'gdb/guile/scm-objfile.c')
-rw-r--r-- | gdb/guile/scm-objfile.c | 17 |
1 files changed, 17 insertions, 0 deletions
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." }, |