aboutsummaryrefslogtreecommitdiff
path: root/gdb/eval.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2012-07-06 14:48:48 +0000
committerTom Tromey <tromey@redhat.com>2012-07-06 14:48:48 +0000
commita6fb9c08a9ac65df98ca8829f43083feda19a6fe (patch)
tree6bda910f53fe801f12d20dd438c721c60ad7bd79 /gdb/eval.c
parent71918a863fdc11435a0f47a1b3e49bfdf44f6ef5 (diff)
downloadgdb-a6fb9c08a9ac65df98ca8829f43083feda19a6fe.zip
gdb-a6fb9c08a9ac65df98ca8829f43083feda19a6fe.tar.gz
gdb-a6fb9c08a9ac65df98ca8829f43083feda19a6fe.tar.bz2
* c-exp.y (DOTDOTDOT): New token.
(func_mod, exp): Use parameter_typelist. (parameter_typelist): New production. (tokentab3): Add "..." token. * eval.c (make_params): Handle varargs. * gdbtypes.c (lookup_function_type_with_arguments): Handle varargs. testsuite * gdb.base/whatis.exp: Add test.
Diffstat (limited to 'gdb/eval.c')
-rw-r--r--gdb/eval.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gdb/eval.c b/gdb/eval.c
index 3d43406..13f997f 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -769,6 +769,11 @@ 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)
+ {
+ --num_types;
+ TYPE_VARARGS (type) = 1;
+ }
TYPE_NFIELDS (type) = num_types;
TYPE_FIELDS (type) = (struct field *)
TYPE_ZALLOC (type, sizeof (struct field) * num_types);