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] Give function_start_offset a default


Hello,

The only architecture that does anything interesting with function_start_offset is the VAX. By making the default zero, the need for all the other architectures to also set this to a value is eliminated.

I'll look to commit this in a few days,

Andrew
2004-01-11  Andrew Cagney  <cagney@redhat.com>

	* gdbarch.sh (FUNCTION_START_OFFSET): Make zero the default.
	* gdbarch.c: Re-generate.
	* xstormy16-tdep.c (xstormy16_gdbarch_init): Do not set
	FUNCTION_START_OFFSET.
	* v850-tdep.c (v850_gdbarch_init): Ditto.
	* sparc-tdep.c (sparc32_gdbarch_init): Ditto.
	* sh64-tdep.c (sh64_gdbarch_init): Ditto.
	* sh-tdep.c (sh_gdbarch_init): Ditto.
	* s390-tdep.c (s390_gdbarch_init): Ditto.
	* rs6000-tdep.c (rs6000_gdbarch_init): Ditto.
	* ns32k-tdep.c (ns32k_gdbarch_init): Ditto.
	* mn10300-tdep.c (mn10300_gdbarch_init): Ditto.
	* mips-tdep.c (mips_gdbarch_init): Ditto.
	* mcore-tdep.c (mcore_gdbarch_init): Ditto.
	* m68k-tdep.c (m68k_gdbarch_init): Ditto.
	* m68hc11-tdep.c (m68hc11_gdbarch_init): Ditto.
	* m32r-tdep.c (m32r_gdbarch_init): Ditto.
	* ia64-tdep.c (ia64_gdbarch_init): Ditto.
	* i386-tdep.c (i386_gdbarch_init): Ditto.
	* hppa-tdep.c (hppa_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.
	* avr-tdep.c (avr_gdbarch_init): Ditto.
	* arm-tdep.c (arm_gdbarch_init): Ditto.
	* alpha-tdep.c (alpha_gdbarch_init): Ditto.

Index: alpha-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/alpha-tdep.c,v
retrieving revision 1.123
diff -u -r1.123 alpha-tdep.c
--- alpha-tdep.c	31 Oct 2003 23:47:16 -0000	1.123
+++ alpha-tdep.c	12 Jan 2004 01:43:40 -0000
@@ -1555,7 +1555,6 @@
   set_gdbarch_breakpoint_from_pc (gdbarch, alpha_breakpoint_from_pc);
   set_gdbarch_decr_pc_after_break (gdbarch, 4);
 
-  set_gdbarch_function_start_offset (gdbarch, 0);
   set_gdbarch_frame_args_skip (gdbarch, 0);
 
   /* Hook in ABI-specific overrides, if they have been registered.  */
Index: arm-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/arm-tdep.c,v
retrieving revision 1.155
diff -u -r1.155 arm-tdep.c
--- arm-tdep.c	11 Nov 2003 20:04:52 -0000	1.155
+++ arm-tdep.c	12 Jan 2004 01:43:43 -0000
@@ -2866,9 +2866,6 @@
   set_gdbarch_smash_text_address (gdbarch, arm_smash_text_address);
   set_gdbarch_addr_bits_remove (gdbarch, arm_addr_bits_remove);
 
-  /* Offset from address of function to start of its code.  */
-  set_gdbarch_function_start_offset (gdbarch, 0);
-
   /* Advance PC across function entry code.  */
   set_gdbarch_skip_prologue (gdbarch, arm_skip_prologue);
 
Index: avr-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/avr-tdep.c,v
retrieving revision 1.73
diff -u -r1.73 avr-tdep.c
--- avr-tdep.c	31 Oct 2003 23:47:17 -0000	1.73
+++ avr-tdep.c	12 Jan 2004 01:43:45 -0000
@@ -1322,8 +1322,6 @@
   set_gdbarch_decr_pc_after_break (gdbarch, 0);
   set_gdbarch_breakpoint_from_pc (gdbarch, avr_breakpoint_from_pc);
 
-  set_gdbarch_function_start_offset (gdbarch, 0);
-
   set_gdbarch_frame_args_skip (gdbarch, 0);
   set_gdbarch_frameless_function_invocation (gdbarch,
                                              frameless_look_for_prologue);
Index: cris-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/cris-tdep.c,v
retrieving revision 1.91
diff -u -r1.91 cris-tdep.c
--- cris-tdep.c	24 Oct 2003 17:37:03 -0000	1.91
+++ cris-tdep.c	12 Jan 2004 01:43:52 -0000
@@ -4285,9 +4285,6 @@
      handler takes care of that.)  */
   set_gdbarch_decr_pc_after_break (gdbarch, 0);
   
