Skip to content

Commit 494eec0

Browse files
authored
[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.
1 parent 00a4042 commit 494eec0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,10 +1077,10 @@ ArchSpec ProcessElfCore::GetArchitecture() {
10771077
}
10781078

10791079
DataExtractor ProcessElfCore::GetAuxvData() {
1080-
const uint8_t *start = m_auxv.GetDataStart();
1081-
size_t len = m_auxv.GetByteSize();
1082-
lldb::DataBufferSP buffer(new lldb_private::DataBufferHeap(start, len));
1083-
return DataExtractor(buffer, GetByteOrder(), GetAddressByteSize());
1080+
assert(m_auxv.GetByteSize() == 0 ||
1081+
(m_auxv.GetByteOrder() == GetByteOrder() &&
1082+
m_auxv.GetAddressByteSize() == GetAddressByteSize()));
1083+
return DataExtractor(m_auxv);
10841084
}
10851085

10861086
bool ProcessElfCore::GetProcessInfo(ProcessInstanceInfo &info) {

0 commit comments

Comments
 (0)