[DTrace-devel] [PATCH 4/6] Add macro to access stack slots past the register spill area

Kris Van Hees kris.van.hees at oracle.com
Mon Mar 7 19:50:03 UTC 2022


Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
---
 libdtrace/dt_dctx.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libdtrace/dt_dctx.h b/libdtrace/dt_dctx.h
index 7d38dfd8..77eb9a92 100644
--- a/libdtrace/dt_dctx.h
+++ b/libdtrace/dt_dctx.h
@@ -159,6 +159,9 @@ typedef struct dt_dctx {
 #define DT_STK_SPILL_BASE	(DT_STK_DCTX - DT_STK_SLOT_SZ)
 #define DT_STK_SPILL(n)		(DT_STK_SPILL_BASE - (n) * DT_STK_SLOT_SZ)
 
+#define DT_STK_SP_BASE		DT_STK_SPILL(DT_STK_NREGS)
+#define DT_STK_SP(n)		(DT_STK_SP_BASE - (n) * DT_STK_SLOT_SZ)
+
 #define DT_STK_SCRATCH_BASE	(-MAX_BPF_STACK)
 #define DT_STK_SCRATCH_SZ	(MAX_BPF_STACK + DT_STK_SPILL(DT_STK_NREGS - 1))
 
-- 
2.34.1




More information about the DTrace-devel mailing list