[PATCH 3/4] Use TYPE_TARGET_TYPE.

Yao Qi
2012-11-22T07:32:47Z

For TYPE_CODE_METHODPTR, we should use TYPE_TARGET_TYPE to get the
type of function. This patch fixes this fail

FAIL: gdb.cp/member-ptr.exp: ptype (a.*pmf)(3)

gdb:

2012-11-22 Daniel Jacobowitz <dan@codesourcery.com>

* eval.c (evaluate_subexp_standard): Use TYPE_TARGET_TYPE.
---
gdb/eval.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gdb/eval.c b/gdb/eval.c
index 9957d02..82ea81b 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -1391,7 +1391,7 @@ evaluate_subexp_standard (struct type *expect_type,
if (TYPE_CODE (type) == TYPE_CODE_METHODPTR)
{
if (noside == EVAL_AVOID_SIDE_EFFECTS)
- arg1 = value_zero (type, not_lval);
+ arg1 = value_zero (TYPE_TARGET_TYPE (type), not_lval);
else
arg1 = cplus_method_ptr_to_value (&arg2, arg1);

--
1.7.7.6