Cygwin: Add loaded module base address list to stackdump
This adds an extra section to the stackdump, which lists the loaded modules and their base address. This is perhaps useful as it makes it immediately clear if RandomCrashInjectedDll.dll is loaded... Future work: It seems like the 'InMemoryOrder' part of 'InMemoryOrderModuleList' is a lie? > Loaded modules > 000100400000 segv-test.exe > 7FFF2AC30000 ntdll.dll > 7FFF29050000 KERNEL32.DLL > 7FFF28800000 KERNELBASE.dll > 000180040000 cygwin1.dll > 7FFF28FA0000 advapi32.dll > 7FFF29F20000 msvcrt.dll > 7FFF299E0000 sechost.dll > 7FFF29B30000 RPCRT4.dll > 7FFF27C10000 CRYPTBASE.DLL > 7FFF28770000 bcryptPrimitives.dll
This commit is contained in:
parent
d59651d4da
commit
9b89811c9f
|
@ -383,6 +383,16 @@ cygwin_exception::dumpstack ()
|
||||||
small_printf ("End of stack trace%s\r\n",
|
small_printf ("End of stack trace%s\r\n",
|
||||||
i == DUMPSTACK_FRAME_LIMIT ?
|
i == DUMPSTACK_FRAME_LIMIT ?
|
||||||
" (more stack frames may be present)" : "");
|
" (more stack frames may be present)" : "");
|
||||||
|
|
||||||
|
small_printf ("Loaded modules:\r\n");
|
||||||
|
PLIST_ENTRY head = &NtCurrentTeb()->Peb->Ldr->InMemoryOrderModuleList;
|
||||||
|
for (PLIST_ENTRY x = head->Flink; x != head; x = x->Flink)
|
||||||
|
{
|
||||||
|
PLDR_DATA_TABLE_ENTRY mod = CONTAINING_RECORD (x, LDR_DATA_TABLE_ENTRY,
|
||||||
|
InMemoryOrderLinks);
|
||||||
|
small_printf ("%012X %S\r\n", mod->DllBase, &mod->BaseDllName);
|
||||||
|
}
|
||||||
|
|
||||||
if (h)
|
if (h)
|
||||||
NtClose (h);
|
NtClose (h);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue