From d49add63e6b9f99bf3a4138cb6a38d9bb32662c7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fredrik=20H=C3=BCbinette=20=28Hubbe=29?= <hubbe@hubbe.net>
Date: Wed, 25 Apr 2001 14:26:46 -0700
Subject: [PATCH] unbug support

Rev: src/Makefile.in:1.255
Rev: src/interpret.c:1.192
Rev: src/interpret_functions.h:1.51
Rev: src/interpreter.h:1.57
Rev: src/opcodes.c:1.106
---
 src/Makefile.in           | 16 ++++++++++++++--
 src/interpret.c           |  4 ++--
 src/interpret_functions.h | 10 +++++++++-
 src/interpreter.h         |  6 ++++++
 src/opcodes.c             |  7 ++++++-
 5 files changed, 37 insertions(+), 6 deletions(-)

diff --git a/src/Makefile.in b/src/Makefile.in
index 6eea9f07ed..5a22d3a7a3 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -1,5 +1,5 @@
 #
-# $Id: Makefile.in,v 1.254 2001/04/21 15:32:39 grubba Exp $
+# $Id: Makefile.in,v 1.255 2001/04/25 21:26:45 hubbe Exp $
 #
 
 # This line is needed on some machines.
@@ -246,7 +246,7 @@ $(TMP_BUILDDIR)/tpike: precompile.sh-stamp
 # the recursive make of tpike-real above, that one will never start to
 # make the $(OBJ)s concurrently with this one. stamp-tpike-predep
 # records the $(POBJ) dependencies without tpike.
-pike: $(OBJ) master.pike modules/linker_options stamp-tpike-predep post_modules/linker_options
+pike: $(OBJ) master.pike pike.syms modules/linker_options stamp-tpike-predep post_modules/linker_options
 	$(MAKE) $(MAKE_FLAGS) $(MAKE_PARALLEL) $(POBJ)
 	-@if [ -f pike.old ] ; then rm -f pike.old || : ; else : ; fi
 	-@if [ -f pike.old.exe ] ; then rm -f pike.old.exe || : ; else : ; fi
@@ -504,6 +504,10 @@ master.pike: $(LIBDIR_SRC)/master.pike.in Makefile
 	sed -e 's!�lib_prefix�!'"`echo "$(TMP_LIBDIR)" | sed -e "$$t"`"'!' <$(LIBDIR_SRC)/master.pike.in \
 	  | sed -e 's!�share_prefix�!'"`echo "$(LIBDIR_SRC)" | sed -e "$$t"`"'!' >master.pike
 
