aboutsummaryrefslogtreecommitdiff
path: root/gdb/eval.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2012-07-09 14:20:52 +0000
committerTom Tromey <tromey@redhat.com>2012-07-09 14:20:52 +0000
commite314d62968dfb4ae82c70dbe68d9d4ec929deb7e (patch)
treeb66865521e10da3ab58c11932c46a5715cf499af /gdb/eval.c
parent1416057852c2649d2c3d0636b4e6007f3bc2d043 (diff)
downloadgdb-e314d62968dfb4ae82c70dbe68d9d4ec929deb7e.zip
gdb-e314d62968dfb4ae82c70dbe68d9d4ec929deb7e.tar.gz
gdb-e314d62968dfb4ae82c70dbe68d9d4ec929deb7e.tar.bz2
* c-exp.y (check_parameter_typelist): New function.
(parameter_typelist): Call it. * eval.c (make_params): Handle '(void)' case. * gdbtypes.c (lookup_function_type_with_arguments): Handle '(void)' case. testsuite * gdb.base/whatis.exp: Add error checks for improper 'void' uses. * gdb.base/callfuncs.exp: Add cast-based test. * gdb.base/callfuncs.c (voidfunc): New function.
Diffstat (limited to 'gdb/eval.c')
-rw-r--r--gdb/eval.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/gdb/eval.c b/gdb/eval.c
index 13f997f..7d3a8b9 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -769,11 +769,23 @@ make_params (int num_types, struct type **param_types)
TYPE_CODE (type) = TYPE_CODE_METHOD;
TYPE_VPTR_FIELDNO (type) = -1;
TYPE_CHAIN (type) = type;
- if (num_types > 0 && param_types[num_types - 1] == NULL)
+ if (num_types > 0)
{
- --num_types;
- TYPE_VARARGS (type) = 1;
+ if (param_types[num_types - 1] == NULL)
+ {
+ --num_types;
+ TYPE_VARARGS (type) = 1;
+ }
+ else if (TYPE_CODE (check_typedef (param_types[num_types - 1]))
+ == TYPE_CODE_VOID)
+ {
+ --num_types;
+ /* Caller should have ensured this. */
+ gdb_assert (num_types == 0);
+ TYPE_PROTOTYPED (type) = 1;
+ }
}
+
TYPE_NFIELDS (type) = num_types;
TYPE_FIELDS (type) = (struct field *)
TYPE_ZALLOC (type, sizeof (struct field) * num_types);