This is the mail archive of the gdb-patches@sources.redhat.com 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]

[patch rfc] Default CALL_DUMMY_ADDRESS to entry_point_address


Hello,

More simplification. This defaults CALL_DUMMY_ADDRESS to entry_point_address removing the need to specify this by almost all architectures.

I'll look to commit this in a day or so,
Andrew
2003-03-29  Andrew Cagney  <cagney at redhat dot com>

	* gdbarch.sh: Include "symfile.h".
	(CALL_DUMMY_ADDRESS): Default to entry_point_address.
	* gdbarch.h, gdbarch.c: Re-generate.
	* inferior.h (CALL_DUMMY_ADDRESS): Delete macro.
	* xstormy16-tdep.c (xstormy16_gdbarch_init): Do not set
	call_dummy_address, the default is at entry_point_address.
	* v850-tdep.c (v850_gdbarch_init): Ditto.
	* sparc-tdep.c (sparc_gdbarch_init): Ditto.
	* sh-tdep.c (sh_gdbarch_init): Ditto.
	* s390-tdep.c (s390_gdbarch_init): Ditto.
	* rs6000-tdep.c (rs6000_gdbarch_init): Ditto.
	* mn10300-tdep.c (mn10300_gdbarch_init): Ditto.
	* mcore-tdep.c (mcore_gdbarch_init): Ditto.
	* ia64-tdep.c (ia64_gdbarch_init): Ditto.
	* i386-tdep.c (i386_gdbarch_init): Ditto.
	* h8300-tdep.c (h8300_gdbarch_init): Ditto.
	* frv-tdep.c (frv_gdbarch_init): Ditto.
	* d10v-tdep.c (d10v_gdbarch_init): Ditto.
	* cris-tdep.c (cris_gdbarch_init): Ditto.
	* arm-tdep.c (arm_gdbarch_init): Ditto.

Index: arm-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/arm-tdep.c,v
retrieving revision 1.118
diff -u -r1.118 arm-tdep.c
--- arm-tdep.c	29 Mar 2003 17:08:00 -0000	1.118
+++ arm-tdep.c	30 Mar 2003 02:36:18 -0000
@@ -2942,7 +2942,6 @@
 
   set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy);
 
-  set_gdbarch_call_dummy_address (gdbarch, entry_point_address);
   set_gdbarch_push_return_address (gdbarch, arm_push_return_address);
   set_gdbarch_push_dummy_call (gdbarch, arm_push_dummy_call);
 
Index: cris-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/cris-tdep.c,v
retrieving revision 1.58
diff -u -r1.58 cris-tdep.c
--- cris-tdep.c	26 Mar 2003 22:39:52 -0000	1.58
+++ cris-tdep.c	30 Mar 2003 02:36:23 -0000
@@ -4255,9 +4255,6 @@
   
   /* Use generic dummy frames.  */
   
-  /* Where to execute the call in the memory segments.  */
-  set_gdbarch_call_dummy_address (gdbarch, entry_point_address);
-  
   /* Start execution at the beginning of dummy.  */
   set_gdbarch_call_dummy_start_offset (gdbarch, 0);
   set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0);
Index: d10v-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/d10v-tdep.c,v
retrieving revision 1.93
diff -u -r1.93 d10v-tdep.c
--- d10v-tdep.c	29 Mar 2003 01:40:00 -0000	1.93
+++ d10v-tdep.c	30 Mar 2003 02:36:23 -0000
@@ -1676,7 +1676,6 @@
     }
 
   set_gdbarch_call_dummy_length (gdbarch, 0);
-  set_gdbarch_call_dummy_address (gdbarch, entry_point_address);
   set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1);
   set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0);
   set_gdbarch_call_dummy_start_offset (gdbarch, 0);
Index: frv-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/frv-tdep.c,v
retrieving revision 1.24
diff -u -r1.24 frv-tdep.c
--- frv-tdep.c	26 Mar 2003 22:39:52 -0000	1.24
+++ frv-tdep.c	30 Mar 2003 02:36:25 -0000
@@ -1109,7 +1109,6 @@
   set_gdbarch_read_sp (gdbarch, generic_target_read_sp);
   set_gdbarch_write_sp (gdbarch, generic_target_write_sp);
 
-  set_gdbarch_call_dummy_address (gdbarch, entry_point_address);
   set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0);
   set_gdbarch_call_dummy_start_offset (gdbarch, 0);
   set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point);
Index: gdbarch.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.c,v
retrieving revision 1.196
diff -u -r1.196 gdbarch.c
--- gdbarch.c	26 Mar 2003 22:39:52 -0000	1.196
+++ gdbarch.c	30 Mar 2003 02:36:38 -0000
@@ -66,6 +66,7 @@
 #include "gdb-events.h"
 #include "reggroups.h"
 #include "osabi.h"
