[all-commits] [llvm/llvm-project] 244258: Modify DataEncoder to be able to encode data in an...
Greg Clayton via All-commits
all-commits at lists.llvm.org
Tue Dec 7 09:45:12 PST 2021
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 244258e35acc92b3293e91ddecee6a8c8613ec20
https://github.com/llvm/llvm-project/commit/244258e35acc92b3293e91ddecee6a8c8613ec20
Author: Greg Clayton <gclayton at fb.com>
Date: 2021-12-07 (Tue, 07 Dec 2021)
Changed paths:
M lldb/include/lldb/Utility/DataEncoder.h
M lldb/include/lldb/lldb-forward.h
M lldb/source/Expression/DWARFExpression.cpp
M lldb/source/Plugins/Platform/Android/AdbClient.cpp
M lldb/source/Utility/DataEncoder.cpp
M lldb/unittests/Process/POSIX/NativeProcessELFTest.cpp
M lldb/unittests/Utility/CMakeLists.txt
A lldb/unittests/Utility/DataEncoderTest.cpp
Log Message:
-----------
Modify DataEncoder to be able to encode data in an object owned buffer.
DataEncoder was previously made to modify data within an existing buffer. As the code progressed, new clients started using DataEncoder to create binary data. In these cases the use of this class was possibly, but only if you knew exactly how large your buffer would be ahead of time. This patchs adds the ability for DataEncoder to own a buffer that can be dynamically resized as data is appended to the buffer.
Change in this patch:
- Allow a DataEncoder object to be created that owns a DataBufferHeap object that can dynamically grow as data is appended
- Add new methods that start with "Append" to append data to the buffer and grow it as needed
- Adds full testing of the API to assure modifications don't regress any functionality
- Has two constructors: one that uses caller owned data and one that creates an object with object owned data
- "Append" methods only work if the object owns it own data
- Removes the ability to specify a shared memory buffer as no one was using this functionality. This allows us to switch to a case where the object owns its own data in a DataBufferHeap that can be resized as data is added
"Put" methods work on both caller and object owned data.
"Append" methods work on only object owned data where we can grow the buffer. These methods will return false if called on a DataEncoder object that has caller owned data.
The main reason for these modifications is to be able to use the DateEncoder objects instead of llvm::gsym::FileWriter in https://reviews.llvm.org/D113789. This patch wants to add the ability to create symbol table caching to LLDB and the code needs to build binary caches and save them to disk.
Reviewed By: labath
Differential Revision: https://reviews.llvm.org/D115073
More information about the All-commits
mailing list