[Lldb-commits] [PATCH] D59562: [SymbolFileDWARF] Introduce DWARFContext

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Mar 20 07:45:26 PDT 2019

labath added inline comments.

Comment at: lldb/source/Plugins/SymbolFile/DWARF/DWARFContext.h:28
+  void SetDwarfData(const DWARFDataExtractor &dwarf);
clayborg wrote:
> labath wrote:
> > Don't want to block progress here over this, but I just wanted to say that my impression was that this DwarfData business was a relict from the time when we re not mmapping the input object files. These days, we always mmap the input, and so I don't believe that should be necessary because ObjectFileMachO will automatically perform the DataBuffer slicing that you're doing here manually as a part of ReadSectionData.
> > 
> > Maybe one of the Apple folks could check whether this is really needed, because if it isn't, it will make your job easier here, as well as produce an API that is more similar to its llvm counterpart.
> We don't always mmap. We mmap if the file is local. We read the entire file if the file is on a network drive. If we don't do this and we mmap a NFS file, and that mount goes away, we crash the next time we access a page that hasn't been paged in. So we don't know if stuff is actually mmap'ed or not.
Yeah, I wasn't being fully correct here, but this distinction does not really matter here. Even if we don't mmap, we will end up with a full image of the file in memory, so anybody can slice any chunk of that file as he sees fit. Since ObjectFileMachO::ReadSectionData already implements this slicing, there's no advantage in slicing manually here.



More information about the lldb-commits mailing list