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 BLOCK_GCC_COMPILED flag


Hello,

using_struct_return has a GCC_P argument, which has been unused for
quite a while.  This patch removes it.  This allows to remove the
USING_GCC parameter of the push_dummy_code gdbarch routine as well
(which was only used in sparc32_push_dummy_code to pass it to
using_struct_return.  This in turn allows for complete removal
of the BLOCK_GCC_COMPILED macro and gcc_compile_flag member of
struct block.

Tested on s390-ibm-linux and by making sure everything still
compiles.  Committed to mainline.

Bye,
Ulrich


ChangeLog:

	* block.h (struct block): Remove "gcc_compile_flag" member.
	(BLOCK_GCC_COMPILED): Remove.
	* block.c (allocate_block): Do not clear BLOCK_GCC_COMPILED.
	* buildsym.c (finish_block): Do not set it.
	* symmisc.c (dump_symtab_1): Do not dump it.

	* value.h (using_struct_return): Remove "gcc_p" argument.
	* value.c (using_struct_return): Likewise.
	* eval.c (evaluate_subexp_standard): Adapt callers.
	* infcall.c (call_function_by_hand): Likewise.
	* stack.c (return_command): Likewise.
	* sparc-tdep.c (sparc32_push_dummy_code): Likewise.

	* gdbarch.sh (push_dummy_code): Remove "using_gcc" parameter.
	* gdbarch.c, gdbarch.h: Regenerate.
	* cris-tdep.c (cris_push_dummy_code): Adapt prototype.
	* hppa-hpux-tdep.c (hppa_hpux_push_dummy_code): Likewise.
	* sparc-tdep.c (sparc32_push_dummy_code): Likewise.
	* infcall.c (generic_push_dummy_code, push_dummy_code): Likewise.
	(push_dummy_code, call_function_by_hand): Adapt callers.

diff -urNp gdb-orig/gdb/block.c gdb-head/gdb/block.c
--- gdb-orig/gdb/block.c	2007-09-10 19:12:05.000000000 +0200
+++ gdb-head/gdb/block.c	2007-10-12 04:29:58.000000000 +0200
@@ -287,7 +287,6 @@ allocate_block (struct obstack *obstack)
   BLOCK_SUPERBLOCK (bl) = NULL;
   BLOCK_DICT (bl) = NULL;
   BLOCK_NAMESPACE (bl) = NULL;
-  BLOCK_GCC_COMPILED (bl) = 0;
 
   return bl;
 }
diff -urNp gdb-orig/gdb/block.h gdb-head/gdb/block.h
--- gdb-orig/gdb/block.h	2007-09-10 19:12:05.000000000 +0200
+++ gdb-head/gdb/block.h	2007-10-12 04:29:58.000000000 +0200
@@ -95,25 +95,12 @@ struct block
     cplus_specific;
   }
   language_specific;
-
-  /* Version of GCC used to compile the function corresponding
-     to this block, or 0 if not compiled with GCC.  When possible,
-     GCC should be compatible with the native compiler, or if that
-     is not feasible, the differences should be fixed during symbol
-     reading.  As of 16 Apr 93, this flag is never used to distinguish
-     between gcc2 and the native compiler.
-
-     If there is no function corresponding to this block, this meaning
-     of this flag is undefined.  */
-
-  unsigned char gcc_compile_flag;
 };
 
 #define BLOCK_START(bl)		(bl)->startaddr
 #define BLOCK_END(bl)		(bl)->endaddr
 #define BLOCK_FUNCTION(bl)	(bl)->function
 #define BLOCK_SUPERBLOCK(bl)	(bl)->superblock
-#define BLOCK_GCC_COMPILED(bl)	(bl)->gcc_compile_flag
 #define BLOCK_DICT(bl)		(bl)->dict
 #define BLOCK_NAMESPACE(bl)   (bl)->language_specific.cplus_specific.namespace
 
