From 35bd3efcdd36d355d8432ec45a85f6df68667723 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Sun, 25 Aug 2019 15:09:11 +0000 Subject: [PATCH] Fix units for cc_entry_to_block_offset/cc_return_to_block_offset. It would make more sense for the compiler to generate debug data labels in instruction units, but this is a simpler change and is what was done in the past on machines like mips with 32-bit aligned instructions. aarch64 now has functioning debug data! --- src/microcode/cmpint.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/microcode/cmpint.c b/src/microcode/cmpint.c index fad1583d5..8d93fdb23 100644 --- a/src/microcode/cmpint.c +++ b/src/microcode/cmpint.c @@ -1926,18 +1926,23 @@ cc_block_environment (SCHEME_OBJECT block) return (VECTOR_REF (block, ((VECTOR_LENGTH (block)) - 1))); } +/* Returns offsets of entry points from start of block in byte units + (not instruction units -- the debug data (.bci files) generated by + the compiler specify address units). */ + unsigned long cc_entry_to_block_offset (SCHEME_OBJECT entry) { - return ((CC_ENTRY_ADDRESS (entry)) - - ((insn_t *) (cc_entry_to_block_address (entry)))); + return (((const uint8_t *) (CC_ENTRY_ADDRESS (entry))) + - ((const uint8_t *) (cc_entry_to_block_address (entry)))); } unsigned long cc_return_to_block_offset (SCHEME_OBJECT ret) { - return ((CC_RETURN_ADDRESS_TO_ENTRY_ADDRESS (CC_RETURN_ADDRESS (ret))) - - ((insn_t *) (cc_return_to_block_address (ret)))); + return (((const uint8_t *) + (CC_RETURN_ADDRESS_TO_ENTRY_ADDRESS (CC_RETURN_ADDRESS (ret)))) + - ((const uint8_t *) (cc_return_to_block_address (ret)))); } bool -- 2.25.1