Eric Pouech : winedbg: extract_as_integer
Alexandre Julliard
julliard at wine.codeweavers.com
Wed May 17 04:46:43 CDT 2006
Module: wine
Branch: refs/heads/master
Commit: 820141114e89b1a4b1874a8ad235627f3e6fafce
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=820141114e89b1a4b1874a8ad235627f3e6fafce
Author: Eric Pouech <eric.pouech at wanadoo.fr>
Date: Tue May 16 21:20:51 2006 +0200
winedbg: extract_as_integer
- now supporting extract_as_integer on functions (so that,
for example, 'disas foo' works as expected)
- now properly handling errors when calling extract_as_integer
---
programs/winedbg/types.c | 26 +++++++++++++++++---------
1 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/programs/winedbg/types.c b/programs/winedbg/types.c
index 052b8c6..93424d9 100644
--- a/programs/winedbg/types.c
+++ b/programs/winedbg/types.c
@@ -37,14 +37,14 @@ WINE_DEFAULT_DEBUG_CHANNEL(winedbg);
*/
long int types_extract_as_integer(const struct dbg_lvalue* lvalue)
{
- long int rtn = 0;
+ long int rtn;
LONGLONG val;
DWORD tag, bt;
DWORD64 size;
if (lvalue->type.id == dbg_itype_none ||
!types_get_info(&lvalue->type, TI_GET_SYMTAG, &tag))
- return 0;
+ RaiseException(DEBUG_STATUS_NOT_AN_INTEGER, 0, 0, NULL);
if (lvalue->type.id == dbg_itype_segptr)
{
@@ -63,17 +63,19 @@ long int types_extract_as_integer(const
if (size > sizeof(rtn))
{
WINE_ERR("Size too large (%s)\n", wine_dbgstr_longlong(size));
- return 0;
+ RaiseException(DEBUG_STATUS_NOT_AN_INTEGER, 0, 0, NULL);
}
switch (bt)
{
case btChar:
case btInt:
- if (!be_cpu->fetch_integer(lvalue, (unsigned)size, TRUE, &val)) return 0;
+ if (!be_cpu->fetch_integer(lvalue, (unsigned)size, TRUE, &val))
+ RaiseException(DEBUG_STATUS_INTERNAL_ERROR, 0, 0, NULL);
rtn = (long)val;
break;
case btUInt:
- if (!be_cpu->fetch_integer(lvalue, (unsigned)size, FALSE, &val)) return 0;
+ if (!be_cpu->fetch_integer(lvalue, (unsigned)size, FALSE, &val))
+ RaiseException(DEBUG_STATUS_INTERNAL_ERROR, 0, 0, NULL);
rtn = (DWORD)(DWORD64)val;
break;
case btFloat:
@@ -81,20 +83,26 @@ long int types_extract_as_integer(const
}
break;
case SymTagPointerType:
- if (!memory_read_value(lvalue, sizeof(void*), &rtn)) return 0;
+ if (!memory_read_value(lvalue, sizeof(void*), &rtn))
+ RaiseException(DEBUG_STATUS_INTERNAL_ERROR, 0, 0, NULL);
break;
case SymTagArrayType:
case SymTagUDT:
assert(lvalue->cookie == DLV_TARGET);
- if (!memory_read_value(lvalue, sizeof(rtn), &rtn)) return 0;
+ if (!memory_read_value(lvalue, sizeof(rtn), &rtn))
+ RaiseException(DEBUG_STATUS_INTERNAL_ERROR, 0, 0, NULL);
break;
case SymTagEnum:
assert(lvalue->cookie == DLV_TARGET);
- if (!memory_read_value(lvalue, sizeof(rtn), &rtn)) return 0;
+ if (!memory_read_value(lvalue, sizeof(rtn), &rtn))
+ RaiseException(DEBUG_STATUS_INTERNAL_ERROR, 0, 0, NULL);
+ break;
+ case SymTagFunctionType:
+ rtn = (unsigned)memory_to_linear_addr(&lvalue->addr);
break;
default:
WINE_FIXME("Unsupported tag %lu\n", tag);
- rtn = 0;
+ RaiseException(DEBUG_STATUS_NOT_AN_INTEGER, 0, 0, NULL);
break;
}
More information about the wine-cvs
mailing list