[Lldb-commits] [PATCH] D45700: Improve LLDB's handling of non-local minidumps

Leonard Mosescu via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 16 14:15:50 PDT 2018

lemo created this revision.
lemo added reviewers: clayborg, labath, amccarth.
lemo added a project: LLDB.
Herald added subscribers: JDevlieghere, aprantl.

Normally, LLDB is creating a high-fidelity representation of a live
process, including a list of modules and sections, with the 
associated memory address ranges. In order to build the module and
section map LLDB tries to locate the local module image (object file)
and will parse it.

This does not work for postmortem debugging scenarios where the crash
dump (minidump in this case) was captured on a different machine.

Also, we may want to completly disable the search for matching
local object files if we load minidumps unless we can prove that the
local image matches the one from the crash origin.
(not part of this change, see: llvm.org/pr35193)

Fortunatelly the minidump format encodes enough information about
each module's memory range to allow us to create placeholder modules.
This enables most LLDB functionality involving address-to-module

Example: Identify the module from a stack frame PC:


- thread #1, stop reason = Exception 0xc0000005 encountered at address 0x164d14
  - frame #0: 0x00164d14 frame #1: 0x00167c79 frame #2: 0x00167e6d frame #3: 0x7510336a frame #4: 0x77759882 frame #5: 0x77759855


- thread #1, stop reason = Exception 0xc0000005 encountered at address 0x164d14
  - frame #0: 0x00164d14 C:\Users\amccarth\Documents\Visual Studio 2013\Projects\fizzbuzz\Debug\fizzbuzz.exe frame #1: 0x00167c79 C:\Users\amccarth\Documents\Visual Studio 2013\Projects\fizzbuzz\Debug\fizzbuzz.exe frame #2: 0x00167e6d C:\Users\amccarth\Documents\Visual Studio 2013\Projects\fizzbuzz\Debug\fizzbuzz.exe frame #3: 0x7510336a C:\Windows\SysWOW64\kernel32.dll frame #4: 0x77759882 C:\Windows\SysWOW64\ntdll.dll frame #5: 0x77759855 C:\Windows\SysWOW64\ntdll.dll

Example: target modules list

error: the target has no associated executable images

[  0] C:\Windows\System32\MSVCP120D.dll 
[  1] C:\Windows\SysWOW64\kernel32.dll 
[  2] C:\Users\amccarth\Documents\Visual Studio 2013\Projects\fizzbuzz\Debug\fizzbuzz.exe 
[  3] C:\Windows\System32\MSVCR120D.dll 
[  4] C:\Windows\SysWOW64\KERNELBASE.dll 
[  5] C:\Windows\SysWOW64\ntdll.dll

NOTE: the minidump format also includes the debug info GUID, so we can
fill-in the module UUID from it, but this part was excluded from this change
to keep the changes simple (the LLDB UUID is hardcoded to be either 16 or 20
bytes, while the CodeView GUIDs are normally 24 bytes)



-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45700.142694.patch
Type: text/x-patch
Size: 8275 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20180416/274e3a12/attachment.bin>

More information about the lldb-commits mailing list