Branch: Tag:

2003-03-21

2003-03-21 14:36:01 by Martin Stjernholm <mast@lysator.liu.se>

Slightly less clumsy implementation of the opcode debug prologue stuff.

Rev: src/code/ia32.c:1.30
Rev: src/interpret.c:1.298
Rev: src/interpret.h:1.134

2:   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: interpret.c,v 1.297 2003/03/20 17:43:42 mast Exp $ + || $Id: interpret.c,v 1.298 2003/03/21 14:36:01 mast Exp $   */      #include "global.h" - RCSID("$Id: interpret.c,v 1.297 2003/03/20 17:43:42 mast Exp $"); + RCSID("$Id: interpret.c,v 1.298 2003/03/21 14:36:01 mast Exp $");   #include "interpret.h"   #include "object.h"   #include "program.h"
702:   struct backlog backlog[BACKLOG];   int backlogp=BACKLOG-1;    - static inline void low_debug_instr_prologue (PIKE_OPCODE_T *pc, PIKE_INSTR_T instr) + static inline void low_debug_instr_prologue (PIKE_INSTR_T instr)   {    if(Pike_interpreter.trace_level > 2)    {
710:    struct pike_string *filep;    INT32 linep;    -  filep = get_line(pc,Pike_fp->context.prog,&linep); +  filep = get_line(Pike_fp->pc,Pike_fp->context.prog,&linep);    if (filep && !filep->size_shift) {    file = filep->str;    while((f=STRCHR(file,'/')))
719:    fprintf(stderr,"- %s:%4ld:(%"PRINTPTRDIFFT"d): "    "%-25s %4"PRINTPTRDIFFT"d %4"PRINTPTRDIFFT"d\n",    file ? file : "-",(long)linep, -  pc-Pike_fp->context.prog->program, +  Pike_fp->pc - Pike_fp->context.prog->program,    get_opcode_name(instr),    Pike_sp-Pike_interpreter.evaluator_stack,    Pike_mark_sp-Pike_interpreter.mark_stack);
747:    backlog[backlogp].program=Pike_fp->context.prog;    add_ref(Pike_fp->context.prog);    backlog[backlogp].instruction=instr; -  backlog[backlogp].pc=pc; +  backlog[backlogp].pc = Pike_fp->pc;    backlog[backlogp].stack = Pike_sp - Pike_interpreter.evaluator_stack;    backlog[backlogp].mark_stack = Pike_mark_sp - Pike_interpreter.mark_stack;   #ifdef _REENTRANT
954: Inside #if defined(PIKE_DEBUG)
     #ifdef PIKE_DEBUG    - static void debug_instr_prologue (PIKE_OPCODE_T *pc, PIKE_INSTR_T instr) + static void debug_instr_prologue (PIKE_INSTR_T instr)   { -  low_debug_instr_prologue (pc, instr); +  low_debug_instr_prologue (instr);   }      #define DEBUG_PROLOGUE(OPCODE, EXTRA) do { \    if (d_flag || Pike_interpreter.trace_level > 2) { \ -  debug_instr_prologue (Pike_fp->pc, (OPCODE) - F_OFFSET); \ +  debug_instr_prologue ((OPCODE) - F_OFFSET); \    EXTRA; \    } \    } while (0)      /* The following are intended to be called directly from generated    * machine code. */ - void simple_debug_instr_prologue_0 (PIKE_OPCODE_T *pc, PIKE_INSTR_T instr) + void simple_debug_instr_prologue_0 (PIKE_INSTR_T instr)   {    if (d_flag || Pike_interpreter.trace_level > 2) -  low_debug_instr_prologue (pc, instr); +  low_debug_instr_prologue (instr);   } - void simple_debug_instr_prologue_1 (PIKE_OPCODE_T *pc, PIKE_INSTR_T instr, -  INT32 arg) + void simple_debug_instr_prologue_1 (PIKE_INSTR_T instr, INT32 arg)   {    if (d_flag || Pike_interpreter.trace_level > 2) { -  low_debug_instr_prologue (pc, instr); +  low_debug_instr_prologue (instr);    DEBUG_LOG_ARG (arg);    }   } - void simple_debug_instr_prologue_2 (PIKE_OPCODE_T *pc, PIKE_INSTR_T instr, -  INT32 arg1, INT32 arg2) + void simple_debug_instr_prologue_2 (PIKE_INSTR_T instr, INT32 arg1, INT32 arg2)   {    if (d_flag || Pike_interpreter.trace_level > 2) { -  low_debug_instr_prologue (pc, instr); +  low_debug_instr_prologue (instr);    DEBUG_LOG_ARG (arg1);    DEBUG_LOG_ARG2 (arg2);    }