Stream: cranelift

Topic: How to get trapcode associated with trap instruction?


view this post on Zulip Adel Prokurov (Sep 19 2024 at 12:40):

Hello! I am compiling each function without usage of cranelift-object or cranelift-jit crates and instead allocate the code for bytes produced by ctx.compile_and_emit(). I don't quite get how to acquire text section offset from that? Is there any convenient method to get trap code associated with trap instruction?

view this post on Zulip bjorn3 (Sep 19 2024 at 13:10):

You can use compiled_code.buffer.traps() where compiled_code is the value returned by compile_and_emit() to get access to all offsets where a trap can happen as well as their trap code.


Last updated: Oct 23 2024 at 20:03 UTC