[PATCH] [WineDbg]: module name display
Eric Pouech
eric.pouech at wanadoo.fr
Sun Mar 5 14:49:28 CST 2006
- in all places, no longer use the 'in <modname>' form
- added ShowModuleName internal variable
- if TRUE, then all symbols will be displayed as <modname>!<symname>
otherwise, no <modname> will be displayed
A+
---
programs/winedbg/intvar.h | 5 ++---
programs/winedbg/memory.c | 34 ++++++++++++++++++++--------------
programs/winedbg/stack.c | 8 +++++---
3 files changed, 27 insertions(+), 20 deletions(-)
diff --git a/programs/winedbg/intvar.h b/programs/winedbg/intvar.h
index f5830b6..3e8ed7e 100644
--- a/programs/winedbg/intvar.h
+++ b/programs/winedbg/intvar.h
@@ -1,8 +1,6 @@
-/* -*- tab-width: 8; c-basic-offset: 4 -*- */
-
/* Wine internal debugger
* Definitions for internal variables
- * Copyright 2000 Eric Pouech
+ * Copyright 2000,2006 Eric Pouech
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -33,3 +31,4 @@ INTERNAL_VAR(ProcessId, FALSE, &dbg_c
/* symbol manipulation */
INTERNAL_VAR(AlwaysShowThunks, FALSE, NULL, dbg_itype_unsigned_int)
+INTERNAL_VAR(ShowModuleName, FALSE, NULL, dbg_itype_unsigned_int)
diff --git a/programs/winedbg/memory.c b/programs/winedbg/memory.c
index 8d09e9c..e85ce13 100644
--- a/programs/winedbg/memory.c
+++ b/programs/winedbg/memory.c
@@ -510,26 +510,32 @@ void print_address(const ADDRESS* addr,
void* lin = memory_to_linear_addr(addr);
DWORD64 disp64;
DWORD disp;
+ IMAGEHLP_MODULE im;
print_bare_address(addr);
si->SizeOfStruct = sizeof(*si);
si->MaxNameLen = 256;
- if (!SymFromAddr(dbg_curr_process->handle, (DWORD_PTR)lin, &disp64, si)) return;
- dbg_printf(" %s", si->Name);
- if (disp64) dbg_printf("+0x%lx", (DWORD_PTR)disp64);
- if (with_line)
- {
- IMAGEHLP_LINE il;
- IMAGEHLP_MODULE im;
-
- il.SizeOfStruct = sizeof(il);
- if (SymGetLineFromAddr(dbg_curr_process->handle, (DWORD_PTR)lin, &disp, &il))
- dbg_printf(" [%s:%lu]", il.FileName, il.LineNumber);
- im.SizeOfStruct = sizeof(im);
- 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, (DWORD_PTR)lin, &im))
+ return;
+ if (SymFromAddr(dbg_curr_process->handle, (DWORD_PTR)lin, &disp64, si))
+ {
+ if (DBG_IVAR(ShowModuleName))
+ dbg_printf(" %s!%s", im.ModuleName, si->Name);
+ else
+ dbg_printf(" %s", si->Name);
+ if (disp64) dbg_printf("+0x%lx", (DWORD_PTR)disp64);
+ if (with_line)
+ {
+ IMAGEHLP_LINE il;
+
+ il.SizeOfStruct = sizeof(il);
+ if (SymGetLineFromAddr(dbg_curr_process->handle, (DWORD_PTR)lin, &disp, &il))
+ dbg_printf(" [%s:%lu]", il.FileName, il.LineNumber);
+ }
}
+ else dbg_printf(" %s!+0x%lx\n", im.ModuleName, (DWORD)lin - im.BaseOfImage);
}
BOOL memory_disasm_one_insn(ADDRESS* addr)
diff --git a/programs/winedbg/stack.c b/programs/winedbg/stack.c
index a6a37d1..c0ea606 100644
--- a/programs/winedbg/stack.c
+++ b/programs/winedbg/stack.c
@@ -238,7 +238,10 @@ static void stack_print_addr_and_args(in
char tmp[1024];
DWORD disp;
- dbg_printf(" %s", si->Name);
+ if (DBG_IVAR(ShowModuleName))
+ dbg_printf(" %s!%s", im.ModuleName, si->Name);
+ else
+ dbg_printf(" %s", si->Name);
if (disp64) dbg_printf("+0x%lx", (DWORD_PTR)disp64);
SymSetContext(dbg_curr_process->handle, &ihsf, NULL);
@@ -252,9 +255,8 @@ static void stack_print_addr_and_args(in
if (SymGetLineFromAddr(dbg_curr_process->handle, ihsf.InstructionOffset,
&disp, &il))
dbg_printf(" [%s:%lu]", il.FileName, il.LineNumber);
- dbg_printf(" in %s", im.ModuleName);
}
- else dbg_printf(" in %s (+0x%lx)",
+ else dbg_printf(" %s!+0x%lx",
im.ModuleName, (DWORD_PTR)(ihsf.InstructionOffset - im.BaseOfImage));
}
More information about the wine-patches
mailing list