diff options
Diffstat (limited to 'gdb/guile/lib')
-rw-r--r-- | gdb/guile/lib/gdb/boot.scm | 17 | ||||
-rw-r--r-- | gdb/guile/lib/gdb/init.scm | 6 |
2 files changed, 20 insertions, 3 deletions
diff --git a/gdb/guile/lib/gdb/boot.scm b/gdb/guile/lib/gdb/boot.scm index 6159354d209..9463f101638 100644 --- a/gdb/guile/lib/gdb/boot.scm +++ b/gdb/guile/lib/gdb/boot.scm @@ -21,9 +21,20 @@ ;; loaded with it are not compiled. So we do very little here, and do ;; most of the initialization elsewhere. -;; guile-data-directory is provided by the C code. -(add-to-load-path (guile-data-directory)) -(load-from-path "gdb.scm") +;; Initialize the source and compiled file search paths. +;; Note: 'guile-data-directory' is provided by the C code. +(let ((module-dir (guile-data-directory))) + (set! %load-path (cons module-dir %load-path)) + (set! %load-compiled-path (cons module-dir %load-compiled-path))) + +;; Load the (gdb) module. This needs to be done here because C code relies on +;; the availability of Scheme bindings such as '%print-exception-with-stack'. +;; Note: as of Guile 2.0.11, 'primitive-load' evaluates the code and 'load' +;; somehow ignores the '.go', hence 'load-compiled'. +(let ((gdb-go-file (search-path %load-compiled-path "gdb.go"))) + (if gdb-go-file + (load-compiled gdb-go-file) + (error "Unable to find gdb.go file."))) ;; Now that the Scheme side support is loaded, initialize it. (let ((init-proc (@@ (gdb) %initialize!))) diff --git a/gdb/guile/lib/gdb/init.scm b/gdb/guile/lib/gdb/init.scm index 98888ed3ac9..53cce2eddba 100644 --- a/gdb/guile/lib/gdb/init.scm +++ b/gdb/guile/lib/gdb/init.scm @@ -147,6 +147,12 @@ (set! %orig-input-port (set-current-input-port (input-port))) (set! %orig-output-port (set-current-output-port (output-port))) (set! %orig-error-port (set-current-error-port (error-port)))) + +;; Dummy routine to silence "possibly unused local top-level variable" +;; warnings from the compiler. + +(define-public (%silence-compiler-warnings%) + (list %print-exception-with-stack %initialize!)) ;; Public routines. |