Commit | Line | Data |
---|---|---|
ed3ef339 DE |
1 | ;; Various experimental utilities. |
2 | ;; Anything in this file can change or disappear. | |
3 | ;; | |
3666a048 | 4 | ;; Copyright (C) 2014-2021 Free Software Foundation, Inc. |
ed3ef339 DE |
5 | ;; |
6 | ;; This file is part of GDB. | |
7 | ;; | |
8 | ;; This program is free software; you can redistribute it and/or modify | |
9 | ;; it under the terms of the GNU General Public License as published by | |
10 | ;; the Free Software Foundation; either version 3 of the License, or | |
11 | ;; (at your option) any later version. | |
12 | ;; | |
13 | ;; This program is distributed in the hope that it will be useful, | |
14 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | ;; GNU General Public License for more details. | |
17 | ;; | |
18 | ;; You should have received a copy of the GNU General Public License | |
19 | ;; along with this program. If not, see <http://www.gnu.org/licenses/>. | |
20 | ||
21 | ;; TODO: Split this file up by function? | |
22 | ;; E.g., (gdb experimental ports), etc. | |
23 | ||
24 | (define-module (gdb experimental) | |
186fcde0 | 25 | #:use-module (gdb)) |
ed3ef339 DE |
26 | |
27 | ;; These are defined in C. | |
28 | (define-public with-gdb-output-to-port (@@ (gdb) %with-gdb-output-to-port)) | |
29 | (define-public with-gdb-error-to-port (@@ (gdb) %with-gdb-error-to-port)) | |
30 | ||
31 | (define-public (with-gdb-output-to-string thunk) | |
32 | "Calls THUNK and returns all GDB output as a string." | |
33 | (call-with-output-string | |
34 | (lambda (p) (with-gdb-output-to-port p thunk)))) |