From 82fea31c0538ac74cd8267ce12a31ffad8537927 Mon Sep 17 00:00:00 2001
From: rtoy <rtoy>
Date: Fri, 12 Sep 2008 21:09:07 +0000
Subject: [PATCH] new-genesis.lisp: o Generate values for REAL_LRA_SLOT,
 KNOWN_RETURN_P_SLOT, and   BOGUS_LRA_CONSTANTS from the actual Lisp values.

breakpoint.c:
o Use the generated values above, if available.  We leave suitable
  defaults for now, but they should probably be removed.
---
 compiler/generic/new-genesis.lisp | 12 +++++++++++-
 lisp/breakpoint.c                 | 22 ++++++++++++++++------
 2 files changed, 27 insertions(+), 7 deletions(-)

diff --git a/compiler/generic/new-genesis.lisp b/compiler/generic/new-genesis.lisp
index 0f92646a8..f520af075 100644
--- a/compiler/generic/new-genesis.lisp
+++ b/compiler/generic/new-genesis.lisp
@@ -4,7 +4,7 @@
 ;;; Carnegie Mellon University, and has been placed in the public domain.
 ;;;
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/generic/new-genesis.lisp,v 1.81 2008/09/12 21:02:56 rtoy Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/generic/new-genesis.lisp,v 1.82 2008/09/12 21:09:07 rtoy Exp $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -2443,6 +2443,16 @@
 	    (format t "#define ~A ~D~@[  /* ~A */~]~%"
 		    (first const) (third const) (fourth const))))))
 
+  ;; Write out the values of real-lra-slot and friend for breakpoint
+  ;; handling so we don't have to maintain it in the C code.
+
+  (format t "~%#define REAL_LRA_SLOT ~D~%"
+	  (- di::real-lra-slot vm::code-constants-offset))
+  (format t "#define KNOWN_RETURN_P_SLOT ~D~%"
+	  (- di::known-return-p-slot vm::code-constants-offset))
+  (format t "#define BOGUS_LRA_CONSTANTS ~D~%"
+	  di::bogus-lra-constants vm::code-constants-offset)
+
   ;; Write out internal error codes and error descriptions
   (terpri)
   (loop for (error-name . rest) across (c:backend-internal-errors c:*backend*)
diff --git a/lisp/breakpoint.c b/lisp/breakpoint.c
index 153b10407..bd9025df6 100644
--- a/lisp/breakpoint.c
+++ b/lisp/breakpoint.c
@@ -1,6 +1,6 @@
 /*
 
- $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/breakpoint.c,v 1.25 2008/09/10 13:46:43 rtoy Exp $
+ $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/breakpoint.c,v 1.26 2008/09/12 21:09:07 rtoy Rel $
 
  This code was written as part of the CMU Common Lisp project at
  Carnegie Mellon University, and has been placed in the public domain.
@@ -26,19 +26,29 @@
 /*
  * See MAKE-BOGUS-LRA in code/debug-int.lisp for these values.
  *
- * Note: In debug-int.lisp, real-lra-slot and known-return-p-slot are
- * offsets from the start of the code object.  But in the C code here,
- * it is the offset from the constants vector in the code object.  The
- * difference between the two is vm:code-constants-offset.
+ * Ideally, internals.h should have the correct values.  We leave
+ * these defaults here for now.
  */
+#ifndef REAL_LRA_SLOT
 #define REAL_LRA_SLOT 0
+#endif
+
+#ifndef KNOWN_RETURN_P_SLOT
 #ifndef i386
 #define KNOWN_RETURN_P_SLOT 1
-#define BOGUS_LRA_CONSTANTS 2
 #else
 #define KNOWN_RETURN_P_SLOT 2
+#endif
+#endif
+
+#ifndef BOGUS_LRA_CONSTANTS
+#ifndef i386
+#define BOGUS_LRA_CONSTANTS 2
+#else
 #define BOGUS_LRA_CONSTANTS 3
 #endif
+#endif
+
 
 static void *
 compute_pc(lispobj code_obj, int pc_offset)
-- 
GitLab