aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1999-11-01 23:19:20 +0000
committerRichard M. Stallman1999-11-01 23:19:20 +0000
commit15934ffa0e165d784d2b306fe6649ef41ed06773 (patch)
treef70cce8e604fb7fa9e2d34c482bfa8b2478f1600 /src
parent4742f5240c0f7446cd15eb9d34e5a4e376e6d1ad (diff)
downloademacs-15934ffa0e165d784d2b306fe6649ef41ed06773.tar.gz
emacs-15934ffa0e165d784d2b306fe6649ef41ed06773.zip
[DEBUG_GCPRO] (gcpro_level): New variable.
(init_eval) [DEBUG_GCPRO]: Initialize it. (unwind_to_catch) [DEBUG_GCPRO]: Set gcpro_level from remaining gcprolist.
Diffstat (limited to 'src')
-rw-r--r--src/eval.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/eval.c b/src/eval.c
index 59150df232a..4245f72c0ed 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -85,6 +85,11 @@ struct catchtag
85 85
86struct catchtag *catchlist; 86struct catchtag *catchlist;
87 87
88#ifdef DEBUG_GCPRO
89/* Count levels of GCPRO to detect failure to UNGCPRO. */
90int gcpro_level;
91#endif
92
88Lisp_Object Qautoload, Qmacro, Qexit, Qinteractive, Qcommandp, Qdefun; 93Lisp_Object Qautoload, Qmacro, Qexit, Qinteractive, Qcommandp, Qdefun;
89Lisp_Object Qinhibit_quit, Vinhibit_quit, Vquit_flag; 94Lisp_Object Qinhibit_quit, Vinhibit_quit, Vquit_flag;
90Lisp_Object Qmocklisp_arguments, Vmocklisp_arguments, Qmocklisp; 95Lisp_Object Qmocklisp_arguments, Vmocklisp_arguments, Qmocklisp;
@@ -185,6 +190,7 @@ init_eval ()
185 Vquit_flag = Qnil; 190 Vquit_flag = Qnil;
186 debug_on_next_call = 0; 191 debug_on_next_call = 0;
187 lisp_eval_depth = 0; 192 lisp_eval_depth = 0;
193 gcpro_level = 0;
188 /* This is less than the initial value of num_nonmacro_input_events. */ 194 /* This is less than the initial value of num_nonmacro_input_events. */
189 when_entered_debugger = -1; 195 when_entered_debugger = -1;
190} 196}
@@ -967,6 +973,12 @@ unwind_to_catch (catch, value)
967 while (! last_time); 973 while (! last_time);
968 974
969 gcprolist = catch->gcpro; 975 gcprolist = catch->gcpro;
976#ifdef DEBUG_GCPRO
977 if (gcprolist != 0)
978 gcpro_level = gcprolist->level + 1;
979 else
980 gcpro_level = 0;
981#endif
970 backtrace_list = catch->backlist; 982 backtrace_list = catch->backlist;
971 lisp_eval_depth = catch->lisp_eval_depth; 983 lisp_eval_depth = catch->lisp_eval_depth;
972 984