aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2010-02-11 18:24:57 +0000
committerPedro Alves <palves@redhat.com>2010-02-11 18:24:57 +0000
commitb1028c8e8f281d1072e1fd89d8083cb960598a1a (patch)
tree92344c007153e36ca0e14d5d83b8d858fcce87ce
parent24981e7b9507c456c54c1ac7a313e19bc8667dfd (diff)
downloadgdb-b1028c8e8f281d1072e1fd89d8083cb960598a1a.zip
gdb-b1028c8e8f281d1072e1fd89d8083cb960598a1a.tar.gz
gdb-b1028c8e8f281d1072e1fd89d8083cb960598a1a.tar.bz2
* ax-gdb.c (gen_deref): Don't allow dereferencing void pointers.
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/ax-gdb.c2
2 files changed, 6 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index acd65e8..ddf6615 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2010-02-11 Pedro Alves <pedro@codesourcery.com>
+
+ * ax-gdb.c (gen_deref): Don't allow dereferencing void pointers.
+
2010-02-11 Vladimir Prus <vladimir@codesourcery.com>
* mi/mi-cmd-stack.c (mi_cmd_stack_list_locals): Add extra
diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c
index 5776bb0..eb53238 100644
--- a/gdb/ax-gdb.c
+++ b/gdb/ax-gdb.c
@@ -1082,6 +1082,8 @@ gen_deref (struct agent_expr *ax, struct axs_value *value)
T" to "T", and mark the value as an lvalue in memory. Leave it
to the consumer to actually dereference it. */
value->type = check_typedef (TYPE_TARGET_TYPE (value->type));
+ if (TYPE_CODE (value->type) == TYPE_CODE_VOID)
+ error (_("Attempt to dereference a generic pointer."));
value->kind = ((TYPE_CODE (value->type) == TYPE_CODE_FUNC)
? axs_rvalue : axs_lvalue_memory);
}