In FFICallbackThunk>>initializeRiscV64 (gdb) n 571 memmove(((void *)dest), ((void *)src), (stop - start) + 1); (gdb) p dest $8 = 274727944192 ## Address of start of thunk code (see below) (gdb) n 575 methodReturnReceiver(); (gdb) x 274727944192 0x3ff70fc000: 0x97020000 (gdb) break 0x3ff70fc000 # try to break in thunk code Function "0x3ff70fc000" not defined. Make breakpoint pending on future shared library load? (y or [n]) y Breakpoint 3 (0x3ff70fc000) pending. (gdb) cont Continuing. ... ... ... Thread 1 "squeak" received signal SIGILL, Illegal instruction. 0x0000003ff70fc000 in ?? () (gdb) bt #0 0x0000003ff70fc000 in ?? () (gdb) x/20 0x0000003ff70fc000 ## thunk code; primThunkEntryAddress is 0x2aaab68052 0x3ff70fc000: 0x97020000 0x16e40111 0x01000ae0 0x030017c3 0x3ff70fc010: 0x82938333 0x0561c260 0x01008280 0x01000100 0x3ff70fc020: 0x00000000 0x00000000 0xaab68052 0x0000002a 0x3ff70fc030: 0x00000000 0x00000000 0x00000000 0x00000000 0x3ff70fc040: 0x00000000 0x00000000 0x00000000 0x00000000 (gdb) i r ra 0x3ff7e4db30 0x3ff7e4db30 sp 0x3ffffcb2e0 0x3ffffcb2e0 gp 0x2aaabf1378 0x2aaabf1378 tp 0x3ff7e1b7b0 0x3ff7e1b7b0 t0 0x1 1 t1 0x3ff7e4def4 274741911284 t2 0x3ff 1023 fp 0x3ffffcb580 0x3ffffcb580 s1 0x2aaacebb90 183254301584 a0 0x2aaacebb88 183254301576 a1 0x2aaacebb90 183254301584 a2 0x0 0 a3 0x0 0 a4 0x2 2 a5 0x1 1 a6 0x0 0 a7 0x0 0 s2 0x1 1 s3 0x1 1 ================= " 0 : 00000297 auipc t0,0x0 Current PC = self codeAddress 4 : 1101 addi sp,sp,-32 reserve 4 stack slots (1 for alignment) 6 : e806 sd ra,16(sp) push Return Address 8 : e416 sd t0,8(sp) push self codeAddress a : e00a sd sp,0(sp) push current Stack Pointer c : 0001C317 auipc t1,0x1C PC+0x1C is address of &entryThunk 10: 00033383 ld t2,0(t1) get &entryThunk in register 12 : 9382 jalr t2 Call entryThunk() 14 : 60c2 ld ra,16(sp) Restore saved Return Address 16 : 6105 addi sp,sp,32 Restore Stack Pointer 18 : 8082 ret Return to Mamma 1a : 0001 nop --keep prefetch happy-- ... 28: <@entryThunk> " | bytes | bytes := #[16r00 16r00 16r02 16r97 16r11 16r01 16rE4 16r16 16rE0 16r0A 16r00 16r01 16rC3 16r17 16r00 16r03 16r33 16r83 16r93 16r82 16r60 16rC2 16r61 16r05 16r80 16r82 16r00 16r01 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] copy. bytes unsignedLongLongAt: 41 put: self primThunkEntryAddress. self replaceFrom: 1 to: 48 with: bytes startingAt: 1.