boot.scm revision 1.7
1;; Bootstrap the Scheme side of the gdb module.
2;;
3;; Copyright (C) 2014-2020 Free Software Foundation, Inc.
4;;
5;; This file is part of GDB.
6;;
7;; This program is free software; you can redistribute it and/or modify
8;; it under the terms of the GNU General Public License as published by
9;; the Free Software Foundation; either version 3 of the License, or
10;; (at your option) any later version.
11;;
12;; This program is distributed in the hope that it will be useful,
13;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15;; GNU General Public License for more details.
16;;
17;; You should have received a copy of the GNU General Public License
18;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
20;; This file is loaded with scm_c_primitive_load, which is ok, but files
21;; loaded with it are not compiled.  So we do very little here, and do
22;; most of the initialization elsewhere.
23
24;; Initialize the source and compiled file search paths.
25;; Note: 'guile-data-directory' is provided by the C code.
26(let ((module-dir (guile-data-directory)))
27  (set! %load-path (cons module-dir %load-path))
28  (set! %load-compiled-path (cons module-dir %load-compiled-path)))
29
30;; Load the (gdb) module.  This needs to be done here because C code relies on
31;; the availability of Scheme bindings such as '%print-exception-with-stack'.
32;; Note: as of Guile 2.0.11, 'primitive-load' evaluates the code and 'load'
33;; somehow ignores the '.go', hence 'load-compiled'.
34(let ((gdb-go-file (search-path %load-compiled-path "gdb.go")))
35  (if gdb-go-file
36      (load-compiled gdb-go-file)
37      (error "Unable to find gdb.go file.")))
38
39;; Now that the Scheme side support is loaded, initialize it.
40(let ((init-proc (@@ (gdb) %initialize!)))
41  (init-proc))
42