2 Copyright (C) 1985, 1986, 1987, 1992, 1993 Free Software Foundation, Inc.
4 This file is part of XEmacs.
6 XEmacs is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 You should have received a copy of the GNU General Public License
17 along with XEmacs; see the file COPYING. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
21 /* Synched up with: FSF 19.30. Contained redundantly in various C files
26 FSF: Original version; a long time ago.
27 XEmacs: split out of some C files. (For some obscure reason, a header
28 file couldn't be used in FSF Emacs, but XEmacs doesn't have
30 Mly (probably) or JWZ: Some changes.
33 #ifndef _XEMACS_BACKTRACE_H_
34 #define _XEMACS_BACKTRACE_H_
38 /* These definitions are used in eval.c and alloc.c */
42 struct backtrace *next;
43 Lisp_Object *function;
44 Lisp_Object *args; /* Points to vector of args. */
45 int nargs; /* Length of vector.
46 If nargs is UNEVALLED, args points to
47 slot holding list of unevalled args */
48 int pdlcount; /* specpdl_depth () when invoked */
50 /* The value of a Lisp integer that specifies the symbol being
51 "invoked" by this node in the backtrace, or 0 if the backtrace
52 doesn't correspond to a such an invocation */
56 /* Nonzero means call value of debugger when done with this operation. */
60 /* This structure helps implement the `catch' and `throw' control
61 structure. A struct catchtag contains all the information needed
62 to restore the state of the interpreter after a non-local jump.
64 Handlers for error conditions (represented by `struct handler'
65 structures) just point to a catch tag to do the cleanup required
68 catchtag structures are chained together in the C calling stack;
69 the `next' member points to the next outer catchtag.
71 A call like (throw TAG VAL) searches for a catchtag whose `tag'
72 member is TAG, and then unbinds to it. The `val' member is used to
73 hold VAL while the stack is unwound; `val' is returned as the value
76 All the other members are concerned with restoring the interpreter
83 struct catchtag *next;
86 struct backtrace *backlist;
89 struct handler *handlerlist;
94 /* This is the equivalent of async_timer_suppress_count.
95 We probably don't have to bother with this. */
96 int poll_suppress_count;
100 /* Dynamic-binding-o-rama */
102 /* Structure for recording Lisp call stack for backtrace purposes. */
104 /* The special binding stack holds the outer values of variables while
105 they are bound by a function application or a let form, stores the
106 code to be executed for Lisp unwind-protect forms, and stores the C
107 functions to be called for record_unwind_protect.
109 If func is non-zero, undoing this binding applies func to old_value;
110 This implements record_unwind_protect.
111 If func is zero and symbol is nil, undoing this binding evaluates
112 the list of forms in old_value; this implements Lisp's unwind-protect
114 Otherwise, undoing this binding stores old_value as symbol's value; this
115 undoes the bindings made by a let form or function call. */
119 Lisp_Object symbol, old_value;
120 Lisp_Object (*func) (Lisp_Object); /* for unwind-protect */
125 /* Everything needed to describe an active condition case. */
128 /* The handler clauses and variable from the condition-case form. */
131 /* Fsignal stores here the condition-case clause that applies,
132 and Fcondition_case thus knows which clause to run. */
133 Lisp_Object chosen_clause;
135 /* Used to effect the longjump out to the handler. */
136 struct catchtag *tag;
138 /* The next enclosing handler. */
139 struct handler *next;
142 extern struct handler *handlerlist;
146 /* These are extern because GC needs to mark them */
147 extern struct specbinding *specpdl;
148 extern struct specbinding *specpdl_ptr;
149 extern struct catchtag *catchlist;
150 extern struct backtrace *backtrace_list;
152 #endif /* _XEMACS_BACKTRACE_H_ */