Commit b8910217 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

winedump: Support a couple of 'section' options (minidump).

parent 2253504a
...@@ -228,7 +228,9 @@ static const struct my_option option_table[] = { ...@@ -228,7 +228,9 @@ static const struct my_option option_table[] = {
" for NE: export, resource\n" " for NE: export, resource\n"
" for PE: import, export, debug, resource, tls, loadcfg, clr, reloc, dynreloc, except, apiset\n" " for PE: import, export, debug, resource, tls, loadcfg, clr, reloc, dynreloc, except, apiset\n"
" for PDB: PDB, TPI, DBI, IPI, public, image\n" " for PDB: PDB, TPI, DBI, IPI, public, image\n"
" and suboptions: hash (PDB, TPI, TPI, DBI, public) and line (DBI)"}, " and suboptions: hash (PDB, TPI, TPI, DBI, public) and line (DBI)\n"
" for minidump: exception, handle, info, memory, module, thread\n"
" and suboptions: content (memory, module, thread)\n"},
{"-t", DUMP, 0, do_symtable, "-t Dump symbol table"}, {"-t", DUMP, 0, do_symtable, "-t Dump symbol table"},
{"-x", DUMP, 0, do_dumpall, "-x Dump everything"}, {"-x", DUMP, 0, do_dumpall, "-x Dump everything"},
{"sym", DMGL, 0, do_demangle, "sym <sym> Demangle C++ symbol <sym> and exit"}, {"sym", DMGL, 0, do_demangle, "sym <sym> Demangle C++ symbol <sym> and exit"},
......
...@@ -85,6 +85,7 @@ void mdmp_dump(void) ...@@ -85,6 +85,7 @@ void mdmp_dump(void)
switch (dir->StreamType) switch (dir->StreamType)
{ {
case ThreadListStream: case ThreadListStream:
if (globals_dump_sect("thread"))
{ {
const MINIDUMP_THREAD_LIST *mtl = stream; const MINIDUMP_THREAD_LIST *mtl = stream;
const MINIDUMP_THREAD *mt = mtl->Threads; const MINIDUMP_THREAD *mt = mtl->Threads;
...@@ -99,6 +100,7 @@ void mdmp_dump(void) ...@@ -99,6 +100,7 @@ void mdmp_dump(void)
printf(" Priority: %u\n", mt->Priority); printf(" Priority: %u\n", mt->Priority);
printf(" Teb: %s\n", get_hexint64_str(mt->Teb)); printf(" Teb: %s\n", get_hexint64_str(mt->Teb));
printf(" Stack: %s +%#x\n", get_hexint64_str(mt->Stack.StartOfMemoryRange), mt->Stack.Memory.DataSize); printf(" Stack: %s +%#x\n", get_hexint64_str(mt->Stack.StartOfMemoryRange), mt->Stack.Memory.DataSize);
if (globals_dump_sect("content"))
dump_mdmp_data(&mt->Stack.Memory, " "); dump_mdmp_data(&mt->Stack.Memory, " ");
printf(" ThreadContext:\n"); printf(" ThreadContext:\n");
dump_mdmp_data(&mt->ThreadContext, " "); dump_mdmp_data(&mt->ThreadContext, " ");
...@@ -107,6 +109,7 @@ void mdmp_dump(void) ...@@ -107,6 +109,7 @@ void mdmp_dump(void)
break; break;
case ModuleListStream: case ModuleListStream:
case 0xFFF0: case 0xFFF0:
if (globals_dump_sect("module"))
{ {
const MINIDUMP_MODULE_LIST *mml = stream; const MINIDUMP_MODULE_LIST *mml = stream;
const MINIDUMP_MODULE* mm = mml->Modules; const MINIDUMP_MODULE* mm = mml->Modules;
...@@ -184,8 +187,10 @@ void mdmp_dump(void) ...@@ -184,8 +187,10 @@ void mdmp_dump(void)
printf(" dwFileDate: %x%08x\n", printf(" dwFileDate: %x%08x\n",
(UINT)mm->VersionInfo.dwFileDateMS, (UINT)mm->VersionInfo.dwFileDateLS); (UINT)mm->VersionInfo.dwFileDateMS, (UINT)mm->VersionInfo.dwFileDateLS);
printf(" CvRecord: <%u>\n", (UINT)mm->CvRecord.DataSize); printf(" CvRecord: <%u>\n", (UINT)mm->CvRecord.DataSize);
if (globals_dump_sect("content"))
dump_mdmp_data(&mm->CvRecord, " "); dump_mdmp_data(&mm->CvRecord, " ");
printf(" MiscRecord: <%u>\n", (UINT)mm->MiscRecord.DataSize); printf(" MiscRecord: <%u>\n", (UINT)mm->MiscRecord.DataSize);
if (globals_dump_sect("content"))
dump_mdmp_data(&mm->MiscRecord, " "); dump_mdmp_data(&mm->MiscRecord, " ");
printf(" Reserved0: %s\n", get_hexint64_str(mm->Reserved0)); printf(" Reserved0: %s\n", get_hexint64_str(mm->Reserved0));
printf(" Reserved1: %s\n", get_hexint64_str(mm->Reserved1)); printf(" Reserved1: %s\n", get_hexint64_str(mm->Reserved1));
...@@ -193,6 +198,7 @@ void mdmp_dump(void) ...@@ -193,6 +198,7 @@ void mdmp_dump(void)
} }
break; break;
case MemoryListStream: case MemoryListStream:
if (globals_dump_sect("memory"))
{ {
const MINIDUMP_MEMORY_LIST *mml = stream; const MINIDUMP_MEMORY_LIST *mml = stream;
const MINIDUMP_MEMORY_DESCRIPTOR* mmd = mml->MemoryRanges; const MINIDUMP_MEMORY_DESCRIPTOR* mmd = mml->MemoryRanges;
...@@ -201,12 +207,15 @@ void mdmp_dump(void) ...@@ -201,12 +207,15 @@ void mdmp_dump(void)
for (i = 0; i < mml->NumberOfMemoryRanges; i++, mmd++) for (i = 0; i < mml->NumberOfMemoryRanges; i++, mmd++)
{ {
printf(" Memory Range #%d:\n", i); printf(" Memory Range #%d:\n", i);
dump_mdmp_data(&mmd->Memory, " ");
printf(" Range: %s +%#x\n", get_hexint64_str(mmd->StartOfMemoryRange), mmd->Memory.DataSize); printf(" Range: %s +%#x\n", get_hexint64_str(mmd->StartOfMemoryRange), mmd->Memory.DataSize);
if (globals_dump_sect("content"))
dump_mdmp_data(&mmd->Memory, " "); dump_mdmp_data(&mmd->Memory, " ");
} }
} }
break; break;
case SystemInfoStream: case SystemInfoStream:
if (globals_dump_sect("info"))
{ {
const MINIDUMP_SYSTEM_INFO *msi = stream; const MINIDUMP_SYSTEM_INFO *msi = stream;
const char* str; const char* str;
...@@ -369,6 +378,7 @@ void mdmp_dump(void) ...@@ -369,6 +378,7 @@ void mdmp_dump(void)
} }
break; break;
case MiscInfoStream: case MiscInfoStream:
if (globals_dump_sect("info"))
{ {
const MINIDUMP_MISC_INFO *mmi = stream; const MINIDUMP_MISC_INFO *mmi = stream;
...@@ -386,6 +396,7 @@ void mdmp_dump(void) ...@@ -386,6 +396,7 @@ void mdmp_dump(void)
} }
break; break;
case ExceptionStream: case ExceptionStream:
if (globals_dump_sect("exception"))
{ {
const MINIDUMP_EXCEPTION_STREAM *mes = stream; const MINIDUMP_EXCEPTION_STREAM *mes = stream;
...@@ -406,6 +417,7 @@ void mdmp_dump(void) ...@@ -406,6 +417,7 @@ void mdmp_dump(void)
} }
break; break;
case HandleDataStream: case HandleDataStream:
if (globals_dump_sect("handle"))
{ {
const MINIDUMP_HANDLE_DATA_STREAM *mhd = stream; const MINIDUMP_HANDLE_DATA_STREAM *mhd = stream;
...@@ -439,6 +451,7 @@ void mdmp_dump(void) ...@@ -439,6 +451,7 @@ void mdmp_dump(void)
} }
break; break;
case ThreadInfoListStream: case ThreadInfoListStream:
if (globals_dump_sect("thread"))
{ {
const MINIDUMP_THREAD_INFO_LIST *til = stream; const MINIDUMP_THREAD_INFO_LIST *til = stream;
...@@ -468,8 +481,8 @@ void mdmp_dump(void) ...@@ -468,8 +481,8 @@ void mdmp_dump(void)
} }
} }
break; break;
case UnloadedModuleListStream: case UnloadedModuleListStream:
if (globals_dump_sect("module"))
{ {
const MINIDUMP_UNLOADED_MODULE_LIST *uml = stream; const MINIDUMP_UNLOADED_MODULE_LIST *uml = stream;
...@@ -494,11 +507,11 @@ void mdmp_dump(void) ...@@ -494,11 +507,11 @@ void mdmp_dump(void)
} }
} }
break; break;
default: default:
printf("NIY %d\n", dir->StreamType); printf("NIY %d\n", dir->StreamType);
printf(" RVA: %u\n", (UINT)dir->Location.Rva); printf(" RVA: %u\n", (UINT)dir->Location.Rva);
printf(" Size: %u\n", dir->Location.DataSize); printf(" Size: %u\n", dir->Location.DataSize);
if (globals_dump_sect("content"))
dump_mdmp_data(&dir->Location, " "); dump_mdmp_data(&dir->Location, " ");
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment