diff options
author | Doug Evans <xdje42@gmail.com> | 2014-06-02 23:46:27 -0700 |
---|---|---|
committer | Doug Evans <xdje42@gmail.com> | 2014-06-02 23:46:27 -0700 |
commit | ded0378278c7bbd5c6049446032b28196a5cfb38 (patch) | |
tree | 783ba05381595d6a6d4f95f693848614d3671f2b /gdb/doc | |
parent | 397998fc32a34d3c8993ef46da45c3957a4dd402 (diff) | |
download | gdb-ded0378278c7bbd5c6049446032b28196a5cfb38.zip gdb-ded0378278c7bbd5c6049446032b28196a5cfb38.tar.gz gdb-ded0378278c7bbd5c6049446032b28196a5cfb38.tar.bz2 |
Add progspace support for Guile.
* Makefile.in (SUBDIR_GUILE_OBS): Add scm-progspace.o.
(SUBDIR_GUILE_SRCS): Add scm-progspace.c.
(scm-progspace.o): New rule.
* guile/guile-internal.h (pspace_smob): New typedef.
(psscm_pspace_smob_pretty_printers): Declare.
(psscm_pspace_smob_from_pspace): Declare.
(psscm_scm_from_pspace): Declare.
* guile/guile.c (initialize_gdb_module): Call
gdbscm_initialize_pspaces.
* guile/lib/gdb.scm: Export progspace symbols.
* guile/lib/gdb/printing.scm (prepend-pretty-printer!): Add progspace
support.
(append-pretty-printer!): Ditto.
* guile/scm-pretty-print.c (ppscm_find_pretty_printer_from_progspace):
Implement.
* guile/scm-progspace.c: New file.
doc/
* guile.texi (Guile API): Add entry for Progspaces In Guile.
(GDB Scheme Data Types): Mention <gdb:progspace> object.
(Progspaces In Guile): New node.
testsuite/
* gdb.guile/scm-pretty-print.exp: Add tests for objfile and progspace
pretty-printer lookup.
* gdb.guile/scm-pretty-print.scm (pp_s-printer): New function.
(make-pp_s-printer): Call it.
(make-pretty-printer-from-dict): New function.
(lookup-pretty-printer-maker-from-dict): New function.
(*pretty-printer*): Simplify.
(make-objfile-pp_s-printer): New function.
(install-objfile-pretty-printers!): New function.
(make-progspace-pp_s-printer): New function.
(install-progspace-pretty-printers!): New function.
* gdb.guile/scm-progspace.c: New file.
* gdb.guile/scm-progspace.exp: New file.
Diffstat (limited to 'gdb/doc')
-rw-r--r-- | gdb/doc/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/doc/guile.texi | 78 |
2 files changed, 84 insertions, 0 deletions
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 1a07a82..cbe00db 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,9 @@ +2014-06-02 Doug Evans <xdje42@gmail.com> + + * guile.texi (Guile API): Add entry for Progspaces In Guile. + (GDB Scheme Data Types): Mention <gdb:progspace> object. + (Progspaces In Guile): New node. + 2014-05-30 Andrew Burgess <aburgess@broadcom.com> * guile.texi (Frames In Guile): Mention FRAME_UNWIND_MEMORY_ERROR. diff --git a/gdb/doc/guile.texi b/gdb/doc/guile.texi index bc2a2ce..23c8398 100644 --- a/gdb/doc/guile.texi +++ b/gdb/doc/guile.texi @@ -141,6 +141,7 @@ from the Guile interactive prompt. * Guile Pretty Printing API:: Pretty-printing values with Guile * Selecting Guile Pretty-Printers:: How GDB chooses a pretty-printer * Writing a Guile Pretty-Printer:: Writing a pretty-printer +* Progspaces In Guile:: Program spaces * Objfiles In Guile:: Object files in Guile * Frames In Guile:: Accessing inferior stack frames from Guile * Blocks In Guile:: Accessing blocks from Guile @@ -378,6 +379,9 @@ as a symbol. @item <gdb:pretty-printer-worker> @xref{Guile Pretty Printing API}. +@item <gdb:progspace> +@xref{Progspaces In Guile}. + @item <gdb:symbol> @xref{Symbols In Guile}. @@ -406,6 +410,7 @@ Scheme function @code{eq?} may be applied to them. @item <gdb:breakpoint> @item <gdb:frame> @item <gdb:objfile> +@item <gdb:progspace> @item <gdb:symbol> @item <gdb:symtab> @item <gdb:type> @@ -1660,6 +1665,79 @@ my_library.so: bar @end smallexample +@node Progspaces In Guile +@subsubsection Program Spaces In Guile + +@cindex progspaces in guile +@tindex <gdb:progspace> +A program space, or @dfn{progspace}, represents a symbolic view +of an address space. +It consists of all of the objfiles of the program. +@xref{Objfiles In Guile}. +@xref{Inferiors and Programs, program spaces}, for more details +about program spaces. + +Each progspace is represented by an instance of the @code{<gdb:progspace>} +smob. @xref{GDB Scheme Data Types}. + +The following progspace-related functions are available in the +@code{(gdb)} module: + +@deffn {Scheme Procedure} progspace? object +Return @code{#t} if @var{object} is a @code{<gdb:progspace>} object. +Otherwise return @code{#f}. +@end deffn + +@deffn {Scheme Procedure} progspace-valid? progspace +Return @code{#t} if @var{progspace} is valid, @code{#f} if not. +A @code{<gdb:progspace>} object can become invalid +if the program it refers to is not loaded in @value{GDBN} any longer. +@end deffn + +@deffn {Scheme Procedure} current-progspace +This function returns the program space of the currently selected inferior. +There is always a current progspace, this never returns @code{#f}. +@xref{Inferiors and Programs}. +@end deffn + +@deffn {Scheme Procedure} progspaces +Return a list of all the progspaces currently known to @value{GDBN}. +@end deffn + +@deffn {Scheme Procedure} progspace-filename progspace +Return the absolute file name of @var{progspace} as a string. +This is the name of the file passed as the argument to the @code{file} +or @code{symbol-file} commands. +If the program space does not have an associated file name, +then @code{#f} is returned. This occurs, for example, when @value{GDBN} +is started without a program to debug. + +A @code{gdb:invalid-object-error} exception is thrown if @var{progspace} +is invalid. +@end deffn + +@deffn {Scheme Procedure} progspace-objfiles progspace +Return the list of objfiles of @var{progspace}. +The order of objfiles in the result is arbitrary. +Each element is an object of type @code{<gdb:objfile>}. +@xref{Objfiles In Guile}. + +A @code{gdb:invalid-object-error} exception is thrown if @var{progspace} +is invalid. +@end deffn + +@deffn {Scheme Procedure} progspace-pretty-printers progspace +Return the list of pretty-printers of @var{progspace}. +Each element is an object of type @code{<gdb:pretty-printer>}. +@xref{Guile Pretty Printing API}, for more information. +@end deffn + +@deffn {Scheme Procedure} set-progspace-pretty-printers! progspace printer-list +Set the list of registered @code{<gdb:pretty-printer>} objects for +@var{progspace} to @var{printer-list}. +@xref{Guile Pretty Printing API}, for more information. +@end deffn + @node Objfiles In Guile @subsubsection Objfiles In Guile |