[Lldb-commits] [lldb] 494eec0 - [lldb][NFCI] Simplify ProcessElfCore::GetAuxvData() (#102263)
via lldb-commits
lldb-commits at lists.llvm.org
Tue Aug 13 10:55:31 PDT 2024
Author: Igor Kudrin
Date: 2024-08-13T10:55:28-07:00
New Revision: 494eec0255d0e270ed877e960843177759f0ee73
URL: https://github.com/llvm/llvm-project/commit/494eec0255d0e270ed877e960843177759f0ee73
DIFF: https://github.com/llvm/llvm-project/commit/494eec0255d0e270ed877e960843177759f0ee73.diff
LOG: [lldb][NFCI] Simplify ProcessElfCore::GetAuxvData() (#102263)
There is no need to clone the content and set extraction properties
because `m_auxv` is already in the required form.
Added:
Modified:
lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
Removed:
################################################################################
diff --git a/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp b/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
index 30af9345999c41..e73e31ca78d19f 100644
--- a/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
+++ b/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
@@ -1077,10 +1077,10 @@ ArchSpec ProcessElfCore::GetArchitecture() {
}
DataExtractor ProcessElfCore::GetAuxvData() {
- const uint8_t *start = m_auxv.GetDataStart();
- size_t len = m_auxv.GetByteSize();
- lldb::DataBufferSP buffer(new lldb_private::DataBufferHeap(start, len));
- return DataExtractor(buffer, GetByteOrder(), GetAddressByteSize());
+ assert(m_auxv.GetByteSize() == 0 ||
+ (m_auxv.GetByteOrder() == GetByteOrder() &&
+ m_auxv.GetAddressByteSize() == GetAddressByteSize()));
+ return DataExtractor(m_auxv);
}
bool ProcessElfCore::GetProcessInfo(ProcessInstanceInfo &info) {
More information about the lldb-commits
mailing list