-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate debug info for LLDB/GDB #50
Conversation
a2da7fd
to
92670c5
Compare
92670c5
to
3d55707
Compare
|
||
trait Reader: gimli::Reader<Offset = usize, Endian = LittleEndian> {} | ||
|
||
impl<'input> Reader for gimli::EndianSlice<'input, LittleEndian> {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why a new Reader
trait instead of using gimli::Reader
directly? To hide the associated types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took it from gimli's examples/dwarfdump.rs -- it is the only syntax I could find atm
Your method of transforming the line program is not what I expected. It looks like it is a 1-1 mapping of line program instructions, with the only transformation being for the address for each line program instruction. I don't know enough about cranelift to know if that is valid though. For example, can cranelift do optimizations (eg reorder/combining) that mean either
I was expecting you would need to generate a new line program, with the file/line information for each address being determined by looking up the srcloc in the original line program. |
You are correct. Currently I'm just trying to introduce the basics like JIT interface for LLDB, and then continue building on it. Anyway, I changed the logic in the .debug_line generation to be closer to what I planned. |
0c258b5
to
2ebc32a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very cool!
8560f43
to
920d726
Compare
Generate DWARF sections based on WASM DWARF. Ignore some of debug_info/debug_line for dead code.
Ok great, let's land this and #59 now. |
Wanted to say this is really cool and exciting, great work ! |
@yurydelendik how do you get this to work with lldb? When I ran |
@bjorn3 https://gist.github.com/yurydelendik/4103d782dfc62634bc9f4de98de20835 has a log of running wasmtime w/lldb. (works on linux, and requires trunk lldb build + config on macos) |
That seems to be the problem. I tried xcode lldb on macos. On linux it does work with lldb, but not with gdb. |
These limits seems to be picked arbitrary, and I just made it arbitrary larger. We need to reconsider these limits, ideally providing to user a way to customize the limits. FWIW, When the last time I've tried to run gcc's torture testsuite with wasmi it also bumped into this limit. Fixes bytecodealliance#41.
* Update for recent C API changes Updating these bindings to account for bytecodealliance#2579 * Appease go vet
* Implement file append functionality. - In the preview1-to-preview2 polyfill, using `append_via_stream`. - In the host implementation, using a new system-interface `FileIoExt::append` function. * Add a basic testcase.
* Implement file append functionality. - In the preview1-to-preview2 polyfill, using `append_via_stream`. - In the host implementation, using a new system-interface `FileIoExt::append` function. * Add a basic testcase.
Merge with upstream
Example:
See also parent #46
P.S. work towards https://yurydelendik.github.io/webassembly-dwarf/#aot-jit-compilers