DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ T b

⟦f89cfd53d⟧ TextFile

    Length: 4904 (0x1328)
    Types: TextFile
    Names: »bkpt.h«

Derivation

└─⟦a0efdde77⟧ Bits:30001252 EUUGD11 Tape, 1987 Spring Conference Helsinki
    └─ ⟦this⟧ »EUUGD11/gnu-31mar87/scheme/microcode/bkpt.h« 

TextFile

/*	Emacs -*-C-*-an't tell the language			*/

/****************************************************************
*                                                               *
*                         Copyright (c) 1986                    *
*               Massachusetts Institute of Technology           *
*                                                               *
* This material was developed by the Scheme project at the      *
* Massachusetts Institute of Technology, Department of          *
* Electrical Engineering and Computer Science.  Permission to   *
* copy this software, to redistribute it, and to use it for any *
* purpose is granted, subject to the following restrictions and *
* understandings.                                               *
*                                                               *
* 1. Any copy made of this software must include this copyright *
* notice in full.                                               *
*                                                               *
* 2. Users of this software agree to make their best efforts (a)*
* to return to the MIT Scheme project any improvements or       *
* extensions that they make, so that these may be included in   *
* future releases; and (b) to inform MIT of noteworthy uses of  *
* this software.                                                *
*                                                               *
* 3.  All materials developed as a consequence of the use of    *
* this software shall duly acknowledge such use, in accordance  *
* with the usual standards of acknowledging credit in academic  *
* research.                                                     *
*                                                               *
* 4. MIT has made no warrantee or representation that the       *
* operation of this software will be error-free, and MIT is     *
* under no obligation to provide any services, by way of        *
* maintenance, update, or otherwise.                            *
*                                                               *
* 5.  In conjunction with products arising from the use of this *
* material, there shall be no use of the name of the            *
* Massachusetts Institute of Technology nor of any adaptation   *
* thereof in any advertising, promotional, or sales literature  *
* without prior written consent from MIT in each case.          *
*                                                               *
****************************************************************/

/* File: BKPT.H
 *
 * This file contains breakpoint utilities.
 * Disabled when not debugging the interpreter.
 *
 */

#ifdef ENABLE_DEBUGGING_TOOLS
\f


struct sp_record
{ Pointer *sp;
  struct sp_record *next;
};
typedef struct sp_record *sp_record_list;

#define sp_nil ((sp_record_list) NULL)

extern sp_record_list SP_List;
extern void Copy_Trace_Circle(), Pop_Return_Break_Point();

#ifdef In_Main_Interpreter

/* Code for maintaining a circular expression buffer for examination
 * from C debugging tools.  This is a simpler structure to understand
 * than the Scheme doubly linked rib structure controlled by the
 * COMPILE_HISTORY flag.
 */

#define debug_maxslots 64
int debug_slotno = 0;
int debug_nslots = 0;
int local_slotno = 0;
int local_nslots = 0;
int debug_circle[debug_maxslots];
int local_circle[debug_maxslots];

void Copy_Trace_Circle()
{ int *From = &(local_circle[0]), *To = &(debug_circle[0]), i;

  for (i=0; i < local_nslots; i++) *To++ = *From++;
  debug_nslots = local_nslots;
  debug_slotno = local_slotno;
}

#define Eval_Ucode_Hook()					\
  local_circle[local_slotno++] = Fetch_Expression();		\
  if (local_slotno >= debug_maxslots) local_slotno = 0;		\
  if (local_nslots < debug_maxslots) local_nslots++
\f


#ifdef Using_Registers
#define Pop_Return_Ucode_Hook()					\
if (SP_List != sp_nil)						\
{ Export_Registers();						\
  Pop_Return_Break_Point();					\
  Import_Registers();						\
}
#else
#define Pop_Return_Ucode_Hook()					\
if (SP_List != sp_nil)						\
  Pop_Return_Break_Point();
#endif

/* For performance metering we note the time spent handling each
 * primitive.  This MIGHT help us figure out where all the time
 * goes.  It should make the time zone kludge obselete someday.
 */

#ifdef METERING
struct
{ int nprims;
  int primtime[MAX_PRIMITIVE_NUMBER+1];
} perfinfo_data;

void Clear_Perfinfo_Data()
{ int i;
  perfinfo_data.nprims = MAX_PRIMITIVE_NUMBER+1;
  for (i=0; i <= MAX_PRIMITIVE_NUMBER; i++) perfinfo_data.primtime[i]=0;
}

#define Metering_Apply_Primitive(Loc, N)				\
{ long Start_Time = Sys_Clock();					\
  Loc = Apply_Primitive(N)						\
  perfinfo_data.primtime[N] += Sys_Clock() - Start_Time;		\
}									\
Set_Time_Zone(Zone_Working)
#endif

/* Not implemented yet */
#define Apply_Ucode_Hook()

#endif /* ifdef In_Main_Interpreter */
#endif /* ifdef ENABLE_DEBUGGING_TOOLS */