mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-02 17:43:44 +00:00
winedbg: Print 'module+disp' instead of 'func+disp' when the address is after the function.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
d65edd04cc
commit
a29a8a317a
1 changed files with 23 additions and 9 deletions
|
@ -583,28 +583,42 @@ void print_address(const ADDRESS64* addr, BOOLEAN with_line)
|
||||||
{
|
{
|
||||||
char buffer[sizeof(SYMBOL_INFO) + 256];
|
char buffer[sizeof(SYMBOL_INFO) + 256];
|
||||||
SYMBOL_INFO* si = (SYMBOL_INFO*)buffer;
|
SYMBOL_INFO* si = (SYMBOL_INFO*)buffer;
|
||||||
void* lin = memory_to_linear_addr(addr);
|
DWORD_PTR lin = (DWORD_PTR)memory_to_linear_addr(addr);
|
||||||
DWORD64 disp64;
|
DWORD64 disp64;
|
||||||
DWORD disp;
|
DWORD disp;
|
||||||
|
IMAGEHLP_MODULE im;
|
||||||
|
|
||||||
print_bare_address(addr);
|
print_bare_address(addr);
|
||||||
|
|
||||||
si->SizeOfStruct = sizeof(*si);
|
si->SizeOfStruct = sizeof(*si);
|
||||||
si->MaxNameLen = 256;
|
si->MaxNameLen = 256;
|
||||||
if (!SymFromAddr(dbg_curr_process->handle, (DWORD_PTR)lin, &disp64, si)) return;
|
im.SizeOfStruct = 0;
|
||||||
dbg_printf(" %s", si->Name);
|
if (SymFromAddr(dbg_curr_process->handle, lin, &disp64, si) && disp64 < si->Size)
|
||||||
if (disp64) dbg_printf("+0x%I64x", disp64);
|
{
|
||||||
|
dbg_printf(" %s", si->Name);
|
||||||
|
if (disp64) dbg_printf("+0x%I64x", disp64);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
im.SizeOfStruct = sizeof(im);
|
||||||
|
if (!SymGetModuleInfo(dbg_curr_process->handle, lin, &im)) return;
|
||||||
|
dbg_printf(" %s", im.ModuleName);
|
||||||
|
if (lin > im.BaseOfImage)
|
||||||
|
dbg_printf("+0x%Ix", lin - im.BaseOfImage);
|
||||||
|
}
|
||||||
if (with_line)
|
if (with_line)
|
||||||
{
|
{
|
||||||
IMAGEHLP_LINE64 il;
|
IMAGEHLP_LINE64 il;
|
||||||
IMAGEHLP_MODULE im;
|
|
||||||
|
|
||||||
il.SizeOfStruct = sizeof(il);
|
il.SizeOfStruct = sizeof(il);
|
||||||
if (SymGetLineFromAddr64(dbg_curr_process->handle, (DWORD_PTR)lin, &disp, &il))
|
if (SymGetLineFromAddr64(dbg_curr_process->handle, lin, &disp, &il))
|
||||||
dbg_printf(" [%s:%u]", il.FileName, il.LineNumber);
|
dbg_printf(" [%s:%u]", il.FileName, il.LineNumber);
|
||||||
im.SizeOfStruct = sizeof(im);
|
if (im.SizeOfStruct == 0) /* don't display again module if address is in module+disp form */
|
||||||
if (SymGetModuleInfo(dbg_curr_process->handle, (DWORD_PTR)lin, &im))
|
{
|
||||||
dbg_printf(" in %s", im.ModuleName);
|
im.SizeOfStruct = sizeof(im);
|
||||||
|
if (SymGetModuleInfo(dbg_curr_process->handle, lin, &im))
|
||||||
|
dbg_printf(" in %s", im.ModuleName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue