Commit 856aefa2 authored by Peter Hunnisett's avatar Peter Hunnisett Committed by Alexandre Julliard

- Explicit init of rtn.cookie in DEBUG_EvalExpr to bad value to

expose further bad code - Print of pointer used as array now works
parent 1fb3298e
...@@ -55,6 +55,7 @@ typedef struct ...@@ -55,6 +55,7 @@ typedef struct
#define DV_TARGET 0xF00D #define DV_TARGET 0xF00D
#define DV_HOST 0x50DA #define DV_HOST 0x50DA
#define DV_INVALID 0x0000
typedef struct typedef struct
{ {
......
...@@ -302,6 +302,7 @@ DBG_VALUE DEBUG_EvalExpr(struct expr * exp) ...@@ -302,6 +302,7 @@ DBG_VALUE DEBUG_EvalExpr(struct expr * exp)
struct datatype * type2; struct datatype * type2;
rtn.type = NULL; rtn.type = NULL;
rtn.cookie = DV_INVALID;
rtn.addr.off = 0; rtn.addr.off = 0;
rtn.addr.seg = 0; rtn.addr.seg = 0;
......
...@@ -761,13 +761,23 @@ DEBUG_ArrayIndex(const DBG_VALUE * value, DBG_VALUE * result, int index) ...@@ -761,13 +761,23 @@ DEBUG_ArrayIndex(const DBG_VALUE * value, DBG_VALUE * result, int index)
*/ */
size = DEBUG_GetObjectSize(value->type->un.pointer.pointsto); size = DEBUG_GetObjectSize(value->type->un.pointer.pointsto);
result->type = value->type->un.pointer.pointsto; result->type = value->type->un.pointer.pointsto;
result->addr.off = (*(unsigned int*) (value->addr.off)) + size * index; result->addr.off = (DWORD)DEBUG_ReadMemory(value) + size*index;
/* Contents of array must be on same target */
result->cookie = value->cookie;
} }
else if (value->type->type == DT_ARRAY) else if (value->type->type == DT_ARRAY)
{ {
size = DEBUG_GetObjectSize(value->type->un.array.basictype); size = DEBUG_GetObjectSize(value->type->un.array.basictype);
result->type = value->type->un.array.basictype; result->type = value->type->un.array.basictype;
result->addr.off = value->addr.off + size * (index - value->type->un.array.start); result->addr.off = value->addr.off + size * (index - value->type->un.array.start);
/* Contents of array must be on same target */
result->cookie = value->cookie;
}
else
{
assert(FALSE);
} }
return TRUE; return TRUE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment