summaryrefslogtreecommitdiff
path: root/gdb/gdbtypes.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2012-07-06 14:46:59 +0000
committerTom Tromey <tromey@redhat.com>2012-07-06 14:46:59 +0000
commit484118c3151e97ad0207fe6a6f35438e64d3c65a (patch)
tree9f4e448882ab439f6697f88df2aac4581de4579f /gdb/gdbtypes.c
parent42ad8e35a1273caaefa962edf8324845445218c1 (diff)
downloadgdb-484118c3151e97ad0207fe6a6f35438e64d3c65a.tar.gz
PR exp/9608:
* c-exp.y (%union) <tvec>: Change type. (func_mod): Now uses <tvec> type. (exp): Update for tvec change. (direct_abs_decl): Push the typelist. (func_mod): Return a typelist. (nonempty_typelist): Update for tvec change. * gdbtypes.c (lookup_function_type_with_arguments): New function. * gdbtypes.h (lookup_function_type_with_arguments): Declare. * parse.c (pop_type_list): New function. (push_typelist): New function. (follow_types): Handle tp_function_with_arguments. * parser-defs.h (type_ptr): New typedef. Define a VEC. (enum type_pieces) <tp_function_with_arguments>: New constant. (union type_stack_elt) <typelist_val>: New field. (push_typelist): Declare. testsuite * gdb.base/whatis.exp: Add regression test.
Diffstat (limited to 'gdb/gdbtypes.c')
-rw-r--r--gdb/gdbtypes.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index 0eec874bc87..bcc2edf70e6 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -462,6 +462,25 @@ lookup_function_type (struct type *type)
return make_function_type (type, (struct type **) 0);
}
+/* Given a type TYPE and argument types, return the appropriate
+ function type. */
+
+struct type *
+lookup_function_type_with_arguments (struct type *type,
+ int nparams,
+ struct type **param_types)
+{
+ struct type *fn = make_function_type (type, (struct type **) 0);
+ int i;
+
+ TYPE_NFIELDS (fn) = nparams;
+ TYPE_FIELDS (fn) = TYPE_ZALLOC (fn, nparams * sizeof (struct field));
+ for (i = 0; i < nparams; ++i)
+ TYPE_FIELD_TYPE (fn, i) = param_types[i];
+
+ return fn;
+}
+
/* Identify address space identifier by name --
return the integer flag defined in gdbtypes.h. */
extern int