-  /* Offset from address of function to start of its code.  */
-  set_gdbarch_function_start_offset (gdbarch, 0);  
-  
   /* The number of bytes at the start of arglist that are not really args,
      0 in the CRIS ABI.  */
   set_gdbarch_frame_args_skip (gdbarch, 0);
Index: d10v-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/d10v-tdep.c,v
retrieving revision 1.138
diff -u -r1.138 d10v-tdep.c
--- d10v-tdep.c	10 Nov 2003 22:47:28 -0000	1.138
+++ d10v-tdep.c	12 Jan 2004 01:43:54 -0000
@@ -1516,7 +1516,6 @@
   set_gdbarch_skip_prologue (gdbarch, d10v_skip_prologue);
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
   set_gdbarch_decr_pc_after_break (gdbarch, 4);
-  set_gdbarch_function_start_offset (gdbarch, 0);
   set_gdbarch_breakpoint_from_pc (gdbarch, d10v_breakpoint_from_pc);
 
   set_gdbarch_remote_translate_xfer_address (gdbarch, 
Index: frv-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/frv-tdep.c,v
retrieving revision 1.64
diff -u -r1.64 frv-tdep.c
--- frv-tdep.c	19 Dec 2003 00:34:26 -0000	1.64
+++ frv-tdep.c	12 Jan 2004 01:43:55 -0000
@@ -1421,7 +1421,6 @@
   set_gdbarch_write_pc (gdbarch, generic_target_write_pc);
 
   set_gdbarch_decr_pc_after_break (gdbarch, 0);
-  set_gdbarch_function_start_offset (gdbarch, 0);
 
   set_gdbarch_remote_translate_xfer_address
     (gdbarch, generic_remote_translate_xfer_address);
Index: gdbarch.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.sh,v
retrieving revision 1.288
diff -u -r1.288 gdbarch.sh
--- gdbarch.sh	14 Nov 2003 21:22:42 -0000	1.288
+++ gdbarch.sh	12 Jan 2004 01:44:03 -0000
@@ -633,7 +633,7 @@
 f:2:MEMORY_INSERT_BREAKPOINT:int:memory_insert_breakpoint:CORE_ADDR addr, char *contents_cache:addr, contents_cache::0:default_memory_insert_breakpoint::0
 f:2:MEMORY_REMOVE_BREAKPOINT:int:memory_remove_breakpoint:CORE_ADDR addr, char *contents_cache:addr, contents_cache::0:default_memory_remove_breakpoint::0
 v:2:DECR_PC_AFTER_BREAK:CORE_ADDR:decr_pc_after_break::::0:-1
-v:2:FUNCTION_START_OFFSET:CORE_ADDR:function_start_offset::::0:-1
+v:2:FUNCTION_START_OFFSET:CORE_ADDR:function_start_offset::::0:::0
 #
 m::REMOTE_TRANSLATE_XFER_ADDRESS:void:remote_translate_xfer_address:struct regcache *regcache, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len:regcache, gdb_addr, gdb_len, rem_addr, rem_len:::generic_remote_translate_xfer_address::0
 #
Index: h8300-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/h8300-tdep.c,v
retrieving revision 1.87
diff -u -r1.87 h8300-tdep.c
--- h8300-tdep.c	11 Dec 2003 06:21:12 -0000	1.87
+++ h8300-tdep.c	12 Jan 2004 01:44:07 -0000
@@ -1327,8 +1327,6 @@
      (which means: exactly on trap instruction). */
   set_gdbarch_decr_pc_after_break (gdbarch, 0);
   /* This value is almost never non-zero... */
-  set_gdbarch_function_start_offset (gdbarch, 0);
-  /* This value is almost never non-zero... */
   set_gdbarch_frame_args_skip (gdbarch, 0);
   set_gdbarch_frameless_function_invocation (gdbarch,
 					     frameless_look_for_prologue);
Index: hppa-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/hppa-tdep.c,v
retrieving revision 1.109
diff -u -r1.109 hppa-tdep.c
--- hppa-tdep.c	19 Dec 2003 06:45:03 -0000	1.109
+++ hppa-tdep.c	12 Jan 2004 01:44:20 -0000
@@ -5189,7 +5189,6 @@
 
   /* The following gdbarch vector elements do not depend on the address
      size, or in any other gdbarch element previously set.  */
-  set_gdbarch_function_start_offset (gdbarch, 0);
   set_gdbarch_skip_prologue (gdbarch, hppa_skip_prologue);
   set_gdbarch_skip_trampoline_code (gdbarch, hppa_skip_trampoline_code);
   set_gdbarch_in_solib_call_trampoline (gdbarch, hppa_in_solib_call_trampoline);
Index: i386-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-tdep.c,v
retrieving revision 1.178
diff -u -r1.178 i386-tdep.c
--- i386-tdep.c	14 Dec 2003 10:59:08 -0000	1.178
+++ i386-tdep.c	12 Jan 2004 01:44:25 -0000
@@ -2005,7 +2005,6 @@
 
   set_gdbarch_breakpoint_from_pc (gdbarch, i386_breakpoint_from_pc);
   set_gdbarch_decr_pc_after_break (gdbarch, 1);
-  set_gdbarch_function_start_offset (gdbarch, 0);
 
   set_gdbarch_frame_args_skip (gdbarch, 8);
   set_gdbarch_pc_in_sigtramp (gdbarch, i386_pc_in_sigtramp);
Index: ia64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ia64-tdep.c,v
retrieving revision 1.107
diff -u -r1.107 ia64-tdep.c
--- ia64-tdep.c	5 Jan 2004 19:53:06 -0000	1.107
+++ ia64-tdep.c	12 Jan 2004 01:44:37 -0000
@@ -3426,7 +3426,6 @@
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
 
   set_gdbarch_decr_pc_after_break (gdbarch, 0);
-  set_gdbarch_function_start_offset (gdbarch, 0);
   set_gdbarch_frame_args_skip (gdbarch, 0);
 
   set_gdbarch_remote_translate_xfer_address (
Index: m32r-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/m32r-tdep.c,v
retrieving revision 1.20
diff -u -r1.20 m32r-tdep.c
--- m32r-tdep.c	31 Oct 2003 23:47:17 -0000	1.20
+++ m32r-tdep.c	12 Jan 2004 01:44:39 -0000
@@ -946,7 +946,6 @@
   set_gdbarch_skip_prologue (gdbarch, m32r_skip_prologue);
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
   set_gdbarch_decr_pc_after_break (gdbarch, 0);
-  set_gdbarch_function_start_offset (gdbarch, 0);
   set_gdbarch_breakpoint_from_pc (gdbarch, m32r_breakpoint_from_pc);
   set_gdbarch_memory_insert_breakpoint (gdbarch,
 					m32r_memory_insert_breakpoint);
Index: m68hc11-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/m68hc11-tdep.c,v
retrieving revision 1.93
diff -u -r1.93 m68hc11-tdep.c
--- m68hc11-tdep.c	11 Nov 2003 20:04:52 -0000	1.93
+++ m68hc11-tdep.c	12 Jan 2004 01:44:39 -0000
@@ -1557,7 +1557,6 @@
   set_gdbarch_skip_prologue (gdbarch, m68hc11_skip_prologue);
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
   set_gdbarch_decr_pc_after_break (gdbarch, 0);
-  set_gdbarch_function_start_offset (gdbarch, 0);
   set_gdbarch_breakpoint_from_pc (gdbarch, m68hc11_breakpoint_from_pc);
   set_gdbarch_deprecated_stack_align (gdbarch, m68hc11_stack_align);
   set_gdbarch_print_insn (gdbarch, gdb_print_insn_m68hc11);
Index: m68k-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/m68k-tdep.c,v
retrieving revision 1.75
diff -u -r1.75 m68k-tdep.c
--- m68k-tdep.c	25 Sep 2003 09:10:30 -0000	1.75
+++ m68k-tdep.c	12 Jan 2004 01:44:41 -0000
@@ -1103,8 +1103,6 @@
   set_gdbarch_long_double_format (gdbarch, &floatformat_m68881_ext);
   set_gdbarch_long_double_bit (gdbarch, 96);
 
-  set_gdbarch_function_start_offset (gdbarch, 0);
-
   set_gdbarch_skip_prologue (gdbarch, m68k_skip_prologue);
 #ifdef SYSCALL_TRAP
   set_gdbarch_deprecated_saved_pc_after_call (gdbarch, m68k_saved_pc_after_call);
Index: mcore-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mcore-tdep.c,v
retrieving revision 1.80
diff -u -r1.80 mcore-tdep.c
--- mcore-tdep.c	23 Nov 2003 02:48:40 -0000	1.80
+++ mcore-tdep.c	12 Jan 2004 01:44:42 -0000
@@ -1071,7 +1071,6 @@
   set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, 0);
   set_gdbarch_deprecated_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos);
   set_gdbarch_deprecated_saved_pc_after_call (gdbarch, mcore_saved_pc_after_call);
