aboutsummaryrefslogtreecommitdiff
path: root/gdb/printcmd.c
diff options
context:
space:
mode:
authorgdb-3.4 <gdb@fsf.org>1989-11-05 21:02:37 +0000
committerPedro Alves <palves@redhat.com>2012-06-03 15:36:32 +0100
commit1c997a4ae86938343edb715efc3fc742c5f668fe (patch)
tree9e3c70728a3987732436b7fa4b4cfef433a0669a /gdb/printcmd.c
parent4187119d59afd156703cfcbc6be287c5085f1867 (diff)
downloadgdb-1c997a4ae86938343edb715efc3fc742c5f668fe.zip
gdb-1c997a4ae86938343edb715efc3fc742c5f668fe.tar.gz
gdb-1c997a4ae86938343edb715efc3fc742c5f668fe.tar.bz2
gdb-3.4
Diffstat (limited to 'gdb/printcmd.c')
-rw-r--r--gdb/printcmd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index 6a6cd34..269ec4b 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -708,8 +708,10 @@ x_command (exp, from_tty)
*exp = 0;
old_chain = make_cleanup (free_current_contents, &expr);
val = evaluate_expression (expr);
- if (last_format == 'i'
- && TYPE_CODE (VALUE_TYPE (val)) != TYPE_CODE_PTR
+ /* In rvalue contexts, such as this, functions are coerced into
+ pointers to functions. This makes "x/i main" work. */
+ if (/* last_format == 'i'
+ && */ TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_FUNC
&& VALUE_LVAL (val) == lval_memory)
next_address = VALUE_ADDRESS (val);
else