-- one slot for "method-table-ptr"
return $ (1 + fsize) * 4
-foreign export ccall getStaticFieldAddr :: CUInt -> Ptr () -> IO CUInt
-getStaticFieldAddr :: CUInt -> Ptr () -> IO CUInt
-getStaticFieldAddr from ptr_trapmap = do
- trapmap <- ptr2trapmap ptr_trapmap
+foreign export ccall getStaticFieldAddr :: CUInt -> IO CUInt
+getStaticFieldAddr :: CUInt -> IO CUInt
+getStaticFieldAddr from = do
+ trapmap <- get_trapmap >>= ptr2trapmap
let w32_from = fromIntegral from
let sfi = trapmap M.! w32_from
case sfi of
#include <sys/ucontext.h>
unsigned int getMethodEntry(unsigned int, unsigned int);
-unsigned int getStaticFieldAddr(unsigned int, void*);
+unsigned int getStaticFieldAddr(unsigned int);
unsigned int getTrapType(unsigned int, unsigned int);
unsigned int mallocObject(int);
dprintf("staticfieldtrap: something is wrong here. abort\n");
exit(0);
}
- unsigned int patchme = getStaticFieldAddr(from, trap_map);
+ unsigned int patchme = getStaticFieldAddr(from);
dprintf(" to_patch: 0x%08x\n", (unsigned int) to_patch);
dprintf("*to_patch: 0x%08x\n", *to_patch);