Details
Diff Detail
Event Timeline
This requires an unittest (or an lldb-test test). Some comments inline.
I think @clayborg or @jasonmolenda are in a better position to review the structure, I can take a look at the ELF specific details.
source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp | ||
---|---|---|
1890–1891 | this whole cascade is really not ideal. Maybe we should factor the checks out or move this to be a switch? | |
2113–2115 | Please remove references to GOOGLE3. |
source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp | ||
---|---|---|
2937–2938 | Might be worth making these llvm::StringRef, then see comments below.. | |
2948 | Make this a StringRef: llvm::StringRef section_name = section->GetName().GetStringRef(); | |
2954–2955 | use StringRef::startswith: if (section_name.startswith(debug_prefix) || section_name.startswith(zdebug_prefix)) | |
3451 | use "section_name" here instead of "section->GetName().GetStringRef()" since we switched it to a StringRef | |
3472 | Ditto |
If this is for current and future debugging, it would be nice to change the tool to just use the normal .debug prefixes and just specify SHF_COMPRESSED???
Clang/LLVM do (-Wa,--compress-debug-sections). Yeah, it's ELF only so far as I know. There's a couple of variations (-compress-debug-sections=zlib or zlib-gnu) the ".zdebug_foo" is zlib-gnu style, but a more modern variant (zlib) uses a section attribute SHF_COMPRESSED instead of the name mangling.
At least for now, zlib-gnu style is used at Google - I don't actually know what it'd cost to switch to the more modern zlib (using SHF_COMPRESSED) style. No doubt there are a variety of tools that may not have been updated/improved to support the new format - hard to say.
Thanks for clarifying. You'll also need to add a testcase. If clang supports this then I don't have a problem with supporting this in LLDB and adding a testcase should be easy.
source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp | ||
---|---|---|
1893 | Could this entire device be replaced by a llvm::StringSwitch or something else more elegant? |
We should test both ways: using normal DWARF section names with SHF_COMPRESSED, and with ".zdebug" prefixed section names.
I refactored the code to address the comments on it. I'll add those tests once I get the test runner to work.
source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp | ||
---|---|---|
1893 | I moved it out into a separate method with a StringSwitch | |
3451 | This is a separate method, which doesn't have a section_name variable. | |
3472 | Same here. |
source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp | ||
---|---|---|
1773–1781 | Thanks! This was exactly what I had in mind. Do you mind to split the NFC changes into a separate patch (that can be committed without review)? This will make this patch much easier to review. |
Thank you for the patch. For testing I'd recommend taking a look at r320813 https://reviews.llvm.org/D40616, which implemented the SHF_COMPRESSED part of the compressed section support. It looks like we should add a new field to the "lldb-test module-sections" output, so that we can test the section type computation code.
source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp | ||
---|---|---|
1773–1781 | Sure, attached it here. |
Some minor comments, almost ready to go. Do you have commit access or you need somebody to push this on your behalf?
packages/Python/lldbsuite/test/linux/compressed-debug-info/TestCompressedDebugInfo.py | ||
---|---|---|
23–41 | This test is too much boilerplate. We moved to a new, more concise style. You might consider using (target, process, thread, main_breakpoint) = lldbutil.run_to_source_breakpoint(self, "break here", src_file_spec, exe_name = exe) instead. | |
48–65 | ditto. | |
source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp | ||
1778–1781 | Can you add a comment to explain why are you dropping the first two character here? |
Hi Erik, the review is still marked as requiring changes. Once that is
sorted out I'd be happy to submit this on your behalf (what is the base SVN
revision for the latest patch?)
Davide Italiano, is all the CR feedback addressed in the latest revision?
Thank you David.
This is still based on the latest revision of the file (+ the non functional change patch).
Since there was some changes to the file during the last couple of days I've updated the patches to be against HEAD again.
The new NFC patch:
This test is too much boilerplate. We moved to a new, more concise style. You might consider using
instead.