From f41da6416d9468cf121db0ddafb6f2f17a10deb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=BCbinette=20=28Hubbe=29?= <hubbe@hubbe.net> Date: Wed, 17 Mar 1999 13:51:32 -0800 Subject: [PATCH] more debug Rev: src/interpret.c:1.117 Rev: src/interpreter.h:1.3 --- src/interpret.c | 27 ++++++++++++++++++++++++++- src/interpreter.h | 4 ++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/interpret.c b/src/interpret.c index a797e15745..af8c7af244 100644 --- a/src/interpret.c +++ b/src/interpret.c @@ -5,7 +5,7 @@ \*/ /**/ #include "global.h" -RCSID("$Id: interpret.c,v 1.116 1999/03/02 03:13:16 hubbe Exp $"); +RCSID("$Id: interpret.c,v 1.117 1999/03/17 21:51:30 hubbe Exp $"); #include "interpret.h" #include "object.h" #include "program.h" @@ -817,6 +817,30 @@ void mega_apply2(enum apply_type type, INT32 args, void *arg1, void *arg2) function = new_frame->context.prog->identifiers + ref->identifier_offset; +#ifdef PIKE_DEBUG + if(t_flag > 9) + { + fprintf(stderr,"-- ref: inoff=%d idoff=%d flags=%d\n", + ref->inherit_offset, + ref->identifier_offset, + ref->id_flags); + + fprintf(stderr,"-- context: prog->id=%d inlev=%d idlev=%d pi=%d po=%d so=%d name=%s\n", + new_frame->context.prog->id, + new_frame->context.inherit_level, + new_frame->context.identifier_level, + new_frame->context.parent_identifier, + new_frame->context.parent_offset, + new_frame->context.storage_offset, + new_frame->context.name ? new_frame->context.name->str : "NULL"); + if(t_flag>19) + { + describe(new_frame->context.prog); + } + } +#endif + + #ifdef PIKE_SECURITY CHECK_DATA_SECURITY_OR_ERROR(o, SECURITY_BIT_CALL, ("Function call permission denied.\n")); @@ -845,6 +869,7 @@ void mega_apply2(enum apply_type type, INT32 args, void *arg1, void *arg2) if(t_flag) { char buf[50]; + init_buf(); sprintf(buf,"%lx->",(long)o); my_strcat(buf); diff --git a/src/interpreter.h b/src/interpreter.h index 6a1c7130ac..591fd2caef 100644 --- a/src/interpreter.h +++ b/src/interpreter.h @@ -971,6 +971,10 @@ static int eval_instruction(unsigned char *pc) /* More stack sabotage */ sp[-args-1].u.object=fp->current_object; sp[-args-1].subtype=GET_ARG()+fp->context.identifier_level; +#ifdef PIKE_DEBUG + if(t_flag > 9) + fprintf(stderr,"- IDENTIFIER_LEVEL: %d\n",fp->context.identifier_level); +#endif sp[-args-1].type=T_FUNCTION; add_ref(fp->current_object); -- GitLab