llvm-project/lldb/source/Utility
Greg Clayton 244258e35a 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
2021-12-07 09:44:57 -08:00
..
ARM64_DWARF_Registers.h [LLDB] Update AArch64 Dwarf and EH frame register numbers 2020-07-10 11:45:39 +05:00
ARM64_ehframe_Registers.h [LLDB] Update AArch64 Dwarf and EH frame register numbers 2020-07-10 11:45:39 +05:00
ARM_DWARF_Registers.h
ARM_ehframe_Registers.h
ArchSpec.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
Args.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
Baton.cpp
Broadcaster.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
CMakeLists.txt [trace][intel-pt] Implement trace start and trace stop 2021-03-30 17:31:37 -07:00
CompletionRequest.cpp
Connection.cpp
ConstString.cpp [lldb] Rename StringRef _lower() method calls to _insensitive() 2021-06-25 00:22:01 +03:00
DataBufferHeap.cpp
DataBufferLLVM.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
DataEncoder.cpp Modify DataEncoder to be able to encode data in an object owned buffer. 2021-12-07 09:44:57 -08:00
DataExtractor.cpp [lldb] Use C++11 default member initializers 2021-06-09 09:43:13 -07:00
Environment.cpp Try to unbreak lldb build after 973519826e 2021-09-02 11:32:28 -04:00
Event.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
FileSpec.cpp [lldb] Fix windows path guessing for root paths 2021-12-07 11:16:04 +01:00
GDBRemote.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
IOObject.cpp
LLDBAssert.cpp [lldb] Include llvm-config.h instead of config.h 2021-03-29 08:58:51 -07:00
Listener.cpp
Log.cpp [lldb] Rename StringRef _lower() method calls to _insensitive() 2021-06-25 00:22:01 +03:00
Logging.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
NameMatches.cpp
PPC64LE_DWARF_Registers.h
PPC64_DWARF_Registers.h
ProcessInfo.cpp [lldb] Use C++11 default member initializers 2021-06-09 09:43:13 -07:00
RegisterValue.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
RegularExpression.cpp
Reproducer.cpp [lldb] Remove LLDB_CAPTURE_REPRODUCER override 2021-03-31 21:10:56 -07:00
ReproducerInstrumentation.cpp [lldb] Make the thread_local g_global_boundary accessed from a single file 2021-10-14 11:17:20 +03:00
ReproducerProvider.cpp [SystemZ][z/OS][Windows] Add new OF_TextWithCRLF flag and use this flag instead of OF_Text 2021-04-06 07:23:31 -04:00
Scalar.cpp [APInt] Normalize naming on keep constructors / predicate methods. 2021-09-09 09:50:24 -07:00
SelectHelper.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
State.cpp
Status.cpp [lldb] [Utility] Remove Status::WasInterrupted() along with its only use 2021-10-18 10:50:25 +02:00
Stream.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
StreamCallback.cpp
StreamString.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
StringExtractor.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
StringExtractorGDBRemote.cpp [lldb] [gdb-remote] Implement the vRun packet 2021-09-10 14:08:36 +02:00
StringLexer.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
StringList.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
StructuredData.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
TildeExpressionResolver.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
Timer.cpp Revert "Allow signposts to take advantage of deferred string substitution" 2021-10-11 11:09:36 -07:00
TraceGDBRemotePackets.cpp [trace][intel-pt] Implement trace start and trace stop 2021-03-30 17:31:37 -07:00
TraceIntelPTGDBRemotePackets.cpp [intel pt] Add TSC timestamps 2021-07-20 16:29:17 -07:00
UUID.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
UnimplementedError.cpp [lldb/Utility] Introduce UnimplementedError 2020-10-12 13:46:17 +02:00
UriParser.cpp [lldb] [Utility/UriParser] Return results as 'struct URI' 2021-10-25 10:58:21 +02:00
UserID.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
UserIDResolver.cpp
UuidCompatibility.h
VASprintf.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
VMRange.cpp Use llvm::any_of and llvm::none_of (NFC) 2021-10-24 17:35:33 -07:00
XcodeSDK.cpp [lldb] Eliminate unneeded value parameters in Utility (NFC) 2020-07-22 13:56:23 -07:00