bytecodealliance / bytecodealliance/wasmtime

JIT: Return both size and pointer for finalized functions in JITModule

Open
#6,677 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
18.6k
Forks
1.8k
Avg merge
1d 18h
Merged PRs (30d)
126

Description

#### Feature

I want `get_finalized_function` in cranelift_jit's JITModule to return both the pointer and size to JIT'd functions, like `get_finalized_data` does for data object.

#### Benefit

This would allow me to disassemble individual compiled functions without having to guess at their size, making it easier for me to debug my compiler. Right now I dump them to standard output one byte at a time until my test program segfaults and manually locate the true end of the function code, which is unsustainable.

#### Implementation

`get_finalized_data` already works this way and seems to deal with the same type (`CompiledBlob`), so it should basically amount to copying that.

#### Alternatives

Adding a second function for getting the size would also work, but then the API would be inconsistent with itself.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.