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

expose further bad code
- Print of pointer used as array now works
This commit is contained in:
Peter Hunnisett 2000-07-08 12:45:44 +00:00 committed by Alexandre Julliard
parent 1fb3298e7b
commit 856aefa240
3 changed files with 13 additions and 1 deletions

View File

@ -55,6 +55,7 @@ typedef struct
#define DV_TARGET 0xF00D
#define DV_HOST 0x50DA
#define DV_INVALID 0x0000
typedef struct
{

View File

@ -302,6 +302,7 @@ DBG_VALUE DEBUG_EvalExpr(struct expr * exp)
struct datatype * type2;
rtn.type = NULL;
rtn.cookie = DV_INVALID;
rtn.addr.off = 0;
rtn.addr.seg = 0;

View File

@ -761,13 +761,23 @@ DEBUG_ArrayIndex(const DBG_VALUE * value, DBG_VALUE * result, int index)
*/
size = DEBUG_GetObjectSize(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)
{
size = DEBUG_GetObjectSize(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);
/* Contents of array must be on same target */
result->cookie = value->cookie;
}
else
{
assert(FALSE);
}
return TRUE;