This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Support compressed CTF
ClosedPublic

Authored by JDevlieghere on Jul 13 2023, 10:38 AM.

Details

Summary

Add support for compressed CTF data. The flags in the header can indicate whether the CTF body is compressed with zlib deflate. This patch supports uncompressing the data before parsing.

Diff Detail

Event Timeline

JDevlieghere created this revision.Jul 13 2023, 10:38 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 13 2023, 10:38 AM
jasonmolenda accepted this revision.Jul 13 2023, 1:07 PM

LGTM.

lldb/source/Plugins/SymbolFile/CTF/SymbolFileCTF.cpp
151

Should this be m_data.GetByteSize() - sizeof(ctf_header_t) ? m_data is a compressed ctf_header_t plus a compressed data payload?

183

Do you need to copy the ctf_header_t from m_data into the decompressed_data buffer, then decompressing the compressed data, to get header + data in m_data? Oh wait, I see, after you've copied the header into your ctf_header local, you don't need it any longer in m_data and m_body_offset either points to the end of the header (uncompressed CTF) or it points to the start of m_data which doesn't include the header. ok.

This revision is now accepted and ready to land.Jul 13 2023, 1:07 PM
This revision was automatically updated to reflect the committed changes.
JDevlieghere marked an inline comment as done.
Herald added a project: Restricted Project. · View Herald TranscriptJul 13 2023, 3:10 PM