[Lldb-commits] [PATCH] D56293: Use the minidump exception record if present

Leonard Mosescu via lldb-commits lldb-commits at lists.llvm.org
Fri Jan 4 12:41:28 PST 2019


Great! I can see how we can put this to good use.

In the meantime, I'd like to submit this change as is - the included input
files are intended to be reused for future test cases as well (they are
extracted from my larger change to add support for the native PDB reader +
minidumps).

On Fri, Jan 4, 2019 at 12:39 PM Greg Clayton <clayborg at gmail.com> wrote:

>
>
> On Jan 4, 2019, at 12:37 PM, Leonard Mosescu <mosescu at google.com> wrote:
>
> Sounds very useful. Are you planning to add it to the LLDB repository?
>
>
> Yes
>
>
>
> On Fri, Jan 4, 2019 at 10:56 AM Greg Clayton <clayborg at gmail.com> wrote:
>
>>
>>
>> On Jan 4, 2019, at 9:45 AM, Leonard Mosescu <mosescu at google.com> wrote:
>>
>> I have a minidump generator if you need me to make any specific minidump
>>> files for you.
>>>
>>
>> Maybe not in this case, but it seems an interesting idea. What are the
>> capabilities of this generator tool?
>>
>>
>> I can generate threads contexts, any of the textual directory streams,
>> memory regions (32 and 64), module lists, and more.
>>
>> Example code from my python "minidump" module that shows generation of a
>> minidump. Not all of this goes together (example code for ARM and ARM64),
>> but it shows what you can easily do:
>>
>> system_info = minidump.SystemInfo(
>>         ProcessorArchitecture=minidump.PROCESSOR_ARCHITECTURE_ARM64,
>>         PlatformId=minidump.VER_PLATFORM_LINUX,
>>         CSDVersion=minidump.String('15E216'))
>>
>> md = minidump.Generator(system_info, ProcessId=123)
>>
>> x = []
>> v = []
>> for i in range(32):
>>     x.append(i+1 | i+2 << 32 | i+3 << 48)
>> for i in range(32):
>>     for j in range(16):
>>         v.append(i+j)
>>
>> thread = minidump.Thread(ThreadId=0x1000,
>>                             Registers=minidump.ThreadContext_ARM64(
>>                                 x=x, pc=0x1000, cpsr=0x11223344,
>>                                 fpsr=0x55667788, fpcr=0x99AABBCC, v=v))
>>
>> system_info = minidump.SystemInfo(
>>         ProcessorArchitecture=minidump.PROCESSOR_ARCHITECTURE_ARM,
>>         PlatformId=minidump.VER_PLATFORM_MACOSX,
>>         CSDVersion=minidump.String('ABC123'))
>>
>> md = minidump.Generator(system_info, ProcessId=123)
>>
>> r = []
>> d = []
>> extra = []
>> for i in range(1, 17):
>>     r.append(i)
>> for i in range(1, 33):
>>     d.append(i | i << 8 | i << 32 | i << 48)
>> for i in range(8):
>>     extra.append(i | i << 16)
>>
>> thread = minidump.Thread(ThreadId=0x1000,
>>                             Registers=minidump.ThreadContext_ARM(
>>                                 r=r, cpsr=0x11223344,
>>                                 fpscr=0x55667788AABBCCDD, d=d,
>>                                 extra=extra))
>> md.add_thread(thread)
>> md.add_thread(minidump.Thread(ThreadId=0x55667788))
>>
>> md.add_module(minidump.Module(BaseOfImage=0x10000,
>>                                 SizeOfImage=0x2000,
>>                                 CheckSum=0,
>>                                 TimeDateStamp=0,
>>                                 ModuleName="/tmp/b",
>>                                 VersionInfo=None,
>>                                 CvRecord=None,
>>                                 MiscRecord=None,
>>                                 Reserved0=0,
>>                                 Reserved1=0))
>>
>> md.add_module(minidump.Module(BaseOfImage=0x2000,
>>                                 SizeOfImage=0x1000,
>>                                 CheckSum=0,
>>                                 TimeDateStamp=0,
>>                                 ModuleName="/tmp/a",
>>                                 VersionInfo=None,
>>                                 CvRecord=None,
>>                                 MiscRecord=None,
>>                                 Reserved0=0,
>>                                 Reserved1=0))
>>
>> md.add_module(minidump.Module(BaseOfImage=0x1000,
>>                                 SizeOfImage=0x1000,
>>                                 CheckSum=0,
>>                                 TimeDateStamp=0,
>>                                 ModuleName="/tmp/b",
>>                                 VersionInfo=None,
>>                                 CvRecord=None,
>>                                 MiscRecord=None,
>>                                 Reserved0=0,
>>                                 Reserved1=0))
>>
>>
>> md.add_module(minidump.Module(BaseOfImage=0x5000,
>>                                 SizeOfImage=0x3000,
>>                                 CheckSum=0,
>>                                 TimeDateStamp=0,
>>                                 ModuleName="/tmp/b",
>>                                 VersionInfo=None,
>>                                 CvRecord=None,
>>                                 MiscRecord=None,
>>                                 Reserved0=0,
>>                                 Reserved1=0))
>> md.add_memory(minidump.MemoryDescriptor(StartOfMemoryRange=0x8000,
>>                                         Bytes='Hello world!'))
>> md.add_memory(minidump.MemoryDescriptor(StartOfMemoryRange=0x8010,
>>                                         Bytes='Goodbye moon...'))
>> md.add_memory64(minidump.MemoryDescriptor64(StartOfMemoryRange=0x1000,
>>                                             Bytes='1' * 16))
>> md.add_memory64(minidump.MemoryDescriptor64(StartOfMemoryRange=0x2000,
>>                                             Bytes='3' * 32))
>>
>> md.add_memory(minidump.MemoryDescriptor(StartOfMemoryRange=0x1000,
>>                                         Bytes='1' * 16))
>> md.add_memory(minidump.MemoryDescriptor(StartOfMemoryRange=0x2000,
>>                                         Bytes='3' * 32))
>>
>> maps = '''400d9000-400db000 r-xp 00000000 b3:04 227
>>  /system/bin/app_process
>> 400db000-400dc000 r--p 00001000 b3:04 227        /system/bin/app_process
>> 400dc000-400dd000 rw-p 00000000 00:00 0
>> '''
>> md.add_stream_as_string(minidump.BreakpadLinuxMaps, maps)
>> pad = True
>> addr_size = 4
>> md.save("/tmp/minidump.dmp", addr_size, pad)
>>
>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190104/cf2909f4/attachment.html>


More information about the lldb-commits mailing list