+#include "symfile.h"		/* For entry_point_address.  */
 
 /* Static function declarations */
 
@@ -530,6 +531,7 @@
   current_gdbarch->cannot_store_register = cannot_register_not;
   current_gdbarch->deprecated_use_generic_dummy_frames = 1;
   current_gdbarch->call_dummy_location = AT_ENTRY_POINT;
+  current_gdbarch->call_dummy_address = entry_point_address;
   current_gdbarch->call_dummy_start_offset = -1;
   current_gdbarch->call_dummy_breakpoint_offset = -1;
   current_gdbarch->call_dummy_breakpoint_offset_p = -1;
@@ -676,9 +678,7 @@
   /* Skip verify of get_longjmp_target, has predicate */
   /* Skip verify of deprecated_use_generic_dummy_frames, invalid_p == 0 */
   /* Skip verify of call_dummy_location, invalid_p == 0 */
-  if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
-      && (gdbarch->call_dummy_location == AT_ENTRY_POINT && gdbarch->call_dummy_address == 0))
-    fprintf_unfiltered (log, "\n\tcall_dummy_address");
+  /* Skip verify of call_dummy_address, invalid_p == 0 */
   if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
       && (gdbarch->call_dummy_start_offset == -1))
     fprintf_unfiltered (log, "\n\tcall_dummy_start_offset");
Index: gdbarch.h
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.h,v
retrieving revision 1.159
diff -u -r1.159 gdbarch.h
--- gdbarch.h	26 Mar 2003 22:39:52 -0000	1.159
+++ gdbarch.h	30 Mar 2003 02:36:42 -0000
@@ -39,6 +39,7 @@
 #if !GDB_MULTI_ARCH
 /* Pull in function declarations refered to, indirectly, via macros.  */
 #include "inferior.h"		/* For unsigned_address_to_pointer().  */
+#include "symfile.h"		/* For entry_point_address().  */
 #endif
 
 struct frame_info;
@@ -1116,6 +1117,11 @@
 #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_LOCATION)
 #define CALL_DUMMY_LOCATION (gdbarch_call_dummy_location (current_gdbarch))
 #endif
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (CALL_DUMMY_ADDRESS)
+#define CALL_DUMMY_ADDRESS() (entry_point_address ())
 #endif
 
 typedef CORE_ADDR (gdbarch_call_dummy_address_ftype) (void);
Index: gdbarch.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.sh,v
retrieving revision 1.211
diff -u -r1.211 gdbarch.sh
--- gdbarch.sh	26 Mar 2003 22:39:52 -0000	1.211
+++ gdbarch.sh	30 Mar 2003 02:36:43 -0000
@@ -519,7 +519,7 @@
 # avoids any potential problems with moving beyond multi-arch partial.
 v:1:DEPRECATED_USE_GENERIC_DUMMY_FRAMES:int:deprecated_use_generic_dummy_frames:::::1::0
 v:1:CALL_DUMMY_LOCATION:int:call_dummy_location:::::AT_ENTRY_POINT::0
-f:2:CALL_DUMMY_ADDRESS:CORE_ADDR:call_dummy_address:void:::0:0::gdbarch->call_dummy_location == AT_ENTRY_POINT && gdbarch->call_dummy_address == 0
+f::CALL_DUMMY_ADDRESS:CORE_ADDR:call_dummy_address:void::::entry_point_address::0
 v:2:CALL_DUMMY_START_OFFSET:CORE_ADDR:call_dummy_start_offset::::0:-1:::0x%08lx
 v:2:CALL_DUMMY_BREAKPOINT_OFFSET:CORE_ADDR:call_dummy_breakpoint_offset::::0:-1::gdbarch->call_dummy_breakpoint_offset_p && gdbarch->call_dummy_breakpoint_offset == -1:0x%08lx::CALL_DUMMY_BREAKPOINT_OFFSET_P
 v:1:CALL_DUMMY_BREAKPOINT_OFFSET_P:int:call_dummy_breakpoint_offset_p::::0:-1
@@ -804,6 +804,7 @@
 #if !GDB_MULTI_ARCH
 /* Pull in function declarations refered to, indirectly, via macros.  */
 #include "inferior.h"		/* For unsigned_address_to_pointer().  */
+#include "symfile.h"		/* For entry_point_address().  */
 #endif
 
 struct frame_info;
@@ -1304,6 +1305,7 @@
 #include "gdb-events.h"
 #include "reggroups.h"
 #include "osabi.h"
+#include "symfile.h"		/* For entry_point_address.  */
 
 /* Static function declarations */
 
Index: h8300-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/h8300-tdep.c,v
retrieving revision 1.47
diff -u -r1.47 h8300-tdep.c
--- h8300-tdep.c	26 Mar 2003 22:39:52 -0000	1.47
+++ h8300-tdep.c	30 Mar 2003 02:37:47 -0000
@@ -1156,7 +1156,6 @@
   set_gdbarch_deprecated_store_return_value (gdbarch, h8300_store_return_value);
   set_gdbarch_deprecated_extract_struct_value_address (gdbarch, h8300_extract_struct_value_address);
   set_gdbarch_use_struct_convention (gdbarch, h8300_use_struct_convention);
-  set_gdbarch_call_dummy_address (gdbarch, entry_point_address);
   set_gdbarch_call_dummy_start_offset (gdbarch, 0);
   set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0);
   set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1);
Index: i386-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-tdep.c,v
retrieving revision 1.123
diff -u -r1.123 i386-tdep.c
--- i386-tdep.c	26 Mar 2003 22:39:52 -0000	1.123
+++ i386-tdep.c	30 Mar 2003 02:37:48 -0000
@@ -1565,7 +1565,6 @@
   set_gdbarch_get_longjmp_target (gdbarch, i386_get_longjmp_target);
 
   /* Call dummy code.  */
-  set_gdbarch_call_dummy_address (gdbarch, entry_point_address);
   set_gdbarch_call_dummy_start_offset (gdbarch, 0);
   set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0);
   set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1);
Index: ia64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ia64-tdep.c,v
retrieving revision 1.59
diff -u -r1.59 ia64-tdep.c
--- ia64-tdep.c	26 Mar 2003 22:39:52 -0000	1.59
+++ ia64-tdep.c	30 Mar 2003 02:37:57 -0000
@@ -2240,7 +2240,6 @@
   set_gdbarch_read_sp (gdbarch, generic_target_read_sp);
   set_gdbarch_write_sp (gdbarch, generic_target_write_sp);
 
-  set_gdbarch_call_dummy_address (gdbarch, entry_point_address);
   set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0);
   set_gdbarch_call_dummy_start_offset (gdbarch, 0);
   set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy);
Index: inferior.h
===================================================================
RCS file: /cvs/src/src/gdb/inferior.h,v
retrieving revision 1.44
diff -u -r1.44 inferior.h
--- inferior.h	27 Mar 2003 15:29:44 -0000	1.44
+++ inferior.h	30 Mar 2003 02:37:58 -0000
@@ -418,9 +418,6 @@
 #define ON_STACK 1
 #define AT_ENTRY_POINT 4
 
-#if !defined (CALL_DUMMY_ADDRESS)
-#define CALL_DUMMY_ADDRESS() (internal_error (__FILE__, __LINE__, "CALL_DUMMY_ADDRESS"), 0)
-#endif
 #if !defined (CALL_DUMMY_START_OFFSET)
 #define CALL_DUMMY_START_OFFSET (internal_error (__FILE__, __LINE__, "CALL_DUMMY_START_OFFSET"), 0)
 #endif
Index: mcore-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mcore-tdep.c,v
retrieving revision 1.48
diff -u -r1.48 mcore-tdep.c
--- mcore-tdep.c	26 Mar 2003 22:39:52 -0000	1.48
+++ mcore-tdep.c	30 Mar 2003 02:38:01 -0000
@@ -1123,7 +1123,6 @@
   set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1);
   set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0);
   set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy);
-  set_gdbarch_call_dummy_address (gdbarch, entry_point_address);
   set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos);
   set_gdbarch_saved_pc_after_call (gdbarch, mcore_saved_pc_after_call);
   set_gdbarch_function_start_offset (gdbarch, 0);
Index: mn10300-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mn10300-tdep.c,v
retrieving revision 1.63
diff -u -r1.63 mn10300-tdep.c
--- mn10300-tdep.c	26 Mar 2003 22:39:52 -0000	1.63
+++ mn10300-tdep.c	30 Mar 2003 02:38:01 -0000
@@ -1188,7 +1188,6 @@
   set_gdbarch_call_dummy_p (gdbarch, 1);
   set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1);
   set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0);
-  set_gdbarch_call_dummy_address (gdbarch, entry_point_address);
   set_gdbarch_call_dummy_words (gdbarch, mn10300_call_dummy_words);
   set_gdbarch_sizeof_call_dummy_words (gdbarch, 
                                        sizeof (mn10300_call_dummy_words));
