* [rfc] Remove macro DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRES
@ 2007-06-13 19:20 Markus Deuling
2007-06-15 20:57 ` Mark Kettenis
0 siblings, 1 reply; 5+ messages in thread
From: Markus Deuling @ 2007-06-13 19:20 UTC (permalink / raw)
To: GDB Patches; +Cc: Ulrich Weigand
[-- Attachment #1: Type: text/plain, Size: 369 bytes --]
Hello,
this patch removes DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRES from gdbarch.sh. This macro hasn't been
used anywhere anymore. Build and tested on x86.
ChangeLog:
* gdbarch.sh (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRES): Remove.
* gdbarch.c, gdbarch.h: Regenerate.
Is this ok to commit ?
--
Markus Deuling
GNU Toolchain for Linux on Cell BE
deuling@de.ibm.com
[-- Attachment #2: diff-remove-EXTRACT_STRUCT_VALUE_ADDRESS --]
[-- Type: text/plain, Size: 6422 bytes --]
diff -urN src/gdb/gdbarch.c dev/gdb/gdbarch.c
--- src/gdb/gdbarch.c 2007-06-13 20:02:38.000000000 +0200
+++ dev/gdb/gdbarch.c 2007-06-13 21:10:01.000000000 +0200
@@ -189,7 +189,6 @@
gdbarch_extract_return_value_ftype *extract_return_value;
gdbarch_store_return_value_ftype *store_return_value;
gdbarch_deprecated_use_struct_convention_ftype *deprecated_use_struct_convention;
- gdbarch_deprecated_extract_struct_value_address_ftype *deprecated_extract_struct_value_address;
gdbarch_skip_prologue_ftype *skip_prologue;
gdbarch_inner_than_ftype *inner_than;
gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc;
@@ -313,7 +312,6 @@
0, /* extract_return_value */
0, /* store_return_value */
0, /* deprecated_use_struct_convention */
- 0, /* deprecated_extract_struct_value_address */
0, /* skip_prologue */
0, /* inner_than */
0, /* breakpoint_from_pc */
@@ -560,7 +558,6 @@
/* Skip verify of integer_to_address, has predicate */
/* Skip verify of return_value, has predicate */
/* Skip verify of deprecated_use_struct_convention, invalid_p == 0 */
- /* Skip verify of deprecated_extract_struct_value_address, has predicate */
if (current_gdbarch->skip_prologue == 0)
fprintf_unfiltered (log, "\n\tskip_prologue");
if (current_gdbarch->inner_than == 0)
@@ -733,24 +730,6 @@
fprintf_unfiltered (file,
"gdbarch_dump: decr_pc_after_break = 0x%s\n",
paddr_nz (current_gdbarch->decr_pc_after_break));
-#ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P
- fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P()",
- XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P ()));
-#endif
- fprintf_unfiltered (file,
- "gdbarch_dump: gdbarch_deprecated_extract_struct_value_address_p() = %d\n",
- gdbarch_deprecated_extract_struct_value_address_p (current_gdbarch));
-#ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS
- fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(regcache)",
- XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS (regcache)));
-#endif
- fprintf_unfiltered (file,
- "gdbarch_dump: deprecated_extract_struct_value_address = <0x%lx>\n",
- (long) current_gdbarch->deprecated_extract_struct_value_address);
#ifdef DEPRECATED_FP_REGNUM
fprintf_unfiltered (file,
"gdbarch_dump: DEPRECATED_FP_REGNUM # %s\n",
@@ -2274,30 +2253,6 @@
gdbarch->deprecated_use_struct_convention = deprecated_use_struct_convention;
}
-int
-gdbarch_deprecated_extract_struct_value_address_p (struct gdbarch *gdbarch)
-{
- gdb_assert (gdbarch != NULL);
- return gdbarch->deprecated_extract_struct_value_address != NULL;
-}
-
-CORE_ADDR
-gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, struct regcache *regcache)
-{
- gdb_assert (gdbarch != NULL);
- gdb_assert (gdbarch->deprecated_extract_struct_value_address != NULL);
- if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_extract_struct_value_address called\n");
- return gdbarch->deprecated_extract_struct_value_address (regcache);
-}
-
-void
-set_gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch,
- gdbarch_deprecated_extract_struct_value_address_ftype deprecated_extract_struct_value_address)
-{
- gdbarch->deprecated_extract_struct_value_address = deprecated_extract_struct_value_address;
-}
-
CORE_ADDR
gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
{
diff -urN src/gdb/gdbarch.h dev/gdb/gdbarch.h
--- src/gdb/gdbarch.h 2007-06-13 20:02:38.000000000 +0200
+++ dev/gdb/gdbarch.h 2007-06-13 21:09:51.000000000 +0200
@@ -495,32 +495,8 @@
will be needed for that case to work. NB: It is passed the callers
frame since it is only after the callee has returned that this
function is used.
- M::CORE_ADDR:extract_returned_value_address:struct frame_info *caller_frame:caller_frame */
-
-#if defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS)
-/* Legacy for systems yet to multi-arch DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS */
-#if !defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P)
-#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P() (1)
-#endif
-#endif
-
-extern int gdbarch_deprecated_extract_struct_value_address_p (struct gdbarch *gdbarch);
-#if !defined (GDB_TM_FILE) && defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P)
-#error "Non multi-arch definition of DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS"
-#endif
-#if !defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P)
-#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P() (gdbarch_deprecated_extract_struct_value_address_p (current_gdbarch))
-#endif
-
-typedef CORE_ADDR (gdbarch_deprecated_extract_struct_value_address_ftype) (struct regcache *regcache);
-extern CORE_ADDR gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, struct regcache *regcache);
-extern void set_gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, gdbarch_deprecated_extract_struct_value_address_ftype *deprecated_extract_struct_value_address);
-#if !defined (GDB_TM_FILE) && defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS)
-#error "Non multi-arch definition of DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS"
-#endif
-#if !defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS)
-#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(regcache) (gdbarch_deprecated_extract_struct_value_address (current_gdbarch, regcache))
-#endif
+ M::CORE_ADDR:extract_returned_value_address:struct frame_info *caller_frame:caller_frame
+ */
typedef CORE_ADDR (gdbarch_skip_prologue_ftype) (CORE_ADDR ip);
extern CORE_ADDR gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip);
diff -urN src/gdb/gdbarch.sh dev/gdb/gdbarch.sh
--- src/gdb/gdbarch.sh 2007-06-13 20:02:38.000000000 +0200
+++ dev/gdb/gdbarch.sh 2007-06-13 21:09:41.000000000 +0200
@@ -538,7 +538,6 @@
# function is used.
#M::CORE_ADDR:extract_returned_value_address:struct frame_info *caller_frame:caller_frame
-F:=:CORE_ADDR:deprecated_extract_struct_value_address:struct regcache *regcache:regcache
#
f::CORE_ADDR:skip_prologue:CORE_ADDR ip:ip:0:0
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [rfc] Remove macro DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRES 2007-06-13 19:20 [rfc] Remove macro DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRES Markus Deuling @ 2007-06-15 20:57 ` Mark Kettenis 2007-06-15 23:07 ` Ulrich Weigand 0 siblings, 1 reply; 5+ messages in thread From: Mark Kettenis @ 2007-06-15 20:57 UTC (permalink / raw) To: deuling; +Cc: gdb-patches, uweigand > Date: Wed, 13 Jun 2007 21:19:11 +0200 > From: Markus Deuling <deuling@de.ibm.com> > > Hello, > > this patch removes DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRES from gdbarch.sh. This macro hasn't been > used anywhere anymore. Build and tested on x86. > > ChangeLog: > * gdbarch.sh (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRES): Remove. > * gdbarch.c, gdbarch.h: Regenerate. > > Is this ok to commit ? Last time I looked, there was still stuff using this. Are you sure? ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [rfc] Remove macro DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRES 2007-06-15 20:57 ` Mark Kettenis @ 2007-06-15 23:07 ` Ulrich Weigand 2007-06-18 4:04 ` Markus Deuling 0 siblings, 1 reply; 5+ messages in thread From: Ulrich Weigand @ 2007-06-15 23:07 UTC (permalink / raw) To: Mark Kettenis; +Cc: deuling, gdb-patches Mark Kettenis wrote: > > Date: Wed, 13 Jun 2007 21:19:11 +0200 > > From: Markus Deuling <deuling@de.ibm.com> > > > > Hello, > > > > this patch removes DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRES from gdbarch.sh. This macro hasn't been > > used anywhere anymore. Build and tested on x86. > > > > ChangeLog: > > * gdbarch.sh (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRES): Remove. > > * gdbarch.c, gdbarch.h: Regenerate. > > > > Is this ok to commit ? > > Last time I looked, there was still stuff using this. Are you sure? There is no *caller* of this gdbarch callback left anywhere. However, a number of targets (sh/sh64/frv/ia64) still install this callback. Those functions are all dead code now, and should be removed as well. Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [rfc] Remove macro DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRES 2007-06-15 23:07 ` Ulrich Weigand @ 2007-06-18 4:04 ` Markus Deuling 2007-06-18 18:01 ` Ulrich Weigand 0 siblings, 1 reply; 5+ messages in thread From: Markus Deuling @ 2007-06-18 4:04 UTC (permalink / raw) To: Ulrich Weigand; +Cc: Mark Kettenis, gdb-patches [-- Attachment #1: Type: text/plain, Size: 1621 bytes --] Ulrich Weigand wrote: > Mark Kettenis wrote: >>> Date: Wed, 13 Jun 2007 21:19:11 +0200 >>> From: Markus Deuling <deuling@de.ibm.com> >>> >>> Hello, >>> >>> this patch removes DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRES from gdbarch.sh. This macro hasn't been >>> used anywhere anymore. Build and tested on x86. >>> >>> ChangeLog: >>> * gdbarch.sh (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRES): Remove. >>> * gdbarch.c, gdbarch.h: Regenerate. >>> >>> Is this ok to commit ? >> Last time I looked, there was still stuff using this. Are you sure? > > There is no *caller* of this gdbarch callback left anywhere. > > However, a number of targets (sh/sh64/frv/ia64) still install this > callback. Those functions are all dead code now, and should be > removed as well. > > Bye, > Ulrich > I also removed the remaining callbacks from the targets. ChangeLog: * gdbarch.sh (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS): Remove. * sh-tdep.c (sh_extract_struct_value_address): Remove. (sh_gdbarch_init): Remove set_gdbarch_deprecated_extract_struct_value_address. * sh64-tdep.c (sh64_extract_struct_value_address): Remove. (sh64_gdbarch_init): Remove set_gdbarch_deprecated_extract_struct_value_address. * ia64-tdep.c (ia64_extract_struct_value_address): Remove. (ia64_gdbarch_init): Remove set_gdbarch_deprecated_extract_struct_value_address. * frv-tdep.c (frv_extract_struct_value_address): Remove. (frv_gdbarch_init): Remove set_gdbarch_deprecated_extract_struct_value_address. * gdbarch.c, gdbarch.h: Regenerate. Is this ok to commit ? -- Markus Deuling GNU Toolchain for Linux on Cell BE deuling@de.ibm.com [-- Attachment #2: diff-remove-EXTRACT_STRUCT_VALUE_ADDRESS --] [-- Type: text/plain, Size: 10293 bytes --] diff -urN src/gdb/frv-tdep.c dev/gdb/frv-tdep.c --- src/gdb/frv-tdep.c 2007-06-18 05:36:42.000000000 +0200 +++ dev/gdb/frv-tdep.c 2007-06-18 05:59:31.000000000 +0200 @@ -1049,14 +1049,6 @@ } static CORE_ADDR -frv_extract_struct_value_address (struct regcache *regcache) -{ - ULONGEST addr; - regcache_cooked_read_unsigned (regcache, struct_return_regnum, &addr); - return addr; -} - -static CORE_ADDR frv_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp) { /* Require dword alignment. */ @@ -1502,7 +1494,6 @@ set_gdbarch_extract_return_value (gdbarch, frv_extract_return_value); set_gdbarch_store_return_value (gdbarch, frv_store_return_value); - set_gdbarch_deprecated_extract_struct_value_address (gdbarch, frv_extract_struct_value_address); /* Frame stuff. */ set_gdbarch_unwind_pc (gdbarch, frv_unwind_pc); diff -urN src/gdb/gdbarch.c dev/gdb/gdbarch.c --- src/gdb/gdbarch.c 2007-06-18 05:36:42.000000000 +0200 +++ dev/gdb/gdbarch.c 2007-06-18 05:53:27.000000000 +0200 @@ -188,7 +188,6 @@ gdbarch_extract_return_value_ftype *extract_return_value; gdbarch_store_return_value_ftype *store_return_value; gdbarch_deprecated_use_struct_convention_ftype *deprecated_use_struct_convention; - gdbarch_deprecated_extract_struct_value_address_ftype *deprecated_extract_struct_value_address; gdbarch_skip_prologue_ftype *skip_prologue; gdbarch_inner_than_ftype *inner_than; gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc; @@ -311,7 +310,6 @@ 0, /* extract_return_value */ 0, /* store_return_value */ 0, /* deprecated_use_struct_convention */ - 0, /* deprecated_extract_struct_value_address */ 0, /* skip_prologue */ 0, /* inner_than */ 0, /* breakpoint_from_pc */ @@ -555,7 +553,6 @@ /* Skip verify of integer_to_address, has predicate */ /* Skip verify of return_value, has predicate */ /* Skip verify of deprecated_use_struct_convention, invalid_p == 0 */ - /* Skip verify of deprecated_extract_struct_value_address, has predicate */ if (current_gdbarch->skip_prologue == 0) fprintf_unfiltered (log, "\n\tskip_prologue"); if (current_gdbarch->inner_than == 0) @@ -725,24 +722,6 @@ fprintf_unfiltered (file, "gdbarch_dump: decr_pc_after_break = 0x%s\n", paddr_nz (current_gdbarch->decr_pc_after_break)); -#ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P()", - XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P ())); -#endif - fprintf_unfiltered (file, - "gdbarch_dump: gdbarch_deprecated_extract_struct_value_address_p() = %d\n", - gdbarch_deprecated_extract_struct_value_address_p (current_gdbarch)); -#ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(regcache)", - XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS (regcache))); -#endif - fprintf_unfiltered (file, - "gdbarch_dump: deprecated_extract_struct_value_address = <0x%lx>\n", - (long) current_gdbarch->deprecated_extract_struct_value_address); #ifdef DEPRECATED_FP_REGNUM fprintf_unfiltered (file, "gdbarch_dump: DEPRECATED_FP_REGNUM # %s\n", @@ -2241,30 +2220,6 @@ gdbarch->deprecated_use_struct_convention = deprecated_use_struct_convention; } -int -gdbarch_deprecated_extract_struct_value_address_p (struct gdbarch *gdbarch) -{ - gdb_assert (gdbarch != NULL); - return gdbarch->deprecated_extract_struct_value_address != NULL; -} - -CORE_ADDR -gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, struct regcache *regcache) -{ - gdb_assert (gdbarch != NULL); - gdb_assert (gdbarch->deprecated_extract_struct_value_address != NULL); - if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_extract_struct_value_address called\n"); - return gdbarch->deprecated_extract_struct_value_address (regcache); -} - -void -set_gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, - gdbarch_deprecated_extract_struct_value_address_ftype deprecated_extract_struct_value_address) -{ - gdbarch->deprecated_extract_struct_value_address = deprecated_extract_struct_value_address; -} - CORE_ADDR gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip) { diff -urN src/gdb/gdbarch.h dev/gdb/gdbarch.h --- src/gdb/gdbarch.h 2007-06-18 05:36:42.000000000 +0200 +++ dev/gdb/gdbarch.h 2007-06-18 05:53:27.000000000 +0200 @@ -467,32 +467,8 @@ will be needed for that case to work. NB: It is passed the callers frame since it is only after the callee has returned that this function is used. - M::CORE_ADDR:extract_returned_value_address:struct frame_info *caller_frame:caller_frame */ - -#if defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS) -/* Legacy for systems yet to multi-arch DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS */ -#if !defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P) -#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P() (1) -#endif -#endif - -extern int gdbarch_deprecated_extract_struct_value_address_p (struct gdbarch *gdbarch); -#if !defined (GDB_TM_FILE) && defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P) -#error "Non multi-arch definition of DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS" -#endif -#if !defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P) -#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P() (gdbarch_deprecated_extract_struct_value_address_p (current_gdbarch)) -#endif - -typedef CORE_ADDR (gdbarch_deprecated_extract_struct_value_address_ftype) (struct regcache *regcache); -extern CORE_ADDR gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, struct regcache *regcache); -extern void set_gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, gdbarch_deprecated_extract_struct_value_address_ftype *deprecated_extract_struct_value_address); -#if !defined (GDB_TM_FILE) && defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS) -#error "Non multi-arch definition of DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS" -#endif -#if !defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS) -#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(regcache) (gdbarch_deprecated_extract_struct_value_address (current_gdbarch, regcache)) -#endif + M::CORE_ADDR:extract_returned_value_address:struct frame_info *caller_frame:caller_frame + */ typedef CORE_ADDR (gdbarch_skip_prologue_ftype) (CORE_ADDR ip); extern CORE_ADDR gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip); diff -urN src/gdb/gdbarch.sh dev/gdb/gdbarch.sh --- src/gdb/gdbarch.sh 2007-06-18 05:36:42.000000000 +0200 +++ dev/gdb/gdbarch.sh 2007-06-18 05:53:27.000000000 +0200 @@ -536,7 +536,6 @@ # function is used. #M::CORE_ADDR:extract_returned_value_address:struct frame_info *caller_frame:caller_frame -F:=:CORE_ADDR:deprecated_extract_struct_value_address:struct regcache *regcache:regcache # f::CORE_ADDR:skip_prologue:CORE_ADDR ip:ip:0:0 diff -urN src/gdb/ia64-tdep.c dev/gdb/ia64-tdep.c --- src/gdb/ia64-tdep.c 2007-06-18 05:36:42.000000000 +0200 +++ dev/gdb/ia64-tdep.c 2007-06-18 05:58:41.000000000 +0200 @@ -2994,14 +2994,6 @@ } } -CORE_ADDR -ia64_extract_struct_value_address (struct regcache *regcache) -{ - error (_("ia64_extract_struct_value_address called and cannot get struct value address")); - return 0; -} - - static int is_float_or_hfa_type_recurse (struct type *t, struct type **etp) { @@ -3551,7 +3543,6 @@ set_gdbarch_extract_return_value (gdbarch, ia64_extract_return_value); set_gdbarch_store_return_value (gdbarch, ia64_store_return_value); - set_gdbarch_deprecated_extract_struct_value_address (gdbarch, ia64_extract_struct_value_address); set_gdbarch_memory_insert_breakpoint (gdbarch, ia64_memory_insert_breakpoint); set_gdbarch_memory_remove_breakpoint (gdbarch, ia64_memory_remove_breakpoint); diff -urN src/gdb/sh64-tdep.c dev/gdb/sh64-tdep.c --- src/gdb/sh64-tdep.c 2007-06-18 05:36:43.000000000 +0200 +++ dev/gdb/sh64-tdep.c 2007-06-18 05:57:23.000000000 +0200 @@ -962,17 +962,6 @@ } static CORE_ADDR -sh64_extract_struct_value_address (struct regcache *regcache) -{ - /* FIXME: cagney/2004-01-17: Does the ABI guarantee that the return - address regster is preserved across function calls? Probably - not, making this function wrong. */ - ULONGEST val; - regcache_raw_read_unsigned (regcache, STRUCT_RETURN_REGNUM, &val); - return val; -} - -static CORE_ADDR sh64_frame_align (struct gdbarch *ignore, CORE_ADDR sp) { return sp & ~7; @@ -2487,8 +2476,6 @@ set_gdbarch_register_sim_regno (gdbarch, legacy_register_sim_regno); set_gdbarch_return_value (gdbarch, sh64_return_value); - set_gdbarch_deprecated_extract_struct_value_address (gdbarch, - sh64_extract_struct_value_address); set_gdbarch_skip_prologue (gdbarch, sh64_skip_prologue); set_gdbarch_inner_than (gdbarch, core_addr_lessthan); diff -urN src/gdb/sh-tdep.c dev/gdb/sh-tdep.c --- src/gdb/sh-tdep.c 2007-06-18 05:36:43.000000000 +0200 +++ dev/gdb/sh-tdep.c 2007-06-18 05:56:12.000000000 +0200 @@ -815,18 +815,6 @@ return 1; } -/* Extract from an array REGBUF containing the (raw) register state - the address in which a function should return its structure value, - as a CORE_ADDR (or an expression that can be used as one). */ -static CORE_ADDR -sh_extract_struct_value_address (struct regcache *regcache) -{ - ULONGEST addr; - - regcache_cooked_read_unsigned (regcache, STRUCT_RETURN_REGNUM, &addr); - return addr; -} - static CORE_ADDR sh_frame_align (struct gdbarch *ignore, CORE_ADDR sp) { @@ -2670,8 +2658,6 @@ set_gdbarch_register_sim_regno (gdbarch, legacy_register_sim_regno); set_gdbarch_return_value (gdbarch, sh_return_value_nofpu); - set_gdbarch_deprecated_extract_struct_value_address (gdbarch, - sh_extract_struct_value_address); set_gdbarch_skip_prologue (gdbarch, sh_skip_prologue); set_gdbarch_inner_than (gdbarch, core_addr_lessthan); ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [rfc] Remove macro DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRES 2007-06-18 4:04 ` Markus Deuling @ 2007-06-18 18:01 ` Ulrich Weigand 0 siblings, 0 replies; 5+ messages in thread From: Ulrich Weigand @ 2007-06-18 18:01 UTC (permalink / raw) To: Markus Deuling; +Cc: Mark Kettenis, gdb-patches Markus Deuling wrote: > * gdbarch.sh (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS): Remove. > * sh-tdep.c (sh_extract_struct_value_address): Remove. > (sh_gdbarch_init): Remove > set_gdbarch_deprecated_extract_struct_value_address. > * sh64-tdep.c (sh64_extract_struct_value_address): Remove. > (sh64_gdbarch_init): Remove > set_gdbarch_deprecated_extract_struct_value_address. > * ia64-tdep.c (ia64_extract_struct_value_address): Remove. > (ia64_gdbarch_init): Remove > set_gdbarch_deprecated_extract_struct_value_address. > * frv-tdep.c (frv_extract_struct_value_address): Remove. > (frv_gdbarch_init): Remove > set_gdbarch_deprecated_extract_struct_value_address. > * gdbarch.c, gdbarch.h: Regenerate. I've committed this; I've also removed the comment in gdbarch.sh leading up to the removed function. Note that even the 'replacment' mentioned in that comment, extract_returned_value_address, is itself already obsolete -- the correct way to indicate the returned struct address is by using the RETURN_VALUE_ABI_RETURNS_ADDRESS or RETURN_VALUE_ABI_PRESERVES_ADDRESS return value convention. See below the version of the patch as I committed it. Bye, Ulrich diff -urNp gdb-orig/gdb/frv-tdep.c gdb-head/gdb/frv-tdep.c --- gdb-orig/gdb/frv-tdep.c 2007-06-18 19:51:09.625815000 +0200 +++ gdb-head/gdb/frv-tdep.c 2007-06-18 19:52:40.183483303 +0200 @@ -1049,14 +1049,6 @@ frv_extract_return_value (struct type *t } static CORE_ADDR -frv_extract_struct_value_address (struct regcache *regcache) -{ - ULONGEST addr; - regcache_cooked_read_unsigned (regcache, struct_return_regnum, &addr); - return addr; -} - -static CORE_ADDR frv_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp) { /* Require dword alignment. */ @@ -1502,7 +1494,6 @@ frv_gdbarch_init (struct gdbarch_info in set_gdbarch_extract_return_value (gdbarch, frv_extract_return_value); set_gdbarch_store_return_value (gdbarch, frv_store_return_value); - set_gdbarch_deprecated_extract_struct_value_address (gdbarch, frv_extract_struct_value_address); /* Frame stuff. */ set_gdbarch_unwind_pc (gdbarch, frv_unwind_pc); diff -urNp gdb-orig/gdb/gdbarch.c gdb-head/gdb/gdbarch.c --- gdb-orig/gdb/gdbarch.c 2007-06-18 19:51:09.650811000 +0200 +++ gdb-head/gdb/gdbarch.c 2007-06-18 19:52:40.245474387 +0200 @@ -188,7 +188,6 @@ struct gdbarch gdbarch_extract_return_value_ftype *extract_return_value; gdbarch_store_return_value_ftype *store_return_value; gdbarch_deprecated_use_struct_convention_ftype *deprecated_use_struct_convention; - gdbarch_deprecated_extract_struct_value_address_ftype *deprecated_extract_struct_value_address; gdbarch_skip_prologue_ftype *skip_prologue; gdbarch_inner_than_ftype *inner_than; gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc; @@ -311,7 +310,6 @@ struct gdbarch startup_gdbarch = 0, /* extract_return_value */ 0, /* store_return_value */ 0, /* deprecated_use_struct_convention */ - 0, /* deprecated_extract_struct_value_address */ 0, /* skip_prologue */ 0, /* inner_than */ 0, /* breakpoint_from_pc */ @@ -555,7 +553,6 @@ verify_gdbarch (struct gdbarch *current_ /* Skip verify of integer_to_address, has predicate */ /* Skip verify of return_value, has predicate */ /* Skip verify of deprecated_use_struct_convention, invalid_p == 0 */ - /* Skip verify of deprecated_extract_struct_value_address, has predicate */ if (current_gdbarch->skip_prologue == 0) fprintf_unfiltered (log, "\n\tskip_prologue"); if (current_gdbarch->inner_than == 0) @@ -725,24 +722,6 @@ gdbarch_dump (struct gdbarch *current_gd fprintf_unfiltered (file, "gdbarch_dump: decr_pc_after_break = 0x%s\n", paddr_nz (current_gdbarch->decr_pc_after_break)); -#ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P()", - XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P ())); -#endif - fprintf_unfiltered (file, - "gdbarch_dump: gdbarch_deprecated_extract_struct_value_address_p() = %d\n", - gdbarch_deprecated_extract_struct_value_address_p (current_gdbarch)); -#ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(regcache)", - XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS (regcache))); -#endif - fprintf_unfiltered (file, - "gdbarch_dump: deprecated_extract_struct_value_address = <0x%lx>\n", - (long) current_gdbarch->deprecated_extract_struct_value_address); #ifdef DEPRECATED_FP_REGNUM fprintf_unfiltered (file, "gdbarch_dump: DEPRECATED_FP_REGNUM # %s\n", @@ -2221,30 +2200,6 @@ set_gdbarch_deprecated_use_struct_conven gdbarch->deprecated_use_struct_convention = deprecated_use_struct_convention; } -int -gdbarch_deprecated_extract_struct_value_address_p (struct gdbarch *gdbarch) -{ - gdb_assert (gdbarch != NULL); - return gdbarch->deprecated_extract_struct_value_address != NULL; -} - -CORE_ADDR -gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, struct regcache *regcache) -{ - gdb_assert (gdbarch != NULL); - gdb_assert (gdbarch->deprecated_extract_struct_value_address != NULL); - if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_extract_struct_value_address called\n"); - return gdbarch->deprecated_extract_struct_value_address (regcache); -} - -void -set_gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, - gdbarch_deprecated_extract_struct_value_address_ftype deprecated_extract_struct_value_address) -{ - gdbarch->deprecated_extract_struct_value_address = deprecated_extract_struct_value_address; -} - CORE_ADDR gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip) { diff -urNp gdb-orig/gdb/gdbarch.h gdb-head/gdb/gdbarch.h --- gdb-orig/gdb/gdbarch.h 2007-06-18 19:51:09.671808000 +0200 +++ gdb-head/gdb/gdbarch.h 2007-06-18 19:52:40.301466333 +0200 @@ -427,49 +427,6 @@ extern void set_gdbarch_deprecated_use_s #define DEPRECATED_USE_STRUCT_CONVENTION(gcc_p, value_type) (gdbarch_deprecated_use_struct_convention (current_gdbarch, gcc_p, value_type)) #endif -/* As of 2004-01-17 only the 32-bit SPARC ABI has been identified as an - ABI suitable for the implementation of a robust extract - struct-convention return-value address method (the sparc saves the - address in the callers frame). All the other cases so far examined, - the DEPRECATED_EXTRACT_STRUCT_VALUE implementation has been - erreneous - the code was incorrectly assuming that the return-value - address, stored in a register, was preserved across the entire - function call. - For the moment retain DEPRECATED_EXTRACT_STRUCT_VALUE as a marker of - the ABIs that are still to be analyzed - perhaps this should simply - be deleted. The commented out extract_returned_value_address method - is provided as a starting point for the 32-bit SPARC. It, or - something like it, along with changes to both infcmd.c and stack.c - will be needed for that case to work. NB: It is passed the callers - frame since it is only after the callee has returned that this - function is used. - M::CORE_ADDR:extract_returned_value_address:struct frame_info *caller_frame:caller_frame */ - -#if defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS) -/* Legacy for systems yet to multi-arch DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS */ -#if !defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P) -#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P() (1) -#endif -#endif - -extern int gdbarch_deprecated_extract_struct_value_address_p (struct gdbarch *gdbarch); -#if !defined (GDB_TM_FILE) && defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P) -#error "Non multi-arch definition of DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS" -#endif -#if !defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P) -#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P() (gdbarch_deprecated_extract_struct_value_address_p (current_gdbarch)) -#endif - -typedef CORE_ADDR (gdbarch_deprecated_extract_struct_value_address_ftype) (struct regcache *regcache); -extern CORE_ADDR gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, struct regcache *regcache); -extern void set_gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, gdbarch_deprecated_extract_struct_value_address_ftype *deprecated_extract_struct_value_address); -#if !defined (GDB_TM_FILE) && defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS) -#error "Non multi-arch definition of DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS" -#endif -#if !defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS) -#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(regcache) (gdbarch_deprecated_extract_struct_value_address (current_gdbarch, regcache)) -#endif - typedef CORE_ADDR (gdbarch_skip_prologue_ftype) (CORE_ADDR ip); extern CORE_ADDR gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip); extern void set_gdbarch_skip_prologue (struct gdbarch *gdbarch, gdbarch_skip_prologue_ftype *skip_prologue); diff -urNp gdb-orig/gdb/gdbarch.sh gdb-head/gdb/gdbarch.sh --- gdb-orig/gdb/gdbarch.sh 2007-06-18 19:51:09.692805000 +0200 +++ gdb-head/gdb/gdbarch.sh 2007-06-18 19:52:40.357458279 +0200 @@ -517,28 +517,6 @@ f:=:void:extract_return_value:struct typ f:=:void:store_return_value:struct type *type, struct regcache *regcache, const gdb_byte *valbuf:type, regcache, valbuf:0 f:=:int:deprecated_use_struct_convention:int gcc_p, struct type *value_type:gcc_p, value_type::generic_use_struct_convention::0 -# As of 2004-01-17 only the 32-bit SPARC ABI has been identified as an -# ABI suitable for the implementation of a robust extract -# struct-convention return-value address method (the sparc saves the -# address in the callers frame). All the other cases so far examined, -# the DEPRECATED_EXTRACT_STRUCT_VALUE implementation has been -# erreneous - the code was incorrectly assuming that the return-value -# address, stored in a register, was preserved across the entire -# function call. - -# For the moment retain DEPRECATED_EXTRACT_STRUCT_VALUE as a marker of -# the ABIs that are still to be analyzed - perhaps this should simply -# be deleted. The commented out extract_returned_value_address method -# is provided as a starting point for the 32-bit SPARC. It, or -# something like it, along with changes to both infcmd.c and stack.c -# will be needed for that case to work. NB: It is passed the callers -# frame since it is only after the callee has returned that this -# function is used. - -#M::CORE_ADDR:extract_returned_value_address:struct frame_info *caller_frame:caller_frame -F:=:CORE_ADDR:deprecated_extract_struct_value_address:struct regcache *regcache:regcache - -# f::CORE_ADDR:skip_prologue:CORE_ADDR ip:ip:0:0 f::int:inner_than:CORE_ADDR lhs, CORE_ADDR rhs:lhs, rhs:0:0 f::const gdb_byte *:breakpoint_from_pc:CORE_ADDR *pcptr, int *lenptr:pcptr, lenptr::0: diff -urNp gdb-orig/gdb/ia64-tdep.c gdb-head/gdb/ia64-tdep.c --- gdb-orig/gdb/ia64-tdep.c 2007-06-18 19:51:09.705803000 +0200 +++ gdb-head/gdb/ia64-tdep.c 2007-06-18 19:52:40.404451520 +0200 @@ -2994,13 +2994,6 @@ ia64_extract_return_value (struct type * } } -CORE_ADDR -ia64_extract_struct_value_address (struct regcache *regcache) -{ - error (_("ia64_extract_struct_value_address called and cannot get struct value address")); - return 0; -} - static int is_float_or_hfa_type_recurse (struct type *t, struct type **etp) @@ -3551,7 +3544,6 @@ ia64_gdbarch_init (struct gdbarch_info i set_gdbarch_extract_return_value (gdbarch, ia64_extract_return_value); set_gdbarch_store_return_value (gdbarch, ia64_store_return_value); - set_gdbarch_deprecated_extract_struct_value_address (gdbarch, ia64_extract_struct_value_address); set_gdbarch_memory_insert_breakpoint (gdbarch, ia64_memory_insert_breakpoint); set_gdbarch_memory_remove_breakpoint (gdbarch, ia64_memory_remove_breakpoint); diff -urNp gdb-orig/gdb/sh64-tdep.c gdb-head/gdb/sh64-tdep.c --- gdb-orig/gdb/sh64-tdep.c 2007-06-18 19:51:09.728800000 +0200 +++ gdb-head/gdb/sh64-tdep.c 2007-06-18 19:52:40.462443179 +0200 @@ -962,17 +962,6 @@ sh64_analyze_prologue (struct gdbarch *g } static CORE_ADDR -sh64_extract_struct_value_address (struct regcache *regcache) -{ - /* FIXME: cagney/2004-01-17: Does the ABI guarantee that the return - address regster is preserved across function calls? Probably - not, making this function wrong. */ - ULONGEST val; - regcache_raw_read_unsigned (regcache, STRUCT_RETURN_REGNUM, &val); - return val; -} - -static CORE_ADDR sh64_frame_align (struct gdbarch *ignore, CORE_ADDR sp) { return sp & ~7; @@ -2515,8 +2504,6 @@ sh64_gdbarch_init (struct gdbarch_info i set_gdbarch_register_sim_regno (gdbarch, legacy_register_sim_regno); set_gdbarch_return_value (gdbarch, sh64_return_value); - set_gdbarch_deprecated_extract_struct_value_address (gdbarch, - sh64_extract_struct_value_address); set_gdbarch_skip_prologue (gdbarch, sh64_skip_prologue); set_gdbarch_inner_than (gdbarch, core_addr_lessthan); diff -urNp gdb-orig/gdb/sh-tdep.c gdb-head/gdb/sh-tdep.c --- gdb-orig/gdb/sh-tdep.c 2007-06-18 19:51:09.751797000 +0200 +++ gdb-head/gdb/sh-tdep.c 2007-06-18 19:52:40.518435125 +0200 @@ -815,18 +815,6 @@ sh_use_struct_convention (int gcc_p, str return 1; } -/* Extract from an array REGBUF containing the (raw) register state - the address in which a function should return its structure value, - as a CORE_ADDR (or an expression that can be used as one). */ -static CORE_ADDR -sh_extract_struct_value_address (struct regcache *regcache) -{ - ULONGEST addr; - - regcache_cooked_read_unsigned (regcache, STRUCT_RETURN_REGNUM, &addr); - return addr; -} - static CORE_ADDR sh_frame_align (struct gdbarch *ignore, CORE_ADDR sp) { @@ -2751,8 +2739,6 @@ sh_gdbarch_init (struct gdbarch_info inf set_gdbarch_register_sim_regno (gdbarch, legacy_register_sim_regno); set_gdbarch_return_value (gdbarch, sh_return_value_nofpu); - set_gdbarch_deprecated_extract_struct_value_address (gdbarch, - sh_extract_struct_value_address); set_gdbarch_skip_prologue (gdbarch, sh_skip_prologue); set_gdbarch_inner_than (gdbarch, core_addr_lessthan); -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-06-18 18:01 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2007-06-13 19:20 [rfc] Remove macro DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRES Markus Deuling 2007-06-15 20:57 ` Mark Kettenis 2007-06-15 23:07 ` Ulrich Weigand 2007-06-18 4:04 ` Markus Deuling 2007-06-18 18:01 ` Ulrich Weigand
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox