From d0f260eb11245a2f861f6d4c3f61e8e29b4e7c83 Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Sat, 12 Jan 2002 21:14:40 +0000 Subject: [PATCH] Enhance display for symbol picking. --- debugger/hash.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/debugger/hash.c b/debugger/hash.c index 6ea1c4799dd..d987b8dcee0 100644 --- a/debugger/hash.c +++ b/debugger/hash.c @@ -362,7 +362,7 @@ BOOL DEBUG_GetSymbolValue( const char * name, const int lineno, /* FIXME: NUMDBGV should be made variable */ DBG_VALUE value[NUMDBGV]; DBG_VALUE vtmp; - int num, i; + int num, i, local = -1; num = DEBUG_GSV_Helper(name, lineno, value, NUMDBGV, bp_flag); if (!num && (name[0] != '_')) @@ -379,6 +379,7 @@ BOOL DEBUG_GetSymbolValue( const char * name, const int lineno, if (DEBUG_GetStackSymbolValue(name, &vtmp) && num < NUMDBGV) { value[num] = vtmp; + local = num; num++; } @@ -396,8 +397,19 @@ BOOL DEBUG_GetSymbolValue( const char * name, const int lineno, DEBUG_Printf(DBG_CHN_MESG, "Many symbols with name '%s', choose the one you want ( to abort):\n", name); for (i = 0; i < num; i++) { DEBUG_Printf(DBG_CHN_MESG, "[%d]: ", i + 1); - DEBUG_PrintAddress( &value[i].addr, DEBUG_GetSelectorType(value[i].addr.seg), TRUE); - DEBUG_Printf(DBG_CHN_MESG, "\n"); + if (i == local) { + struct name_hash*func; + unsigned int ebp; + unsigned int eip; + + if (DEBUG_GetCurrentFrame(&func, &eip, &ebp)) + DEBUG_Printf(DBG_CHN_MESG, "local variable of %s in %s\n", func->name, func->sourcefile); + else + DEBUG_Printf(DBG_CHN_MESG, "local variable\n"); + } else { + DEBUG_PrintAddress( &value[i].addr, DEBUG_GetSelectorType(value[i].addr.seg), TRUE); + DEBUG_Printf(DBG_CHN_MESG, "\n"); + } } do { i = 0; -- 2.11.4.GIT