-  set_gdbarch_function_start_offset (gdbarch, 0);
   set_gdbarch_decr_pc_after_break (gdbarch, 0);
   set_gdbarch_breakpoint_from_pc (gdbarch, mcore_breakpoint_from_pc);
   set_gdbarch_deprecated_push_return_address (gdbarch, mcore_push_return_address);
Index: mips-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mips-tdep.c,v
retrieving revision 1.269
diff -u -r1.269 mips-tdep.c
--- mips-tdep.c	9 Jan 2004 00:09:53 -0000	1.269
+++ mips-tdep.c	12 Jan 2004 01:45:09 -0000
@@ -6050,8 +6050,6 @@
   set_gdbarch_address_to_pointer (gdbarch, address_to_signed_pointer);
   set_gdbarch_integer_to_address (gdbarch, mips_integer_to_address);
 
-  set_gdbarch_function_start_offset (gdbarch, 0);
-
   set_gdbarch_register_type (gdbarch, mips_register_type);
 
   set_gdbarch_print_registers_info (gdbarch, mips_print_registers_info);
Index: mn10300-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mn10300-tdep.c,v
retrieving revision 1.95
diff -u -r1.95 mn10300-tdep.c
--- mn10300-tdep.c	23 Nov 2003 02:48:40 -0000	1.95
+++ mn10300-tdep.c	12 Jan 2004 01:45:12 -0000
@@ -1173,7 +1173,6 @@
 
   /* Breakpoints.  */
   set_gdbarch_breakpoint_from_pc (gdbarch, mn10300_breakpoint_from_pc);
