Improve error when 'include' form with relative path is not in a file.
[bpt/guile.git] / module / scripts / disassemble.scm
1 ;;; Disassemble --- Disassemble .go files into something human-readable
2
3 ;; Copyright 2005, 2008, 2009, 2011 Free Software Foundation, Inc.
4 ;;
5 ;; This program is free software; you can redistribute it and/or
6 ;; modify it under the terms of the GNU Lesser General Public License
7 ;; as published by the Free Software Foundation; either version 3, or
8 ;; (at your option) any later version.
9 ;;
10 ;; This program is distributed in the hope that it will be useful,
11 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 ;; Lesser General Public License for more details.
14 ;;
15 ;; You should have received a copy of the GNU Lesser General Public
16 ;; License along with this software; see the file COPYING.LESSER. If
17 ;; not, write to the Free Software Foundation, Inc., 51 Franklin
18 ;; Street, Fifth Floor, Boston, MA 02110-1301 USA
19
20 ;;; Author: Ludovic Courtès <ludo@gnu.org>
21 ;;; Author: Andy Wingo <wingo@pobox.com>
22
23 ;;; Commentary:
24
25 ;; Usage: disassemble [ARGS]
26
27 ;;; Code:
28
29 (define-module (scripts disassemble)
30 #:use-module (system vm objcode)
31 #:use-module ((language assembly disassemble)
32 #:renamer (symbol-prefix-proc 'asm:))
33 #:export (disassemble))
34
35 (define %summary "Disassemble a compiled .go file.")
36
37 (define (disassemble . files)
38 (for-each (lambda (file)
39 (asm:disassemble (load-objcode file)))
40 files))
41
42 (define main disassemble)