Cache memory regions in ProcessMinidump and use the linux maps as the source of the...
authorGreg Clayton <gclayton@apple.com>
Fri, 14 Dec 2018 19:36:01 +0000 (19:36 +0000)
committerGreg Clayton <gclayton@apple.com>
Fri, 14 Dec 2018 19:36:01 +0000 (19:36 +0000)
commit026e1bf56a4be9f10131f3a3f81f11b06377a5c5
tree3d7789c4fc1cab6a3e05e58a9a1c2dccc2b9b545
parentcac3d118ae775647f432c2d0159eca562c486744
Cache memory regions in ProcessMinidump and use the linux maps as the source of the information if available

Breakpad creates minidump files that sometimes have:
- linux maps textual content
- no MemoryInfoList

Right now unless the file has a MemoryInfoList we get no region information.

This patch:

- reads and caches the memory region info one time and sorts it for easy subsequent access
- get the region info from the best source in this order:
  - linux maps info (if available)
  - MemoryInfoList (if available)
  - MemoryList or Memory64List
- returns memory region info for the gaps between regions (before the first and after the last)

Differential Revision: https://reviews.llvm.org/D55522

llvm-svn: 349182
13 files changed:
lldb/include/lldb/Target/MemoryRegionInfo.h
lldb/lldb.xcodeproj/project.pbxproj
lldb/source/Plugins/Process/Utility/CMakeLists.txt
lldb/source/Plugins/Process/Utility/LinuxProcMaps.cpp [new file with mode: 0644]
lldb/source/Plugins/Process/Utility/LinuxProcMaps.h [new file with mode: 0644]
lldb/source/Plugins/Process/minidump/MinidumpParser.cpp
lldb/source/Plugins/Process/minidump/MinidumpParser.h
lldb/source/Plugins/Process/minidump/MinidumpTypes.h
lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp
lldb/unittests/Process/minidump/Inputs/regions-linux-map.dmp [new file with mode: 0644]
lldb/unittests/Process/minidump/Inputs/regions-memlist.dmp [new file with mode: 0644]
lldb/unittests/Process/minidump/Inputs/regions-memlist64.dmp [new file with mode: 0644]
lldb/unittests/Process/minidump/MinidumpParserTest.cpp