This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit] Remove unnecessary check_typedef


These functions evolved during the most recent round of gdbarch
transitions; originally they needed a C++ class type to get at an
objfile to get at a gdbarch.  But now every type has an arch.

I discovered this because in an older GDB branch, calling
check_typedef during partial symbol reading led to all sorts of
lookups and recursively entered the symbol reader.  The template
parameter code is not robust against this sort of thing.  That problem
no longer occurs on trunk, but we might as well simplify this anyway.

Tested on x86_64-linux and arm-eabi, committed to trunk.

-- 
Daniel Jacobowitz
CodeSourcery

2010-09-08  Daniel Jacobowitz  <dan@codesourcery.com>

	* gnu-v3-abi.c (gnuv3_print_method_ptr): Do not use
	the domain type.
	(gnuv3_make_method_ptr): Likewise.

Index: gnu-v3-abi.c
===================================================================
RCS file: /cvs/src/src/gdb/gnu-v3-abi.c,v
retrieving revision 1.60
diff -u -p -r1.60 gnu-v3-abi.c
--- gnu-v3-abi.c	14 May 2010 20:17:37 -0000	1.60
+++ gnu-v3-abi.c	8 Sep 2010 16:45:42 -0000
@@ -627,8 +627,7 @@ gnuv3_print_method_ptr (const gdb_byte *
 static int
 gnuv3_method_ptr_size (struct type *type)
 {
-  struct type *domain_type = check_typedef (TYPE_DOMAIN_TYPE (type));
-  struct gdbarch *gdbarch = get_type_arch (domain_type);
+  struct gdbarch *gdbarch = get_type_arch (type);
 
   return 2 * TYPE_LENGTH (builtin_type (gdbarch)->builtin_data_ptr);
 }
@@ -639,8 +638,7 @@ static void
 gnuv3_make_method_ptr (struct type *type, gdb_byte *contents,
 		       CORE_ADDR value, int is_virtual)
 {
-  struct type *domain_type = check_typedef (TYPE_DOMAIN_TYPE (type));
-  struct gdbarch *gdbarch = get_type_arch (domain_type);
+  struct gdbarch *gdbarch = get_type_arch (type);
   int size = TYPE_LENGTH (builtin_type (gdbarch)->builtin_data_ptr);
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]