aboutsummaryrefslogtreecommitdiff
path: root/gdb/guile/lib
diff options
context:
space:
mode:
authorDoug Evans <xdje42@gmail.com>2014-06-02 23:46:27 -0700
committerDoug Evans <xdje42@gmail.com>2014-06-02 23:46:27 -0700
commitded0378278c7bbd5c6049446032b28196a5cfb38 (patch)
tree783ba05381595d6a6d4f95f693848614d3671f2b /gdb/guile/lib
parent397998fc32a34d3c8993ef46da45c3957a4dd402 (diff)
downloadgdb-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/guile/lib')
-rw-r--r--gdb/guile/lib/gdb.scm11
-rw-r--r--gdb/guile/lib/gdb/printing.scm21
2 files changed, 24 insertions, 8 deletions
diff --git a/gdb/guile/lib/gdb.scm b/gdb/guile/lib/gdb.scm
index abc4a67..646ca81 100644
--- a/gdb/guile/lib/gdb.scm
+++ b/gdb/guile/lib/gdb.scm
@@ -271,6 +271,17 @@
make-pretty-printer-worker
pretty-printer-worker?
+ ;; scm-progspace.c
+
+ progspace?
+ progspace-valid?
+ progspace-filename
+ progspace-objfiles
+ progspace-pretty-printers
+ set-progspace-pretty-printers!
+ current-progspace
+ progspaces
+
;; scm-gsmob.c
gdb-object-kind
diff --git a/gdb/guile/lib/gdb/printing.scm b/gdb/guile/lib/gdb/printing.scm
index 2944702..eac9417 100644
--- a/gdb/guile/lib/gdb/printing.scm
+++ b/gdb/guile/lib/gdb/printing.scm
@@ -19,8 +19,9 @@
(define-module (gdb printing)
#:use-module ((gdb) #:select
- (*pretty-printers* pretty-printer? objfile?
- objfile-pretty-printers set-objfile-pretty-printers!))
+ (*pretty-printers* pretty-printer? objfile? progspace?
+ objfile-pretty-printers set-objfile-pretty-printers!
+ progspace-pretty-printers set-progspace-pretty-printers!))
#:use-module (gdb init))
(define-public (prepend-pretty-printer! obj matcher)
@@ -31,9 +32,11 @@ If OBJ is #f, add MATCHER to the global list."
(cond ((eq? obj #f)
(set! *pretty-printers* (cons matcher *pretty-printers*)))
((objfile? obj)
- (set-objfile-pretty-printers! obj
- (cons matcher
- (objfile-pretty-printers obj))))
+ (set-objfile-pretty-printers!
+ obj (cons matcher (objfile-pretty-printers obj))))
+ ((progspace? obj)
+ (set-progspace-pretty-printers!
+ obj (cons matcher (progspace-pretty-printers obj))))
(else
(%assert-type #f obj SCM_ARG1 'prepend-pretty-printer!))))
@@ -45,8 +48,10 @@ If OBJ is #f, add MATCHER to the global list."
(cond ((eq? obj #f)
(set! *pretty-printers* (append! *pretty-printers* (list matcher))))
((objfile? obj)
- (set-objfile-pretty-printers! obj
- (append! (objfile-pretty-printers obj)
- (list matcher))))
+ (set-objfile-pretty-printers!
+ obj (append! (objfile-pretty-printers obj) (list matcher))))
+ ((progspace? obj)
+ (set-progspace-pretty-printers!
+ obj (append! (progspace-pretty-printers obj) (list matcher))))
(else
(%assert-type #f obj SCM_ARG1 'append-pretty-printer!))))