diff options
| author | Richard M. Stallman | 1999-11-01 23:19:20 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1999-11-01 23:19:20 +0000 |
| commit | 15934ffa0e165d784d2b306fe6649ef41ed06773 (patch) | |
| tree | f70cce8e604fb7fa9e2d34c482bfa8b2478f1600 /src | |
| parent | 4742f5240c0f7446cd15eb9d34e5a4e376e6d1ad (diff) | |
| download | emacs-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.c | 12 |
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 | ||
| 86 | struct catchtag *catchlist; | 86 | struct catchtag *catchlist; |
| 87 | 87 | ||
| 88 | #ifdef DEBUG_GCPRO | ||
| 89 | /* Count levels of GCPRO to detect failure to UNGCPRO. */ | ||
| 90 | int gcpro_level; | ||
| 91 | #endif | ||
| 92 | |||
| 88 | Lisp_Object Qautoload, Qmacro, Qexit, Qinteractive, Qcommandp, Qdefun; | 93 | Lisp_Object Qautoload, Qmacro, Qexit, Qinteractive, Qcommandp, Qdefun; |
| 89 | Lisp_Object Qinhibit_quit, Vinhibit_quit, Vquit_flag; | 94 | Lisp_Object Qinhibit_quit, Vinhibit_quit, Vquit_flag; |
| 90 | Lisp_Object Qmocklisp_arguments, Vmocklisp_arguments, Qmocklisp; | 95 | Lisp_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 | ||