Import gdb-7.10.1
[dragonfly.git] / contrib / gdb-7 / gdb / guile / lib / gdb / support.scm
1 ;; Internal support routines.
2 ;;
3 ;; Copyright (C) 2014-2015 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 (define-module (gdb support))
21
22 ;; Symbolic values for the ARG parameter of assert-type.
23
24 (define-public SCM_ARG1 1)
25 (define-public SCM_ARG2 2)
26
27 ;; Utility to check the type of an argument, akin to SCM_ASSERT_TYPE.
28
29 (define-public (assert-type test-result arg pos func-name expecting)
30   (if (not test-result)
31       (scm-error 'wrong-type-arg func-name
32                  "Wrong type argument in position ~a (expecting ~a): ~s"
33                  (list pos expecting arg) (list arg))))