source: branches/working-0711/ccl/lib/backtrace-lds.lisp @ 8023

Last change on this file since 8023 was 8023, checked in by gb, 13 years ago

FRAME-SUPPLIED-ARGS: return actual argument values if PC is before/at target::arg-check-trap-pc-limit.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.1 KB
Line 
1;;;-*-Mode: LISP; Package: CCL -*-
2;;;
3;;;   Copyright (C) 1994-2001 Digitool, Inc
4;;;   This file is part of OpenMCL. 
5;;;
6;;;   OpenMCL is licensed under the terms of the Lisp Lesser GNU Public
7;;;   License , known as the LLGPL and distributed with OpenMCL as the
8;;;   file "LICENSE".  The LLGPL consists of a preamble and the LGPL,
9;;;   which is distributed with OpenMCL as the file "LGPL".  Where these
10;;;   conflict, the preamble takes precedence. 
11;;;
12;;;   OpenMCL is referenced in the preamble as the "LIBRARY."
13;;;
14;;;   The LLGPL is also available online at
15;;;   http://opensource.franz.com/preamble.html
16
17;;; backtrace-lds.lisp
18;;; low-level support for stack-backtrace dialog (Lisp Development System)
19
20(in-package "CCL")
21
22
23(defparameter *saved-register-count*
24  #+x8664-target 4
25  #+ppc-target 8)
26
27(defparameter *saved-register-names*
28  #+x8664-target #(save3 save2 save1 save0)
29  #+ppc-target #(save7 save6 save5 save4 save3 save2 save1 save0))
30
31
32;;; Returns three values: (ARG-VALUES TYPES NAMES), solely for the benefit
33;;; of the FRAME-ARGUMENTS function in SLIME's swank-openmcl.lisp.
34;;; ARG-VALUES is a list of the values of the args supplied to the function
35;;; TYPES is a list of (for bad historical reasons) strings .describing
36;;;   whether they're "required", "optional", etc.  SLIME only really
37;;;   cares about whether this is equal to "keyword" or not.
38;;; NAMES is a list of symbols which name the args.
39(defun frame-supplied-args (frame lfun pc child context)
40  (declare (ignore child))
41  (if (<= pc target::arg-check-trap-pc-limit)
42    (values (arg-check-call-arguments frame lfun) nil nil)
43    (let* ((arglist (arglist-from-map lfun))
44           (args (arguments-and-locals context frame lfun pc))
45           (state :required))
46      (collect ((arg-values)
47                (types)
48                (names))
49        (dolist (arg arglist)
50          (if (or (member arg lambda-list-keywords)
51                  (eq arg '&lexpr))
52            (setq state arg)
53            (let* ((pair (pop args)))
54              (case state
55                (&lexpr
56                 (with-list-from-lexpr (rest (cdr pair))
57                   (dolist (r rest) (arg-values r) (names nil) (types nil)))
58                 (return))
59                (&rest
60                 (dolist (r (cdr pair)) (arg-values r) (names nil) (types nil))
61                 (return))
62                (&key
63                 (arg-values arg)
64                 (names nil)
65                 (types nil)))
66              (let* ((value (cdr pair)))
67                (if (eq value (%unbound-marker))
68                  (return))
69                (names (car pair))
70                (arg-values value)
71                (types nil)))))
72        (values (arg-values) (types) (names))))))
73
74
75#|
76(setq *save-local-symbols* t)
77
78(defun test (flip flop &optional bar)
79  (let ((another-one t)
80        (bar 'quux))
81    (break)))
82
83(test '(a b c d) #\a)
84
85(defun closure-test (flim flam)
86  (labels ((inner (x)
87              (let ((ret (list x flam)))
88                (break))))
89    (inner flim)
90    (break)))
91
92(closure-test '(a b c) 'quux)
93
94(defun set-test (a b)
95  (break)
96  (+ a b))
97
98(set-test 1 'a)
99
100||#
101
102
103(provide 'backtrace-lds)
104
105; End of backtrace-lds.lisp
Note: See TracBrowser for help on using the repository browser.