[Lldb-commits] [PATCH] D62500: Add support to read aux vector values

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue May 28 07:40:40 PDT 2019


clayborg requested changes to this revision.
clayborg added inline comments.


================
Comment at: lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp:2091-2093
+    DataExtractor auxv_data(buffer_or_error.get()->getBufferStart(),
+                            buffer_or_error.get()->getBufferSize(),
+                            GetByteOrder(), GetAddressByteSize());
----------------
We need to get a copy of the data here right? I believe the "buffer_or_error" local variable will go out of scope and the data pointed to will be freed. You can use:
```
  lldb::offset_t DataExtractor::CopyData(lldb::offset_t offset, lldb::offset_t length, void *dst) const;
```
which will copy of the data and internally own it in a DataBufferSP. Or you can create a DataBufferSP yourself using DataBufferHeap and placing it into a DataBufferSP and then passing that to the DataExtractor constructor or SetData method.



================
Comment at: lldb/source/Plugins/Process/Utility/ELFAuxVector.cpp:18
+  lldb::offset_t saved_offset = *offset_ptr;
+  *value = data.GetMaxU64(offset_ptr, data.GetAddressByteSize());
+  return *offset_ptr != saved_offset;
----------------
```
data.GetAddress(offset_ptr);
```


================
Comment at: lldb/source/Plugins/Process/Utility/ELFAuxVector.h:67
+
+  std::unordered_map<uint64_t, uint64_t> m_auxv_entries;
+};
----------------
Is there only ever one entry in the AUXV map for each EntryType?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62500/new/

https://reviews.llvm.org/D62500





More information about the lldb-commits mailing list