/[cmucl]/src/code/debug-vm.lisp
ViewVC logotype

Contents of /src/code/debug-vm.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations)
Mon Aug 12 08:12:18 1991 UTC (22 years, 8 months ago) by chiles
Branch: MAIN
Initial revision
1 ;;; -*- Package: VM -*-
2 ;;;
3 ;;; **********************************************************************
4 ;;; This code was written as part of the CMU Common Lisp project at
5 ;;; Carnegie Mellon University, and has been placed in the public domain.
6 ;;; If you want to use this code or any part of CMU Common Lisp, please contact
7 ;;; Scott Fahlman or slisp-group@cs.cmu.edu.
8 ;;;
9 (ext:file-comment
10 "$Header: /tiger/var/lib/cvsroots/cmucl/src/code/debug-vm.lisp,v 1.1 1991/08/12 08:12:18 chiles Exp $")
11 ;;;
12 ;;; **********************************************************************
13 ;;;
14 ;;; This is some very low-level support for the debugger :function-end
15 ;;; breakpoints.
16 ;;;
17 ;;; Written by William Lott.
18 ;;;
19
20 (in-package "VM")
21
22 (export '(make-bogus-lra))
23
24 (defconstant bogus-lra-constants 2)
25 (defconstant real-lra-slot (+ code-constants-offset 0))
26 (defconstant known-return-p-slot (+ code-constants-offset 1))
27
28 ;;; MAKE-BOGUS-LRA -- Interface.
29 ;;;
30 (defun make-bogus-lra (real-lra &optional known-return-p)
31 "Make a bogus LRA object that signals a breakpoint trap when returned to. If
32 the breakpoint trap handler returns to the fake component, the fake code
33 template returns to real-lra. This returns three values: the bogus LRA
34 object, the code component it points to, and the pc-offset for the trap
35 instruction."
36 (system:without-gcing
37 (let* ((src-start (truly-the system-area-pointer
38 (%primitive foreign-symbol-address
39 "function_end_breakpoint_guts")))
40 (src-end (truly-the system-area-pointer
41 (%primitive foreign-symbol-address
42 "function_end_breakpoint_end")))
43 (trap-loc (truly-the system-area-pointer
44 (%primitive foreign-symbol-address
45 "function_end_breakpoint_trap")))
46 (length (sap- src-end src-start))
47 (code-object (%primitive allocate-code-object
48 (1+ bogus-lra-constants)
49 length))
50 (dst-start (code-instructions code-object)))
51 (declare (type system-area-pointer src-start src-end dst-start trap-loc)
52 (type index length))
53 (setf (code-header-ref code-object code-debug-info-slot) nil)
54 (setf (code-header-ref code-object code-trace-table-offset-slot) length)
55 (setf (code-header-ref code-object real-lra-slot) real-lra)
56 (setf (code-header-ref code-object known-return-p-slot) known-return-p)
57 (system-area-copy src-start 0 dst-start 0 (* length byte-bits))
58 (let ((new-lra
59 (make-lisp-obj (+ (sap-int dst-start) other-pointer-type))))
60 (kernel:set-header-data new-lra
61 (logandc2 (+ code-constants-offset
62 bogus-lra-constants
63 1)
64 1))
65 (values new-lra
66 code-object
67 (sap- trap-loc src-start))))))

  ViewVC Help
Powered by ViewVC 1.1.5