Cygwin: Handle out of order modules for module offsets in stackdump
Improve address to module+offset conversion, to work correctly in the
presence of out-of-order elements in InMemoryOrderModuleList.
Fixes: d59651d4
This commit is contained in:
parent
a8526cb52b
commit
564c88b898
|
@ -342,11 +342,13 @@ prettyprint_va (PVOID func_va)
|
||||||
{
|
{
|
||||||
PLDR_DATA_TABLE_ENTRY mod = CONTAINING_RECORD (x, LDR_DATA_TABLE_ENTRY,
|
PLDR_DATA_TABLE_ENTRY mod = CONTAINING_RECORD (x, LDR_DATA_TABLE_ENTRY,
|
||||||
InMemoryOrderLinks);
|
InMemoryOrderLinks);
|
||||||
if (mod->DllBase > func_va)
|
if ((func_va < mod->DllBase) ||
|
||||||
|
(func_va > (PVOID)((DWORD_PTR)mod->DllBase + mod->SizeOfImage)))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
__small_sprintf (buf, "%S+0x%x", &mod->BaseDllName,
|
__small_sprintf (buf, "%S+0x%x", &mod->BaseDllName,
|
||||||
(DWORD_PTR)func_va - (DWORD_PTR)mod->DllBase);
|
(DWORD_PTR)func_va - (DWORD_PTR)mod->DllBase);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return buf;
|
return buf;
|
||||||
|
|
Loading…
Reference in New Issue