+2015-03-11 Andy Wingo <wingo@igalia.com>
+
+ * 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.
+
2015-03-11 Andy Wingo <wingo@igalia.com>
* guile/guile.c (_initialize_guile): Disable automatic
+2015-03-11 Andy Wingo <wingo@igalia.com>
+
+ * guile.texi (Objfiles In Guile): Document objfile-progspace.
+
2015-03-04 Pedro Alves <palves@redhat.com>
* gdb.texinfo (Remote Configuration): Document the "set/show
with symbolic links resolved.
@end deffn
+@deffn {Scheme Procedure} objfile-progspace objfile
+Return the @code{<gdb:progspace>} that this object file lives in.
+@xref{Progspaces In Guile}, for more on progspaces.
+@end deffn
+
@deffn {Scheme Procedure} objfile-pretty-printers objfile
Return the list of registered @code{<gdb:pretty-printer>} objects for
@var{objfile}. @xref{Guile Pretty Printing API}, for more information.
objfile?
objfile-valid?
objfile-filename
+ objfile-progspace
objfile-pretty-printers
set-objfile-pretty-printers!
current-objfile
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. */
"\
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." },
+2015-03-11 Andy Wingo <wingo@igalia.com>
+
+ * gdb.guile/scm-objfile.exp: Add objfile-progspace test.
+
2015-03-11 Yao Qi <yao.qi@linaro.org>
* gdb.base/catch-syscall.exp: Fix typo in comments.
gdb_test "gu (print (objfile-pretty-printers objfile))" \
"= \\(\\)"
+gdb_test "gu (print (eq? (current-progspace) (objfile-progspace objfile)))" \
+ "= #t"
+
gdb_test "guile (set-objfile-pretty-printers! objfile 0)" \
"ERROR: .*: Wrong type argument in position 2 \\(expecting list\\): 0.*"