summaryrefslogtreecommitdiff
path: root/rts/Disassembler.c
diff options
context:
space:
mode:
authorLuite Stegeman <stegeman@gmail.com>2023-01-10 14:48:01 +0900
committerLuite Stegeman <stegeman@gmail.com>2023-01-18 16:17:17 +0900
commite48eb9761e78695d2d072dfb78c76120a5a27ae8 (patch)
tree2656e717d197e5415830f9f166d1f38f8c43d997 /rts/Disassembler.c
parent4efee43db5090aac4dde1293357bdb548ae71c24 (diff)
downloadhaskell-wip/ghci-primcall.tar.gz
Add PrimCallConv support to GHCiwip/ghci-primcall
This adds support for calling Cmm code from bytecode using the native calling convention, allowing modules that use `foreign import prim` to be loaded and debugged in GHCi. This patch introduces a new `PRIMCALL` bytecode instruction and a helper stack frame `stg_primcall`. The code is based on the existing functionality for dealing with unboxed tuples in bytecode, which has been generalised to handle arbitrary calls. Fixes #22051
Diffstat (limited to 'rts/Disassembler.c')
-rw-r--r--rts/Disassembler.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/rts/Disassembler.c b/rts/Disassembler.c
index ae6d7ac9f7..f8b270fa28 100644
--- a/rts/Disassembler.c
+++ b/rts/Disassembler.c
@@ -83,6 +83,9 @@ disInstr ( StgBCO *bco, int pc )
debugBelch("CCALL marshaller at 0x%" FMT_HexWord "\n",
literals[instrs[pc]] );
pc += 1; break;
+ case bci_PRIMCALL:
+ debugBelch("PRIMCALL\n");
+ break;
case bci_STKCHECK: {
StgWord stk_words_reqd = BCO_GET_LARGE_ARG + 1;
debugBelch("STKCHECK %" FMT_Word "\n", (W_)stk_words_reqd );