[Lldb-commits] [PATCH] D66791: [lldb][ELF] Read symbols from .gnu_debugdata sect.

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 7 08:19:50 PDT 2019


labath added inline comments.


================
Comment at: lldb/source/Host/common/LZMA.cpp:84
+  lzma_ret xzerr = lzma_stream_footer_decode(
+      &opts, InputBuffer.data() + InputBuffer.size() - LZMA_STREAM_HEADER_SIZE);
+  if (xzerr != LZMA_OK) {
----------------
kwk wrote:
> labath wrote:
> > Maybe `InputBuffer.take_back(LZMA_STREAM_HEADER_SIZE).data()` ?
> `take_back`:
> 
> 
> > Return a copy of *this with only the last \p N elements.
> 
>  I mean `LZMA_STREAM_HEADER_SIZE` is only 12 but do we really need it?
> 
Yeah, that documentation is somewhat misleading. If you look at the implementation you'll see that there's no copying involved (ArrayRefs never copy anything -- that's their whole point of existence). So, I still think that this is better/more readable with `take_back`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D66791





More information about the lldb-commits mailing list