[Lldb-commits] [PATCH] D83256: [lldb] Assert on unaligned load in DataExtractor

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Jul 6 16:46:33 PDT 2020


JDevlieghere marked an inline comment as done.
JDevlieghere added inline comments.


================
Comment at: lldb/include/lldb/Utility/DataExtractor.h:1000-1004
+      uint8_t *dst_data = reinterpret_cast<uint8_t *>(&val);
+      const uint8_t *src_data = reinterpret_cast<const uint8_t *>(src);
+      for (size_t i = 0; i < src_size; ++i)
+        dst_data[src_size - 1 - i] = src_data[i];
+      return val;
----------------
clayborg wrote:
> Might be nice to place this into a method function that swaps data of any size. Then other functions can re-use it if needed.
I left it inline here so we can copy the data in place instead copy & swapping. 


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

https://reviews.llvm.org/D83256





More information about the lldb-commits mailing list