Index: rs6000-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/rs6000-tdep.c,v
retrieving revision 1.116
diff -u -r1.116 rs6000-tdep.c
--- rs6000-tdep.c	26 Mar 2003 22:39:52 -0000	1.116
+++ rs6000-tdep.c	30 Mar 2003 02:38:04 -0000
@@ -2901,7 +2901,6 @@
   set_gdbarch_char_signed (gdbarch, 0);
 
   set_gdbarch_call_dummy_length (gdbarch, 0);
-  set_gdbarch_call_dummy_address (gdbarch, entry_point_address);
   set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1);
   set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0);
   set_gdbarch_call_dummy_start_offset (gdbarch, 0);
Index: s390-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/s390-tdep.c,v
retrieving revision 1.81
diff -u -r1.81 s390-tdep.c
--- s390-tdep.c	26 Mar 2003 22:39:52 -0000	1.81
+++ s390-tdep.c	30 Mar 2003 02:38:05 -0000
@@ -1863,7 +1863,6 @@
   /* Parameters for inferior function calls.  */
   set_gdbarch_call_dummy_p (gdbarch, 1);
   set_gdbarch_call_dummy_length (gdbarch, 0);
-  set_gdbarch_call_dummy_address (gdbarch, entry_point_address);
   set_gdbarch_call_dummy_start_offset (gdbarch, 0);
   set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point);
   set_gdbarch_deprecated_push_arguments (gdbarch, s390_push_arguments);
Index: sh-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sh-tdep.c,v
retrieving revision 1.107
diff -u -r1.107 sh-tdep.c
--- sh-tdep.c	26 Mar 2003 22:39:52 -0000	1.107
+++ sh-tdep.c	30 Mar 2003 02:38:06 -0000
@@ -4654,7 +4654,6 @@
   set_gdbarch_long_double_bit (gdbarch, 8 * TARGET_CHAR_BIT);
 
   set_gdbarch_call_dummy_length (gdbarch, 0);
-  set_gdbarch_call_dummy_address (gdbarch, entry_point_address);
   set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1); /*???*/
   set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0);
   set_gdbarch_call_dummy_start_offset (gdbarch, 0);
Index: sparc-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sparc-tdep.c,v
retrieving revision 1.79
diff -u -r1.79 sparc-tdep.c
--- sparc-tdep.c	27 Mar 2003 15:29:44 -0000	1.79
+++ sparc-tdep.c	30 Mar 2003 02:38:09 -0000
@@ -3246,7 +3246,6 @@
       set_gdbarch_call_dummy_words (gdbarch, call_dummy_32);
 #else
       set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point);
-      set_gdbarch_call_dummy_address (gdbarch, entry_point_address);
       set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0);
       set_gdbarch_call_dummy_length (gdbarch, 0);
       set_gdbarch_call_dummy_words (gdbarch, call_dummy_nil);
@@ -3302,7 +3301,6 @@
       set_gdbarch_call_dummy_words (gdbarch, call_dummy_64);
 #else
       set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point);
-      set_gdbarch_call_dummy_address (gdbarch, entry_point_address);
       set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0);
       set_gdbarch_call_dummy_length (gdbarch, 0);
       set_gdbarch_call_dummy_start_offset (gdbarch, 0);
Index: v850-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/v850-tdep.c,v
retrieving revision 1.48
diff -u -r1.48 v850-tdep.c
--- v850-tdep.c	26 Mar 2003 22:39:52 -0000	1.48
+++ v850-tdep.c	30 Mar 2003 02:38:09 -0000
@@ -1276,7 +1276,6 @@
   set_gdbarch_deprecated_store_return_value (gdbarch, v850_store_return_value);
   set_gdbarch_deprecated_extract_struct_value_address (gdbarch, v850_extract_struct_value_address);
   set_gdbarch_use_struct_convention (gdbarch, v850_use_struct_convention);
-  set_gdbarch_call_dummy_address (gdbarch, entry_point_address);
   set_gdbarch_call_dummy_start_offset (gdbarch, 0);
   set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0);
   set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1);
Index: xstormy16-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/xstormy16-tdep.c,v
retrieving revision 1.37
diff -u -r1.37 xstormy16-tdep.c
--- xstormy16-tdep.c	26 Mar 2003 22:39:52 -0000	1.37
+++ xstormy16-tdep.c	30 Mar 2003 02:38:10 -0000
@@ -1093,7 +1093,6 @@
   set_gdbarch_deprecated_extract_struct_value_address (gdbarch, xstormy16_extract_struct_value_address);
   set_gdbarch_use_struct_convention (gdbarch,
 				     xstormy16_use_struct_convention);
-  set_gdbarch_call_dummy_address (gdbarch, entry_point_address);
   set_gdbarch_call_dummy_start_offset (gdbarch, 0);
   set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0);
   set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1);

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