Page MenuHomePhabricator

[LLDB] Add SymbolVendorWasm plugin for WebAssembly debugging
ClosedPublic

Authored by paolosev on Jan 13 2020, 2:18 PM.

Details

Summary

Add plugin class SymbolVendorWasm, with the logic to manage debug symbols for Wasm modules.

Depends on D71575.

Diff Detail

Event Timeline

paolosev created this revision.Jan 13 2020, 2:18 PM

The patch looks pretty good. A reasonable way to test this would be again via lldb-test object-file . The command dumps the "unified section list" of the module, so if the debug info sections show up there, you know the symbol vendor has done it's job. You can look at test/Shell/ObjectFile/ELF/build-id-case.yaml for inspiration.

paolosev updated this revision to Diff 238128.Jan 14 2020, 3:53 PM

Added "lldb-test object-file" test.

The patch looks pretty good. A reasonable way to test this would be again via lldb-test object-file . The command dumps the "unified section list" of the module, so if the debug info sections show up there, you know the symbol vendor has done it's job. You can look at test/Shell/ObjectFile/ELF/build-id-case.yaml for inspiration.

Thank you for the suggestion! I added a test.
I would have liked to use llvm-objcopy --strip-all in my test, but llvm-objcopy does not support wasm yet (I started working on this feature but I found out that there was already an ongoing effort: https://reviews.llvm.org/D70930, and https://reviews.llvm.org/D70970) .
So I created with two separated yaml files.

paolosev updated this revision to Diff 238177.Jan 14 2020, 11:03 PM

Rebasing from D71575.

The patch looks pretty good. A reasonable way to test this would be again via lldb-test object-file . The command dumps the "unified section list" of the module, so if the debug info sections show up there, you know the symbol vendor has done it's job. You can look at test/Shell/ObjectFile/ELF/build-id-case.yaml for inspiration.

Thank you for the suggestion! I added a test.
I would have liked to use llvm-objcopy --strip-all in my test, but llvm-objcopy does not support wasm yet (I started working on this feature but I found out that there was already an ongoing effort: https://reviews.llvm.org/D70930, and https://reviews.llvm.org/D70970) .
So I created with two separated yaml files.

That's fine. I think I actually prefer separate yaml representations, as that makes what goes into which file more explicit, and shields the test from changes in objcopy behavior. What you could consider is "inlining" the two yaml files into unified-debug-sections.yaml, and using the yaml2obj --docnum functionality (as in e.g., test/Shell/Minidump/memory-region-from-module.yaml) to create two wasm files.

paolosev updated this revision to Diff 238342.Jan 15 2020, 1:01 PM

Modified test to have two "inlined" yaml files and use "yaml2obj --docnum".

labath accepted this revision.Jan 16 2020, 7:01 AM

This looks good.

This revision is now accepted and ready to land.Jan 16 2020, 7:01 AM
This revision was automatically updated to reflect the committed changes.