[llvm] Add test for dwarf verification JSON output (PR #124936)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 29 08:11:05 PST 2025
youngdfb wrote:
> is your intent to verify errors in the debug_names section? If so, you don't need to use assembly, it's possible to use a YAML format too, e.g.: llvm-project/llvm/unittests/DebugInfo/DWARF/DWARFAcceleratorTableTest.cpp
The idea of the test is to validate the JSON emitted from the LLVM-dwarfdump script invocation is correct as there was no existing test for that that I could find.
The specifics of the test file aren't super important; I simply copied from an existing because it was already set up with several errors that I could then see in the JSON. Additionally, those types of errors, on missing names with different tags, is the extension I am looking to follow up with. By either making keys more precise or adding a sub-breakdown under the category. Hence a JSON output change that should have a test.
Begs question of whether should be validating JSON for a clean DWARF, too to make sure JSON is empty.
The changes to modify JSON are in DWARFVerifier.h & llvm-project/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp I don't see a unit test setup for DWARFVerifier.
https://github.com/llvm/llvm-project/pull/124936
More information about the llvm-commits
mailing list