-  set_gdbarch_function_start_offset (gdbarch, 0);
   set_gdbarch_decr_pc_after_break (gdbarch, 0);
 
   /* Stack unwinding.  */
Index: ns32k-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ns32k-tdep.c,v
retrieving revision 1.62
diff -u -r1.62 ns32k-tdep.c
--- ns32k-tdep.c	2 Oct 2003 20:28:30 -0000	1.62
+++ ns32k-tdep.c	12 Jan 2004 01:45:12 -0000
@@ -601,9 +601,6 @@
   set_gdbarch_decr_pc_after_break (gdbarch, 0);
   set_gdbarch_breakpoint_from_pc (gdbarch, ns32k_breakpoint_from_pc);
 
-  /* Misc info */
-  set_gdbarch_function_start_offset (gdbarch, 0);
-
   /* Should be using push_dummy_call.  */
   set_gdbarch_deprecated_dummy_write_sp (gdbarch, deprecated_write_sp);
 
Index: rs6000-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/rs6000-tdep.c,v
retrieving revision 1.173
diff -u -r1.173 rs6000-tdep.c
--- rs6000-tdep.c	8 Nov 2003 00:13:02 -0000	1.173
+++ rs6000-tdep.c	12 Jan 2004 01:45:19 -0000
@@ -2887,7 +2887,6 @@
   set_gdbarch_skip_prologue (gdbarch, rs6000_skip_prologue);
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
   set_gdbarch_decr_pc_after_break (gdbarch, 0);
