#| -*-Scheme-*-
-$Id: comcmp.scm,v 1.6 1999/12/20 23:07:27 cph Exp $
+$Id: comcmp.scm,v 1.7 2001/08/10 17:28:20 cph Exp $
-Copyright (c) 1989-1999 Massachusetts Institute of Technology
+Copyright (c) 1989-1999, 2001 Massachusetts Institute of Technology
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA.
|#
;;;; Compiled code binary comparison program
(define-macro (ucode-type name)
(microcode-type name))
-(define comcmp:ignore-debugging-info? true)
-(define comcmp:show-differing-blocks? false)
+(define comcmp:ignore-debugging-info? #t)
+(define comcmp:show-differing-blocks? #f)
(define (compare-code-blocks b1 b2)
(let ((memoizations '()))
(vector-ref y index))
(loop (1+ index))))))))
((compiled-code-block? x)
- (not (compare-blocks x y false)))
+ (not (compare-blocks x y #f)))
((compiled-code-address? x)
(and (= (compiled-entry/offset x)
(compiled-entry/offset y))
(not (compare-blocks
(compiled-entry/block x)
(compiled-entry/block y)
- false))))
+ #f))))
(else
- false))
+ #f))
(and (number? x)
(number? y)
(= x y)
(read-code b2 s2 e2)))
`(code))
(else
- false))))
+ #f))))
(define (read-code b s e)
(let ((bs (bit-string-allocate (* addressing-granularity (- e s)))))
;; Kludge!
(if comcmp:ignore-debugging-info?
(begin
- (set-compiled-code-block/debugging-info! b1 '())
- (set-compiled-code-block/debugging-info! b2 '())))
+ (set-compiled-code-block/debugging-info! b1 #f)
+ (set-compiled-code-block/debugging-info! b2 #f)))
(let ((s1 (compiled-code-block/constants-start b1))
(s2 (compiled-code-block/constants-start b2))
(else
diff))))
((null? diffs)
- false)
+ #f)
(else
(cons 'CONSTANTS (reverse! diffs)))))))))
(differ)))
(else
(differ))))))
- (compare-blocks b1 b2 true)))
+ (compare-blocks b1 b2 #t)))
(define (compare-com-files f1 f2 #!optional verbose?)
(let ((quiet? (or (default-object? verbose?) (not verbose?))))
#| -*-Scheme-*-
-$Id: dassm1.scm,v 4.19 1999/01/02 06:06:43 cph Exp $
+$Id: dassm1.scm,v 4.20 2001/08/10 17:28:55 cph Exp $
-Copyright (c) 1988-1999 Massachusetts Institute of Technology
+Copyright (c) 1988-1999, 2001 Massachusetts Institute of Technology
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA.
|#
;;;; Disassembler: User Level
(let ((symbol-table (and info (dbg-info/labels info))))
(write-string "Disassembly of ")
(write block)
- (let loop ((info (compiled-code-block/debugging-info block)))
- (cond ((string? info)
- (write-string " (")
- (write-string info)
- (write-string ")"))
- ((not (pair? info)))
- ((vector? (car info))
- (loop (cdr info)))
- (else
- (write-string " (Block ")
- (write (cdr info))
- (write-string " in ")
- (write-string (car info))
- (write-string ")"))))
+ (call-with-values
+ (lambda () (compiled-code-block/filename-and-index block))
+ (lambda (filename index)
+ (if filename
+ (begin
+ (write-string " (Block ")
+ (write index)
+ (write-string " in ")
+ (write-string filename)
+ (write-string ")")))))
(write-string ":\n")
(write-string "Code:\n\n")
(disassembler/write-instruction-stream
#| -*-Scheme-*-
-$Id: dassm1.scm,v 1.9 1999/01/02 06:06:43 cph Exp $
+$Id: dassm1.scm,v 1.10 2001/08/10 17:29:03 cph Exp $
-Copyright (c) 1992-1999 Massachusetts Institute of Technology
+Copyright (c) 1992-1999, 2001 Massachusetts Institute of Technology
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA.
|#
;;;; Disassembler: User Level
\f
;;; Flags that control disassembler behavior
-(define disassembler/symbolize-output? true)
-(define disassembler/compiled-code-heuristics? true)
-(define disassembler/write-offsets? true)
-(define disassembler/write-addresses? false)
+(define disassembler/symbolize-output? #t)
+(define disassembler/compiled-code-heuristics? #t)
+(define disassembler/write-offsets? #t)
+(define disassembler/write-addresses? #f)
;;;; Top level entries
(define (compiler:write-lap-file filename #!optional symbol-table?)
(let ((pathname (->pathname filename))
(symbol-table?
- (if (default-object? symbol-table?) true symbol-table?)))
+ (if (default-object? symbol-table?) #t symbol-table?)))
(with-output-to-file (pathname-new-type pathname "lap")
(lambda ()
(let ((com-file (pathname-new-type pathname "com")))
(define (compiler:disassemble entry)
(let ((block (compiled-entry/block entry)))
- (let ((info (compiled-code-block/dbg-info block true)))
- (fluid-let ((disassembler/write-offsets? true)
- (disassembler/write-addresses? true)
+ (let ((info (compiled-code-block/dbg-info block #t)))
+ (fluid-let ((disassembler/write-offsets? #t)
+ (disassembler/write-addresses? #t)
(disassembler/base-address (object-datum block)))
(newline)
(newline)
(let ((symbol-table (and info (dbg-info/labels info))))
(write-string "Disassembly of ")
(write block)
- (let loop ((info (compiled-code-block/debugging-info block)))
- (cond ((string? info)
- (write-string " (")
- (write-string info)
- (write-string ")"))
- ((not (pair? info)))
- ((vector? (car info))
- (loop (cdr info)))
- (else
- (write-string " (Block ")
- (write (cdr info))
- (write-string " in ")
- (write-string (car info))
- (write-string ")"))))
+ (call-with-values
+ (lambda () (compiled-code-block/filename-and-index block))
+ (lambda (filename index)
+ (if filename
+ (begin
+ (write-string " (Block ")
+ (write index)
+ (write-string " in ")
+ (write-string filename)
+ (write-string ")")))))
(write-string ":\n")
(write-string "Code:\n\n")
(disassembler/write-instruction-stream
symbol-table))
(define (disassembler/instructions/address start-address end-address)
- (disassembler/instructions false start-address end-address false))
+ (disassembler/instructions #f start-address end-address #f))
(define (disassembler/write-instruction-stream symbol-table instruction-stream)
(fluid-let ((*unparser-radix* 16))
(write-string " in ")
(write (compiled-code-address->block constant))
(write-string ")"))
- (else false)))
+ (else #f)))
\f
(define (disassembler/write-linkage-section block symbol-table index)
(let* ((field (object-datum (system-vector-ref block index)))
#| -*-Scheme-*-
-$Id: dassm1.scm,v 1.4 1999/01/02 06:06:43 cph Exp $
+$Id: dassm1.scm,v 1.5 2001/08/10 17:29:10 cph Exp $
-Copyright (c) 1988-1999 Massachusetts Institute of Technology
+Copyright (c) 1988-1999, 2001 Massachusetts Institute of Technology
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA.
|#
;;;; Disassembler: User Level
(let ((symbol-table (and info (dbg-info/labels info))))
(write-string "Disassembly of ")
(write block)
- (let loop ((info (compiled-code-block/debugging-info block)))
- (cond ((string? info)
- (write-string " (")
- (write-string info)
- (write-string ")"))
- ((not (pair? info)))
- ((vector? (car info))
- (loop (cdr info)))
- (else
- (write-string " (Block ")
- (write (cdr info))
- (write-string " in ")
- (write-string (car info))
- (write-string ")"))))
+ (call-with-values
+ (lambda () (compiled-code-block/filename-and-index block))
+ (lambda (filename index)
+ (if filename
+ (begin
+ (write-string " (Block ")
+ (write index)
+ (write-string " in ")
+ (write-string filename)
+ (write-string ")")))))
(write-string ":\n")
(write-string "Code:\n\n")
(disassembler/write-instruction-stream
#| -*-Scheme-*-
-$Id: dassm1.scm,v 4.19 1999/01/02 06:06:43 cph Exp $
+$Id: dassm1.scm,v 4.20 2001/08/10 17:29:18 cph Exp $
-Copyright (c) 1988-1999 Massachusetts Institute of Technology
+Copyright (c) 1988-1999, 2001 Massachusetts Institute of Technology
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA.
|#
;;;; Disassembler: User Level
(let ((symbol-table (and info (dbg-info/labels info))))
(write-string "Disassembly of ")
(write block)
- (let loop ((info (compiled-code-block/debugging-info block)))
- (cond ((string? info)
- (write-string " (")
- (write-string info)
- (write-string ")"))
- ((not (pair? info)))
- ((vector? (car info))
- (loop (cdr info)))
- (else
- (write-string " (Block ")
- (write (cdr info))
- (write-string " in ")
- (write-string (car info))
- (write-string ")"))))
+ (call-with-values
+ (lambda () (compiled-code-block/filename-and-index block))
+ (lambda (filename index)
+ (if filename
+ (begin
+ (write-string " (Block ")
+ (write index)
+ (write-string " in ")
+ (write-string filename)
+ (write-string ")")))))
(write-string ":\n")
(write-string "Code:\n\n")
(disassembler/write-instruction-stream