This fixes printing long values that might reside in CIE and FDE, including offsets, lengths, and addresses.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Ping (and to reduce the noise, for all other revisions in the stack as well, please).
Mechanically looks fine to me by @probinson should also take a look and see if the concerns in the other review were addressed.
Apologies for the slow response. Overall this seems cleaner than D73714, now that I better understand the subtleties between .debug_frame and .eh_frame specifications.
The commit message should include a link to the Linux spec that you cited in the other review, which will help future readers understand the differences between the two formats.
A couple of minor things inline that I would like to see addressed.
llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h | ||
---|---|---|
191 | Because this will not return the value from the data, it should have a comment along the lines of: | |
llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp | ||
342 | This looks like you are printing LinkedCIEOffset twice? |
llvm/unittests/DebugInfo/DWARF/DWARFDebugFrameTest.cpp | ||
---|---|---|
20 | For completeness, you probably want DWARF32 versions of these too. | |
22 | clang-format-recognised style is /*IsDWARF64=*/true. Same principle applies throughout. | |
23 | I believe there's no need for the ULL suffix here and elsewhere below. | |
50 | As the TestCIE block is practically identical in all test cases, it might be good to pull it into a function e.g. createCIE(uint64_t Length, uint64_t Offset). This will also make clearer what is actually important to each test case. |
Thanks, @jhenderson!
- Simplified tests by moving similar code to helper functions.
- Added a test for DWARF32 CIE.
- Removed unneeded suffixes.
- Removed spaces in the comments for arguments.
llvm/unittests/DebugInfo/DWARF/DWARFDebugFrameTest.cpp | ||
---|---|---|
22 | A side note. It looks like clang-format recognizes both styles, and both are used in the LLVM codebase, but the condensed variant is way more widespread and also is mentioned in the LLVM Coding Standards (not as a requirement, just as an example). |
I don't claim to have checked all the functionality matches the spec, but otherwise this looks good to me.
P.S. please remember to mark inline comments as "Done" using the checkbox once you address something. If you do that before uploading a patch, they will get automatically submitted when the patch is uploaded.
llvm/unittests/DebugInfo/DWARF/DWARFDebugFrameTest.cpp | ||
---|---|---|
22 | When you say "recognises" I think what happens is that it treats the old style as a normal inline comment, so applies the normal comment formatting rules. That is based purely on observation though, so I could be completely wrong! |
llvm/unittests/DebugInfo/DWARF/DWARFDebugFrameTest.cpp | ||
---|---|---|
22 | Well, maybe it does not need to recognize them in a special way if the result of the formatting is the same as expected. Anyway, I agree that it is better to stick with a more widespread style despite my personal taste. |
Because this will not return the value from the data, it should have a comment along the lines of:
// Returns the CIE identifier to be used by the requested format.