-  set_gdbarch_function_start_offset (gdbarch, 0);
   set_gdbarch_breakpoint_from_pc (gdbarch, rs6000_breakpoint_from_pc);
 
   /* Handle the 64-bit SVR4 minimal-symbol convention of using "FN"
Index: s390-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/s390-tdep.c,v
retrieving revision 1.118
diff -u -r1.118 s390-tdep.c
--- s390-tdep.c	31 Oct 2003 22:19:12 -0000	1.118
+++ s390-tdep.c	12 Jan 2004 01:45:19 -0000
@@ -2597,9 +2597,6 @@
   set_gdbarch_deprecated_pop_frame (gdbarch, s390_pop_frame);
   /* Stack grows downward.  */
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
-  /* Offset from address of function to start of its code.
-     Zero on most machines.  */
-  set_gdbarch_function_start_offset (gdbarch, 0);
   set_gdbarch_deprecated_max_register_raw_size (gdbarch, 8);
   set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 8);
   set_gdbarch_breakpoint_from_pc (gdbarch, s390_breakpoint_from_pc);
Index: sh-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sh-tdep.c,v
retrieving revision 1.153
diff -u -r1.153 sh-tdep.c
--- sh-tdep.c	3 Nov 2003 17:08:23 -0000	1.153
+++ sh-tdep.c	12 Jan 2004 01:45:36 -0000
@@ -2245,7 +2245,6 @@
   set_gdbarch_skip_prologue (gdbarch, sh_skip_prologue);
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
   set_gdbarch_decr_pc_after_break (gdbarch, 0);
-  set_gdbarch_function_start_offset (gdbarch, 0);
 
   set_gdbarch_push_dummy_call (gdbarch, sh_push_dummy_call_nofpu);
 
Index: sh64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sh64-tdep.c,v
retrieving revision 1.15
diff -u -r1.15 sh64-tdep.c
--- sh64-tdep.c	13 Nov 2003 00:04:59 -0000	1.15
+++ sh64-tdep.c	12 Jan 2004 01:45:37 -0000
@@ -2849,7 +2849,6 @@
   set_gdbarch_skip_prologue (gdbarch, sh_skip_prologue);
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
   set_gdbarch_decr_pc_after_break (gdbarch, 0);
-  set_gdbarch_function_start_offset (gdbarch, 0);
 
   set_gdbarch_frame_args_skip (gdbarch, 0);
   set_gdbarch_frameless_function_invocation (gdbarch, frameless_look_for_prologue);
Index: sparc-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sparc-tdep.c,v
retrieving revision 1.139
diff -u -r1.139 sparc-tdep.c
--- sparc-tdep.c	11 Jan 2004 20:47:53 -0000	1.139
+++ sparc-tdep.c	12 Jan 2004 01:45:38 -0000
@@ -1081,7 +1081,6 @@
 
   set_gdbarch_breakpoint_from_pc (gdbarch, sparc_breakpoint_from_pc);
   set_gdbarch_decr_pc_after_break (gdbarch, 0);
-  set_gdbarch_function_start_offset (gdbarch, 0);
 
   set_gdbarch_frame_args_skip (gdbarch, 8);
 
Index: v850-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/v850-tdep.c,v
retrieving revision 1.76
diff -u -r1.76 v850-tdep.c
--- v850-tdep.c	2 Oct 2003 20:28:30 -0000	1.76
+++ v850-tdep.c	12 Jan 2004 01:45:38 -0000
@@ -1263,8 +1263,6 @@
      (which means: exactly on trap instruction). */
   set_gdbarch_decr_pc_after_break (gdbarch, 0);
   /* This value is almost never non-zero... */
-  set_gdbarch_function_start_offset (gdbarch, 0);
-  /* This value is almost never non-zero... */
   set_gdbarch_frame_args_skip (gdbarch, 0);
 
   /*
Index: xstormy16-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/xstormy16-tdep.c,v
retrieving revision 1.66
diff -u -r1.66 xstormy16-tdep.c
--- xstormy16-tdep.c	2 Oct 2003 20:28:30 -0000	1.66
+++ xstormy16-tdep.c	12 Jan 2004 01:45:39 -0000
@@ -1073,8 +1073,6 @@
      (which means: exactly on trap instruction). */
   set_gdbarch_decr_pc_after_break (gdbarch, 0);
   /* This value is almost never non-zero... */
-  set_gdbarch_function_start_offset (gdbarch, 0);
-  /* This value is almost never non-zero... */
   set_gdbarch_frame_args_skip (gdbarch, 0);
 
   /*

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