[RFA] dwarf2read.c: Use make_function_type instead of lookup_function_type

Corinna Vinschen vinschen@redhat.com
Tue Oct 5 16:21:00 GMT 2004


the below patch uses make_function_type instead of lookup_function_type
in read_subroutine_type.  The reason is that it's important that `ftype'
is a new type structure for each function and so it shouldn't get reused
by other function types.  The comment for lookup_function_type indicates
that it's made to do exactly that, reusing already existing function
types as they fit.  That's not implemented so far, but it might happen
at one point, so I suggest to switch to make_function_type in
read_subroutine_type before something weird happens.

Ok to check in?


	* dwarf2read.c (read_subroutine_type): Call make_function_type
	instead of lookup_function_type.

Index: dwarf2read.c
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.164
diff -u -p -r1.164 dwarf2read.c
--- dwarf2read.c	3 Oct 2004 16:16:01 -0000	1.164
+++ dwarf2read.c	5 Oct 2004 16:07:04 -0000
@@ -4413,7 +4413,7 @@ read_subroutine_type (struct die_info *d
   type = die_type (die, cu);
-  ftype = lookup_function_type (type);
+  ftype = make_function_type (type, (struct type **) 0);
   /* All functions in C++ and Java have prototypes.  */
   attr = dwarf2_attr (die, DW_AT_prototyped, cu);

Corinna Vinschen
Cygwin Project Co-Leader
Red Hat, Inc.

More information about the Gdb-patches mailing list