From 52d10c9022aaf221be366ae1ee0a50155ebc2e2b Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Fri, 1 Dec 2000 20:45:24 +0000 Subject: [PATCH] Work around for deref issues (least impact solution taken, even if issues remain). --- debugger/expr.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/debugger/expr.c b/debugger/expr.c index 7466dc89ff9..3352c335365 100644 --- a/debugger/expr.c +++ b/debugger/expr.c @@ -607,7 +607,20 @@ DBG_VALUE DEBUG_EvalExpr(struct expr * exp) exp->un.unop.result = ~VAL(exp1); break; case EXP_OP_DEREF: - rtn.cookie = exp1.cookie; + /* FIXME: this is currently buggy. + * there is no way to tell were the deref:ed value is... + * for example: + * x is a pointer to struct s, x being on the stack + * => exp1 is target, result is target + * x is a pointer to struct s, x being optimized into a reg + * => exp1 is host, result is target + * x is a pointer to internal variable x + * => exp1 is host, result is host + * so we force DV_TARGET, because dereferencing pointers to + * internal variables is very unlikely. a correct fix would be + * rather large. + */ + rtn.cookie = DV_TARGET; rtn.addr.off = (unsigned int) DEBUG_TypeDerefPointer(&exp1, &rtn.type); if (!rtn.type) {