[PATCH] D53379: GSYM symbolication format

Greg Clayton via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 26 16:30:33 PDT 2018


clayborg added inline comments.


================
Comment at: include/llvm/DebugInfo/GSYM/GsymReader.h:46
+struct Header {
+  uint32_t Magic;
+  uint16_t Version;
----------------
zturner wrote:
> clayborg wrote:
> > With the switch to using BinaryStreamReader this might just work now if I understand the class directly. I switched over to decoding ArrayRefs for AddrOffsets, AddrInfoOffsets and FileEntry in the GsymReader. So this format can be any endian if needed. BinaryStreamReader would make a copy and swap them right?
> I'm not sure I understand the question about making a copy and swapping.  `BinaryStreamReader` never makes a copy of anything (that's one of the nice things about it actually).  So you'd say something like:
> 
> ```
> const Header *Header = nullptr;
> BinaryStreamReader Reader(Stream);
> Reader.readObject(Header);
> ```
> 
> Note that header was never declared as an object to begin with, just a pointer.  So no copy ever happened.  All that happened was it changed the value of your pointer to point into the buffer.
> 
> Does that answer your question?
I was commenting on the ArrayRef stuff I used when decoding an array of integers for the AddrOffsets, AddrInfoOffsets and FileEntry in GsymReader::init(...). I know pointers won't ever have their contents swapped. It would be easy to unswap the header if needed. I mostly worry about the array of address offsets and that is the only performance specific bottleneck if things are byte reversed.


https://reviews.llvm.org/D53379





More information about the llvm-commits mailing list