+pike.syms: $(SRCDIR)/interpret.c $(SRCDIR)/interpreter.h $(SRCDIR)/program.c $(SRCDIR)/builtin_functions.c
+	( cat $(SRCDIR)/*.h *.h | egrep  '^[  ]*#[     ]*define[      ][       ]*[a-zA-Z_0-9]*[       ][      ]*[0-9][xabcdefABCDEF0-9]*[  ]*' ; \
+	echo "#define" `$(CPP) $(PREFLAGS) -DSTEP_BREAK_LINE='STEP_BREAK_LINE __LINE__' $(SRCDIR)/interpreter.h | grep STEP_BREAK_LINE` ) >pike.syms
+
 pike-module: $(SRCDIR)/pike-module.in Makefile ./pike
 	$(RUNPIKE) $(SRCDIR)/pike-module.in --fixate=$(SRCDIR)/pike-module.in \
 	   --set='make=$(MAKE)' --set='make_flags=$(MAKE_FLAGS)' \
@@ -595,6 +599,14 @@ lexer1.h: lexer.h
 lexer2.h: lexer.h
 	cp "$(SRCDIR)/lexer.h" "$@"
 
+
+# unbug needs interpreter_nd.h to be able to
+# set separate breakpoints in eval_instruction_with/without_debug
+interpreter_debug.h: interpreter.h
+	cp "$(SRCDIR)/interpreter.h" "$@"
+
+interpret.o: interpreter_debug.h
+
 # All the $(POBJ) dependencies, except tpike. See blurb at pike target.
 stamp-tpike-predep: $(SRCDIR)/peep.in $(TMP_BINDIR)/mkpeep.pike peep.c $(SRCDIR)/UnicodeData.txt $(TMP_BINDIR)/make_ci.pike builtin_functions.c $(SRCDIR)/treeopt.in $(TMP_BINDIR)/mktreeopt.pike las.c
 	@echo foo > stamp-tpike-predep
diff --git a/src/interpret.c b/src/interpret.c
index 76743c38c2..225e5fa49f 100644
--- a/src/interpret.c
+++ b/src/interpret.c
@@ -5,7 +5,7 @@
 \*/
 /**/
 #include "global.h"
-RCSID("$Id: interpret.c,v 1.191 2001/04/14 09:44:20 hubbe Exp $");
+RCSID("$Id: interpret.c,v 1.192 2001/04/25 21:26:45 hubbe Exp $");
 #include "interpret.h"
 #include "object.h"
 #include "program.h"
@@ -786,7 +786,7 @@ static void restore_light_frame_info(struct light_frame_info *info)
 
 #ifdef PIKE_DEBUG
 #define eval_instruction eval_instruction_with_debug
-#include "interpreter.h"
+#include "interpreter_debug.h"
 
 #undef eval_instruction
 #define eval_instruction eval_instruction_without_debug
diff --git a/src/interpret_functions.h b/src/interpret_functions.h
index 5ed2a9d2c2..86d472db67 100644
--- a/src/interpret_functions.h
+++ b/src/interpret_functions.h
@@ -1,5 +1,5 @@
 /*
- * $Id: interpret_functions.h,v 1.50 2001/03/19 00:42:11 grubba Exp $
+ * $Id: interpret_functions.h,v 1.51 2001/04/25 21:26:46 hubbe Exp $
  *
  * Opcode definitions for the interpreter.
  */
@@ -1723,3 +1723,11 @@ OPCODE0_JUMP(F_TAIL_RECUR,"tail recursion")
   pc=addr;
 }
 BREAK
+
+OPCODE0(F_BREAKPOINT,"breakpoint")
+{
+  extern void o_breakpoint(void);
+  o_breakpoint();
+  pc--;
+}
+BREAK;
diff --git a/src/interpreter.h b/src/interpreter.h
index 11d270f2b8..6fb0fff6ad 100644
--- a/src/interpreter.h
+++ b/src/interpreter.h
@@ -36,6 +36,10 @@
 #define DOJUMP() \
  do { int tmp; tmp=GET_JUMP(); pc+=tmp; if(tmp < 0) fast_check_threads_etc(6); }while(0)
 
+#ifndef STEP_BREAK_LINE
+#define STEP_BREAK_LINE
+#endif
+
 static int eval_instruction(unsigned char *pc)
 {
   unsigned INT32 prefix2=0,instr, prefix=0;
@@ -45,6 +49,8 @@ static int eval_instruction(unsigned char *pc)
     Pike_fp->pc = pc;
     instr=EXTRACT_UCHAR(pc++);
 
+    STEP_BREAK_LINE
+    
 #ifdef PIKE_DEBUG
     if(t_flag > 2)
     {
diff --git a/src/opcodes.c b/src/opcodes.c
index c35c6fd004..891c614d3d 100644
--- a/src/opcodes.c
+++ b/src/opcodes.c
@@ -26,7 +26,7 @@
 #include "bignum.h"
 #include "operators.h"
 
-RCSID("$Id: opcodes.c,v 1.105 2001/03/31 15:41:58 grubba Exp $");
+RCSID("$Id: opcodes.c,v 1.106 2001/04/25 21:26:46 hubbe Exp $");
 
 void index_no_free(struct svalue *to,struct svalue *what,struct svalue *ind)
 {
@@ -1859,3 +1859,8 @@ PMOD_EXPORT void f_sscanf(INT32 args)
   push_array(a);
 }
 
+
+void o_breakpoint(void)
+{
+  /* Does nothing */
+}
-- 
GitLab