diff -urNp gdb-orig/gdb/buildsym.c gdb-head/gdb/buildsym.c
--- gdb-orig/gdb/buildsym.c	2007-10-11 22:25:51.000000000 +0200
+++ gdb-head/gdb/buildsym.c	2007-10-12 04:29:58.000000000 +0200
@@ -246,8 +246,6 @@ finish_block (struct symbol *symbol, str
   BLOCK_SUPERBLOCK (block) = NULL;
   BLOCK_NAMESPACE (block) = NULL;
 
-  BLOCK_GCC_COMPILED (block) = processing_gcc_compilation;
-
   /* Put the block in as the value of the symbol that names it.  */
 
   if (symbol)
diff -urNp gdb-orig/gdb/cris-tdep.c gdb-head/gdb/cris-tdep.c
--- gdb-orig/gdb/cris-tdep.c	2007-10-12 03:51:14.000000000 +0200
+++ gdb-head/gdb/cris-tdep.c	2007-10-12 04:29:58.000000000 +0200
@@ -868,7 +868,7 @@ cris_frame_align (struct gdbarch *gdbarc
 
 static CORE_ADDR
 cris_push_dummy_code (struct gdbarch *gdbarch,
-                      CORE_ADDR sp, CORE_ADDR funaddr, int using_gcc,
+                      CORE_ADDR sp, CORE_ADDR funaddr,
                       struct value **args, int nargs,
                       struct type *value_type,
                       CORE_ADDR *real_pc, CORE_ADDR *bp_addr,
diff -urNp gdb-orig/gdb/eval.c gdb-head/gdb/eval.c
--- gdb-orig/gdb/eval.c	2007-09-10 19:12:06.000000000 +0200
+++ gdb-head/gdb/eval.c	2007-10-12 04:29:58.000000000 +0200
@@ -760,7 +760,6 @@ evaluate_subexp_standard (struct type *e
 
 	CORE_ADDR selector = 0;
 
-	int using_gcc = 0;
 	int struct_return = 0;
 	int sub_no_side = 0;
 
@@ -912,9 +911,6 @@ evaluate_subexp_standard (struct type *e
 
 	    b = block_for_pc (funaddr);
 
-	    /* If compiled without -g, assume GCC 2.  */
-	    using_gcc = (b == NULL ? 2 : BLOCK_GCC_COMPILED (b));
-
 	    CHECK_TYPEDEF (value_type);
 	  
 	    if ((value_type == NULL) 
@@ -924,11 +920,11 @@ evaluate_subexp_standard (struct type *e
 		  value_type = expect_type;
 	      }
 
-	    struct_return = using_struct_return (value_type, using_gcc);
+	    struct_return = using_struct_return (value_type);
 	  }
 	else if (expect_type != NULL)
 	  {
-	    struct_return = using_struct_return (check_typedef (expect_type), using_gcc);
+	    struct_return = using_struct_return (check_typedef (expect_type));
 	  }
 	
 	/* Found a function symbol.  Now we will substitute its
diff -urNp gdb-orig/gdb/gdbarch.c gdb-head/gdb/gdbarch.c
--- gdb-orig/gdb/gdbarch.c	2007-10-12 03:51:14.000000000 +0200
+++ gdb-head/gdb/gdbarch.c	2007-10-12 04:29:58.000000000 +0200
@@ -1744,13 +1744,13 @@ gdbarch_push_dummy_code_p (struct gdbarc
 }
 
 CORE_ADDR
-gdbarch_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funaddr, int using_gcc, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr, struct regcache *regcache)
+gdbarch_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funaddr, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr, struct regcache *regcache)
 {
   gdb_assert (gdbarch != NULL);
   gdb_assert (gdbarch->push_dummy_code != NULL);
   if (gdbarch_debug >= 2)
     fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_code called\n");
-  return gdbarch->push_dummy_code (gdbarch, sp, funaddr, using_gcc, args, nargs, value_type, real_pc, bp_addr, regcache);
+  return gdbarch->push_dummy_code (gdbarch, sp, funaddr, args, nargs, value_type, real_pc, bp_addr, regcache);
 }
 
 void
diff -urNp gdb-orig/gdb/gdbarch.h gdb-head/gdb/gdbarch.h
--- gdb-orig/gdb/gdbarch.h	2007-10-12 03:51:14.000000000 +0200
+++ gdb-head/gdb/gdbarch.h	2007-10-12 04:29:58.000000000 +0200
@@ -273,8 +273,8 @@ extern void set_gdbarch_call_dummy_locat
 
 extern int gdbarch_push_dummy_code_p (struct gdbarch *gdbarch);
 
-typedef CORE_ADDR (gdbarch_push_dummy_code_ftype) (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funaddr, int using_gcc, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr, struct regcache *regcache);
-extern CORE_ADDR gdbarch_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funaddr, int using_gcc, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr, struct regcache *regcache);
+typedef CORE_ADDR (gdbarch_push_dummy_code_ftype) (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funaddr, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr, struct regcache *regcache);
+extern CORE_ADDR gdbarch_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funaddr, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr, struct regcache *regcache);
 extern void set_gdbarch_push_dummy_code (struct gdbarch *gdbarch, gdbarch_push_dummy_code_ftype *push_dummy_code);
 
 typedef void (gdbarch_print_registers_info_ftype) (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all);
diff -urNp gdb-orig/gdb/gdbarch.sh gdb-head/gdb/gdbarch.sh
--- gdb-orig/gdb/gdbarch.sh	2007-10-12 03:51:14.000000000 +0200
+++ gdb-head/gdb/gdbarch.sh	2007-10-12 04:29:58.000000000 +0200
@@ -466,7 +466,7 @@ v::int:deprecated_fp_regnum:::-1:-1::0
 # See gdbint.texinfo.  See infcall.c.
 M::CORE_ADDR:push_dummy_call:struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr:function, regcache, bp_addr, nargs, args, sp, struct_return, struct_addr
 v::int:call_dummy_location::::AT_ENTRY_POINT::0
-M::CORE_ADDR:push_dummy_code:CORE_ADDR sp, CORE_ADDR funaddr, int using_gcc, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr, struct regcache *regcache:sp, funaddr, using_gcc, args, nargs, value_type, real_pc, bp_addr, regcache
+M::CORE_ADDR:push_dummy_code:CORE_ADDR sp, CORE_ADDR funaddr, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr, struct regcache *regcache:sp, funaddr, args, nargs, value_type, real_pc, bp_addr, regcache
 
 m::void:print_registers_info:struct ui_file *file, struct frame_info *frame, int regnum, int all:file, frame, regnum, all::default_print_registers_info::0
 M::void:print_float_info:struct ui_file *file, struct frame_info *frame, const char *args:file, frame, args
diff -urNp gdb-orig/gdb/hppa-hpux-tdep.c gdb-head/gdb/hppa-hpux-tdep.c
--- gdb-orig/gdb/hppa-hpux-tdep.c	2007-10-11 22:25:52.000000000 +0200
+++ gdb-head/gdb/hppa-hpux-tdep.c	2007-10-12 04:29:58.000000000 +0200
@@ -1093,7 +1093,7 @@ hppa_hpux_find_dummy_bpaddr (CORE_ADDR a
 
 static CORE_ADDR
 hppa_hpux_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp,
-			   CORE_ADDR funcaddr, int using_gcc,
+			   CORE_ADDR funcaddr,
 			   struct value **args, int nargs,
 			   struct type *value_type,
 			   CORE_ADDR *real_pc, CORE_ADDR *bp_addr,
diff -urNp gdb-orig/gdb/infcall.c gdb-head/gdb/infcall.c
--- gdb-orig/gdb/infcall.c	2007-10-12 04:13:27.000000000 +0200
+++ gdb-head/gdb/infcall.c	2007-10-12 04:30:56.000000000 +0200
@@ -260,7 +260,7 @@ breakpoint_auto_delete_contents (void *a
 
 static CORE_ADDR
 generic_push_dummy_code (struct gdbarch *gdbarch,
-			 CORE_ADDR sp, CORE_ADDR funaddr, int using_gcc,
+			 CORE_ADDR sp, CORE_ADDR funaddr,
 			 struct value **args, int nargs,
 			 struct type *value_type,
 			 CORE_ADDR *real_pc, CORE_ADDR *bp_addr,
@@ -300,18 +300,18 @@ generic_push_dummy_code (struct gdbarch 
 
 static CORE_ADDR
 push_dummy_code (struct gdbarch *gdbarch,
-		 CORE_ADDR sp, CORE_ADDR funaddr, int using_gcc,
+		 CORE_ADDR sp, CORE_ADDR funaddr,
 		 struct value **args, int nargs,
 		 struct type *value_type,
 		 CORE_ADDR *real_pc, CORE_ADDR *bp_addr,
 		 struct regcache *regcache)
 {
   if (gdbarch_push_dummy_code_p (gdbarch))
-    return gdbarch_push_dummy_code (gdbarch, sp, funaddr, using_gcc,
+    return gdbarch_push_dummy_code (gdbarch, sp, funaddr,
 				    args, nargs, value_type, real_pc, bp_addr,
 				    regcache);
   else    
-    return generic_push_dummy_code (gdbarch, sp, funaddr, using_gcc,
+    return generic_push_dummy_code (gdbarch, sp, funaddr,
 				    args, nargs, value_type, real_pc, bp_addr,
 				    regcache);
 }
@@ -347,7 +347,6 @@ call_function_by_hand (struct value *fun
   struct inferior_status *inf_status;
   struct cleanup *inf_status_cleanup;
   CORE_ADDR funaddr;
-  int using_gcc;		/* Set to version of gcc in use, or zero if not gcc */
   CORE_ADDR real_pc;
   struct type *ftype = check_typedef (value_type (function));
   CORE_ADDR bp_addr;
@@ -455,12 +454,6 @@ call_function_by_hand (struct value *fun
   funaddr = find_function_addr (function, &values_type);
   CHECK_TYPEDEF (values_type);
 
-  {
-    struct block *b = block_for_pc (funaddr);
-    /* If compiled without -g, assume GCC 2.  */
-    using_gcc = (b == NULL ? 2 : BLOCK_GCC_COMPILED (b));
-  }
-
   /* Are we returning a value using a structure return (passing a
      hidden argument pointing to storage) or a normal value return?
      There are two cases: language-mandated structure return and
@@ -482,7 +475,7 @@ call_function_by_hand (struct value *fun
     }
   else
     {
-      struct_return = using_struct_return (values_type, using_gcc);
+      struct_return = using_struct_return (values_type);
       target_values_type = values_type;
     }
 
@@ -503,7 +496,7 @@ call_function_by_hand (struct value *fun
       if (gdbarch_inner_than (current_gdbarch, 1, 2))
 	{
 	  sp = push_dummy_code (current_gdbarch, sp, funaddr,
-				using_gcc, args, nargs, target_values_type,
+				args, nargs, target_values_type,
 				&real_pc, &bp_addr, get_current_regcache ());
 	  dummy_addr = sp;
 	}
@@ -511,7 +504,7 @@ call_function_by_hand (struct value *fun
 	{
 	  dummy_addr = sp;
 	  sp = push_dummy_code (current_gdbarch, sp, funaddr,
-				using_gcc, args, nargs, target_values_type,
+				args, nargs, target_values_type,
 				&real_pc, &bp_addr, get_current_regcache ());
 	}
       break;
diff -urNp gdb-orig/gdb/sparc-tdep.c gdb-head/gdb/sparc-tdep.c
--- gdb-orig/gdb/sparc-tdep.c	2007-10-11 22:27:06.000000000 +0200
+++ gdb-head/gdb/sparc-tdep.c	2007-10-12 04:29:58.000000000 +0200
@@ -378,7 +378,7 @@ sparc32_pseudo_register_write (struct gd
 
 static CORE_ADDR
 sparc32_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp,
-			 CORE_ADDR funcaddr, int using_gcc,
+			 CORE_ADDR funcaddr,
 			 struct value **args, int nargs,
 			 struct type *value_type,
 			 CORE_ADDR *real_pc, CORE_ADDR *bp_addr,
@@ -387,7 +387,7 @@ sparc32_push_dummy_code (struct gdbarch 
   *bp_addr = sp - 4;
   *real_pc = funcaddr;
 
-  if (using_struct_return (value_type, using_gcc))
+  if (using_struct_return (value_type))
     {
       gdb_byte buf[4];
 
diff -urNp gdb-orig/gdb/stack.c gdb-head/gdb/stack.c
--- gdb-orig/gdb/stack.c	2007-10-11 22:25:56.000000000 +0200
+++ gdb-head/gdb/stack.c	2007-10-12 04:31:31.000000000 +0200
@@ -1805,7 +1805,7 @@ A structure or union return type is not 
 If you continue, the return value that you specified will be ignored.\n";
 	  return_value = NULL;
 	}
-      else if (using_struct_return (return_type, 0))
+      else if (using_struct_return (return_type))
 	{
 	  query_prefix = "\
 The location at which to store the function's return value is unknown.\n\
diff -urNp gdb-orig/gdb/symmisc.c gdb-head/gdb/symmisc.c
--- gdb-orig/gdb/symmisc.c	2007-10-11 22:27:06.000000000 +0200
+++ gdb-head/gdb/symmisc.c	2007-10-12 04:29:58.000000000 +0200
@@ -508,8 +508,6 @@ dump_symtab_1 (struct objfile *objfile, 
 				SYMBOL_DEMANGLED_NAME (BLOCK_FUNCTION (b)));
 		}
 	    }
-	  if (BLOCK_GCC_COMPILED (b))
-	    fprintf_filtered (outfile, ", compiled with gcc%d", BLOCK_GCC_COMPILED (b));
 	  fprintf_filtered (outfile, "\n");
 	  /* Now print each symbol in this block (in no particular order, if
 	     we're using a hashtable).  */
diff -urNp gdb-orig/gdb/value.c gdb-head/gdb/value.c
--- gdb-orig/gdb/value.c	2007-10-02 19:08:04.000000000 +0200
+++ gdb-head/gdb/value.c	2007-10-12 04:29:58.000000000 +0200
@@ -1709,11 +1709,10 @@ generic_use_struct_convention (int gcc_p
 
 /* Return true if the function returning the specified type is using
    the convention of returning structures in memory (passing in the
-   address as a hidden first parameter).  GCC_P is nonzero if compiled
-   with GCC.  */
+   address as a hidden first parameter).  */
 
 int
-using_struct_return (struct type *value_type, int gcc_p)
+using_struct_return (struct type *value_type)
 {
   enum type_code code = TYPE_CODE (value_type);
 
diff -urNp gdb-orig/gdb/value.h gdb-head/gdb/value.h
--- gdb-orig/gdb/value.h	2007-10-02 19:08:04.000000000 +0200
+++ gdb-head/gdb/value.h	2007-10-12 04:29:58.000000000 +0200
@@ -402,7 +402,7 @@ extern struct value *value_in (struct va
 extern int value_bit_index (struct type *type, const gdb_byte *addr,
 			    int index);
 
-extern int using_struct_return (struct type *value_type, int gcc_p);
+extern int using_struct_return (struct type *value_type);
 
 extern struct value *evaluate_expression (struct expression *exp);
 
-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


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