<div dir="ltr">Great! I can see how we can put this to good use.<div><br></div><div>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).</div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Jan 4, 2019 at 12:39 PM Greg Clayton <<a href="mailto:clayborg@gmail.com">clayborg@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;"><br><div><br><blockquote type="cite"><div>On Jan 4, 2019, at 12:37 PM, Leonard Mosescu <<a href="mailto:mosescu@google.com" target="_blank">mosescu@google.com</a>> wrote:</div><br class="gmail-m_6234062368574986036Apple-interchange-newline"><div><div dir="ltr">Sounds very useful. Are you planning to add it to the LLDB repository?</div></div></blockquote><div><br></div>Yes<br><blockquote type="cite"><div><div dir="ltr"><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Jan 4, 2019 at 10:56 AM Greg Clayton <<a href="mailto:clayborg@gmail.com" target="_blank">clayborg@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><br><div><br><blockquote type="cite"><div>On Jan 4, 2019, at 9:45 AM, Leonard Mosescu <<a href="mailto:mosescu@google.com" target="_blank">mosescu@google.com</a>> wrote:</div><br class="gmail-m_6234062368574986036gmail-m_7456183298312665668Apple-interchange-newline"><div><div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I have a minidump generator if you need me to make any specific minidump files for you.<br></blockquote><div><br></div><div>Maybe not in this case, but it seems an interesting idea. What are the capabilities of this generator tool?</div></div></div></blockquote><div><br></div>I can generate threads contexts, any of the textual directory streams, memory regions (32 and 64), module lists, and more.</div><div><br></div><div>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:</div><div><br></div><div>system_info = minidump.SystemInfo(<br>        ProcessorArchitecture=minidump.PROCESSOR_ARCHITECTURE_ARM64,<br>        PlatformId=minidump.VER_PLATFORM_LINUX,<br>        CSDVersion=minidump.String('15E216'))<br><br>md = minidump.Generator(system_info, ProcessId=123)<br><br>x = []<br>v = []<br>for i in range(32):<br>    x.append(i+1 | i+2 << 32 | i+3 << 48)<br>for i in range(32):<br>    for j in range(16):<br>        v.append(i+j)<br><br>thread = minidump.Thread(ThreadId=0x1000,<br>                            Registers=minidump.ThreadContext_ARM64(<br>                                x=x, pc=0x1000, cpsr=0x11223344,<br>                                fpsr=0x55667788, fpcr=0x99AABBCC, v=v))<br><br>system_info = minidump.SystemInfo(<br>        ProcessorArchitecture=minidump.PROCESSOR_ARCHITECTURE_ARM,<br>        PlatformId=minidump.VER_PLATFORM_MACOSX,<br>        CSDVersion=minidump.String('ABC123'))<br><br>md = minidump.Generator(system_info, ProcessId=123)<br><br>r = []<br>d = []<br>extra = []<br>for i in range(1, 17):<br>    r.append(i)<br>for i in range(1, 33):<br>    d.append(i | i << 8 | i << 32 | i << 48)<br>for i in range(8):<br>    extra.append(i | i << 16)<br><br>thread = minidump.Thread(ThreadId=0x1000,<br>                            Registers=minidump.ThreadContext_ARM(<br>                                r=r, cpsr=0x11223344,<br>                                fpscr=0x55667788AABBCCDD, d=d,<br>                                extra=extra))<br>md.add_thread(thread)<br>md.add_thread(minidump.Thread(ThreadId=0x55667788))<br><br>md.add_module(minidump.Module(BaseOfImage=0x10000,<br>                                SizeOfImage=0x2000,<br>                                CheckSum=0,<br>                                TimeDateStamp=0,<br>                                ModuleName="/tmp/b",<br>                                VersionInfo=None,<br>                                CvRecord=None,<br>                                MiscRecord=None,<br>                                Reserved0=0,<br>                                Reserved1=0))<br><br>md.add_module(minidump.Module(BaseOfImage=0x2000,<br>                                SizeOfImage=0x1000,<br>                                CheckSum=0,<br>                                TimeDateStamp=0,<br>                                ModuleName="/tmp/a",<br>                                VersionInfo=None,<br>                                CvRecord=None,<br>                                MiscRecord=None,<br>                                Reserved0=0,<br>                                Reserved1=0))<br><br>md.add_module(minidump.Module(BaseOfImage=0x1000,<br>                                SizeOfImage=0x1000,<br>                                CheckSum=0,<br>                                TimeDateStamp=0,<br>                                ModuleName="/tmp/b",<br>                                VersionInfo=None,<br>                                CvRecord=None,<br>                                MiscRecord=None,<br>                                Reserved0=0,<br>                                Reserved1=0))<br><br><br>md.add_module(minidump.Module(BaseOfImage=0x5000,<br>                                SizeOfImage=0x3000,<br>                                CheckSum=0,<br>                                TimeDateStamp=0,<br>                                ModuleName="/tmp/b",<br>                                VersionInfo=None,<br>                                CvRecord=None,<br>                                MiscRecord=None,<br>                                Reserved0=0,<br>                                Reserved1=0))<br>md.add_memory(minidump.MemoryDescriptor(StartOfMemoryRange=0x8000,<br>                                        Bytes='Hello world!'))<br>md.add_memory(minidump.MemoryDescriptor(StartOfMemoryRange=0x8010,<br>                                        Bytes='Goodbye moon...'))<br>md.add_memory64(minidump.MemoryDescriptor64(StartOfMemoryRange=0x1000,<br>                                            Bytes='1' * 16))<br>md.add_memory64(minidump.MemoryDescriptor64(StartOfMemoryRange=0x2000,<br>                                            Bytes='3' * 32))<br><br>md.add_memory(minidump.MemoryDescriptor(StartOfMemoryRange=0x1000,<br>                                        Bytes='1' * 16))<br>md.add_memory(minidump.MemoryDescriptor(StartOfMemoryRange=0x2000,<br>                                        Bytes='3' * 32))<br><br>maps = '''400d9000-400db000 r-xp 00000000 b3:04 227        /system/bin/app_process<br>400db000-400dc000 r--p 00001000 b3:04 227        /system/bin/app_process<br>400dc000-400dd000 rw-p 00000000 00:00 0 <br>'''<br>md.add_stream_as_string(minidump.BreakpadLinuxMaps, maps)<br></div><div>pad = True<br>addr_size = 4<br>md.save("/tmp/minidump.dmp", addr_size, pad)</div><div><br></div><div><br><br></div></div></blockquote></div>
</div></blockquote></div><br></div></blockquote></div>