Commit | Line | Data |
---|---|---|
72f74528 AW |
1 | #!/bin/sh |
2 | # -*- scheme -*- | |
3 | exec ${GUILE-guile} -e '(@ (scripts disassemble) disassemble)' -s $0 "$@" | |
4 | !# | |
5 | ;;; Disassemble --- Disassemble .go files into something human-readable | |
6 | ||
7 | ;; Copyright 2005,2008 Free Software Foundation, Inc. | |
8 | ;; | |
9 | ;; This program is free software; you can redistribute it and/or | |
10 | ;; modify it under the terms of the GNU General Public License as | |
11 | ;; published by the Free Software Foundation; either version 2, or | |
12 | ;; (at your option) any later version. | |
13 | ;; | |
14 | ;; This program is distributed in the hope that it will be useful, | |
15 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
17 | ;; General Public License for more details. | |
18 | ;; | |
19 | ;; You should have received a copy of the GNU General Public License | |
20 | ;; along with this software; see the file COPYING. If not, write to | |
21 | ;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | |
22 | ;; Boston, MA 02110-1301 USA | |
23 | ||
24 | ;;; Author: Ludovic Courtès <ludovic.courtes@laas.fr> | |
25 | ;;; Author: Andy Wingo <wingo@pobox.com> | |
26 | ||
27 | ;;; Commentary: | |
28 | ||
29 | ;; Usage: disassemble [ARGS] | |
30 | ||
31 | ;;; Code: | |
32 | ||
33 | (define-module (scripts disassemble) | |
34 | #:use-module (system vm objcode) | |
35 | #:use-module (system vm disasm) | |
36 | #:export (disassemble)) | |
37 | ||
38 | (define (disassemble args) | |
39 | (for-each (lambda (file) | |
40 | (disassemble-objcode (load-objcode file))) | |
41 | (cdr args))) |