From e1c34c5d94deefd6bc672d0058df0bb1513888b6 Mon Sep 17 00:00:00 2001 From: Pierre Muller Date: Tue, 4 May 2010 06:48:27 +0000 Subject: PR exp/11349. * printcmd.c (x_command): Only dereference once implicitly for TYPE_CODE_REF. testsuite dir: PR exp/11349. * testsuite/gdb.cp/ref-types.exp: Add test to examine use a reference local variable. --- gdb/printcmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gdb/printcmd.c') diff --git a/gdb/printcmd.c b/gdb/printcmd.c index 735b043..16ea2a6 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -1420,7 +1420,7 @@ x_command (char *exp, int from_tty) old_chain = make_cleanup (free_current_contents, &expr); val = evaluate_expression (expr); if (TYPE_CODE (value_type (val)) == TYPE_CODE_REF) - val = value_ind (val); + val = coerce_ref (val); /* In rvalue contexts, such as this, functions are coerced into pointers to functions. This makes "x/i main" work. */ if (/* last_format == 'i' && */ -- cgit v1.1