================
@@ -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()));
----------------
igorkudrin wrote:
I added the `assert` to be on the safe side. It shows that the change is
eligible, and if I overlooked some exotic execution path, it will trigger and
point directly to the problem. If you believe it's excessive, I'll remove it.
The copy constructor for `DataExtractor` should be called explicitly, see [the
comment](https://github.com/llvm/llvm-project/blob/03841e7ab847b279d65be707a8e0f2799fd69f50/lldb/include/lldb/Utility/DataExtractor.h#L137).
And `GetAuxvData()` cannot return a reference to a data member because in some
classes it returns a temporary object.
https://github.com/llvm/llvm-project/pull/102263
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits