This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
For review: delete write_fp() and TARGET_WRITE_FP()
- To: gdb-patches@sourceware.cygnus.com
- Subject: For review: delete write_fp() and TARGET_WRITE_FP()
- From: Andrew Cagney <ac131313@cygnus.com>
- Date: Tue, 13 Jul 1999 21:11:08 +1000
- DJ-Gateway: from newsgroup cygnus.patches.gdb
- Newsgroups: cygnus.patches.gdb
- Organization: Cygnus Solutions
[Spinoff from multi-arch]
Hello,
The attached patch is my initial cut at deleting the function
write_fp(). To the best of my knowledge it is only used in
sparc-tdep.c!
Can anyone think of why this code should hang around?
Andrew
Index: d10v-tdep.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/d10v-tdep.c,v
retrieving revision 2.53
diff -p -r2.53 d10v-tdep.c
*** d10v-tdep.c 1999/07/07 23:51:04 2.53
--- d10v-tdep.c 1999/07/13 11:04:24
*************** d10v_write_sp (val)
*** 813,825 ****
write_register (SP_REGNUM, D10V_CONVERT_DADDR_TO_RAW (val));
}
- void
- d10v_write_fp (val)
- CORE_ADDR val;
- {
- write_register (FP_REGNUM, D10V_CONVERT_DADDR_TO_RAW (val));
- }
-
CORE_ADDR
d10v_read_fp ()
{
--- 813,818 ----
*************** d10v_gdbarch_init (info, arches)
*** 1346,1352 ****
set_gdbarch_read_pc (gdbarch, d10v_read_pc);
set_gdbarch_write_pc (gdbarch, d10v_write_pc);
set_gdbarch_read_fp (gdbarch, d10v_read_fp);
- set_gdbarch_write_fp (gdbarch, d10v_write_fp);
set_gdbarch_read_sp (gdbarch, d10v_read_sp);
set_gdbarch_write_sp (gdbarch, d10v_write_sp);
--- 1339,1344 ----
Index: findvar.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/findvar.c,v
retrieving revision 1.105
diff -p -r1.105 findvar.c
*** findvar.c 1999/07/07 23:51:07 1.105
--- findvar.c 1999/07/13 11:04:28
*************** read_fp ()
*** 1166,1196 ****
{
return TARGET_READ_FP ();
}
-
- #ifndef TARGET_WRITE_FP
- #define TARGET_WRITE_FP generic_target_write_fp
- #endif
-
- void
- generic_target_write_fp (val)
- CORE_ADDR val;
- {
- #ifdef FP_REGNUM
- if (FP_REGNUM >= 0)
- {
- write_register (FP_REGNUM, val);
- return;
- }
- #endif
- fatal ("generic_target_write_fp");
- }
-
- void
- write_fp (val)
- CORE_ADDR val;
- {
- TARGET_WRITE_FP (val);
- }
/* Will calling read_var_value or locate_var_value on SYM end
up caring what frame it is being evaluated relative to? SYM must
--- 1166,1171 ----
Index: gdbarch.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/gdbarch.c,v
retrieving revision 2.51
diff -p -r2.51 gdbarch.c
*** gdbarch.c 1999/07/13 06:49:26 2.51
--- gdbarch.c 1999/07/13 11:04:31
*************** struct gdbarch
*** 114,120 ****
gdbarch_read_pc_ftype *read_pc;
gdbarch_write_pc_ftype *write_pc;
gdbarch_read_fp_ftype *read_fp;
- gdbarch_write_fp_ftype *write_fp;
gdbarch_read_sp_ftype *read_sp;
gdbarch_write_sp_ftype *write_sp;
int num_regs;
--- 114,119 ----
*************** verify_gdbarch (gdbarch)
*** 374,382 ****
&& (gdbarch->read_fp == 0))
fatal ("gdbarch: verify_gdbarch: read_fp invalid");
if ((GDB_MULTI_ARCH >= 1)
- && (gdbarch->write_fp == 0))
- fatal ("gdbarch: verify_gdbarch: write_fp invalid");
- if ((GDB_MULTI_ARCH >= 1)
&& (gdbarch->read_sp == 0))
fatal ("gdbarch: verify_gdbarch: read_sp invalid");
if ((GDB_MULTI_ARCH >= 1)
--- 373,378 ----
*************** gdbarch_dump ()
*** 617,626 ****
(long) current_gdbarch->read_fp
/*TARGET_READ_FP ()*/);
fprintf_unfiltered (gdb_stdlog,
- "gdbarch_update: TARGET_WRITE_FP = 0x%08lx\n",
- (long) current_gdbarch->write_fp
- /*TARGET_WRITE_FP ()*/);
- fprintf_unfiltered (gdb_stdlog,
"gdbarch_update: TARGET_READ_SP = 0x%08lx\n",
(long) current_gdbarch->read_sp
/*TARGET_READ_SP ()*/);
--- 613,618 ----
*************** set_gdbarch_read_fp (gdbarch, read_fp)
*** 1118,1142 ****
gdbarch_read_fp_ftype read_fp;
{
gdbarch->read_fp = read_fp;
- }
-
- void
- gdbarch_write_fp (struct gdbarch *gdbarch, CORE_ADDR val)
- {
- if (gdbarch->write_fp == 0)
- fatal ("gdbarch: gdbarch_write_fp invalid");
- if (gdbarch_debug >= 2)
- /* FIXME: gdb_std??? */
- fprintf_unfiltered (gdb_stdlog, "gdbarch_write_fp called\n");
- gdbarch->write_fp (val);
- }
-
- void
- set_gdbarch_write_fp (gdbarch, write_fp)
- struct gdbarch *gdbarch;
- gdbarch_write_fp_ftype write_fp;
- {
- gdbarch->write_fp = write_fp;
}
CORE_ADDR
--- 1110,1115 ----
Index: gdbarch.h
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/gdbarch.h,v
retrieving revision 2.54
diff -p -r2.54 gdbarch.h
*** gdbarch.h 1999/07/13 06:49:26 2.54
--- gdbarch.h 1999/07/13 11:04:34
*************** extern void set_gdbarch_read_fp PARAMS (
*** 181,195 ****
#endif
#endif
- typedef void (gdbarch_write_fp_ftype) PARAMS ((CORE_ADDR val));
- extern void gdbarch_write_fp PARAMS ((struct gdbarch *gdbarch, CORE_ADDR val));
- extern void set_gdbarch_write_fp PARAMS ((struct gdbarch *gdbarch, gdbarch_write_fp_ftype *write_fp));
- #if GDB_MULTI_ARCH
- #if (GDB_MULTI_ARCH > 1) || !defined (TARGET_WRITE_FP)
- #define TARGET_WRITE_FP(val) (gdbarch_write_fp (current_gdbarch, val))
- #endif
- #endif
-
typedef CORE_ADDR (gdbarch_read_sp_ftype) PARAMS ((void));
extern CORE_ADDR gdbarch_read_sp PARAMS ((struct gdbarch *gdbarch));
extern void set_gdbarch_read_sp PARAMS ((struct gdbarch *gdbarch, gdbarch_read_sp_ftype *read_sp));
--- 181,186 ----
Index: gdbarch.sh
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/gdbarch.sh,v
retrieving revision 2.34
diff -p -r2.34 gdbarch.sh
*** gdbarch.sh 1999/07/13 06:49:26 2.34
--- gdbarch.sh 1999/07/13 11:04:36
*************** v:1:TARGET_LONG_DOUBLE_BIT:int:long_doub
*** 59,65 ****
f:1:TARGET_READ_PC:CORE_ADDR:read_pc:int pid:pid::0:0
f:1:TARGET_WRITE_PC:void:write_pc:CORE_ADDR val, int pid:val, pid::0:0
f:1:TARGET_READ_FP:CORE_ADDR:read_fp:void:::0:0
- f:1:TARGET_WRITE_FP:void:write_fp:CORE_ADDR val:val::0:0
f:1:TARGET_READ_SP:CORE_ADDR:read_sp:void:::0:0
f:1:TARGET_WRITE_SP:void:write_sp:CORE_ADDR val:val::0:0
#
--- 59,64 ----
Index: h8500-tdep.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/h8500-tdep.c,v
retrieving revision 2.25
diff -p -r2.25 h8500-tdep.c
*** h8500-tdep.c 1999/07/07 23:51:09 2.25
--- h8500-tdep.c 1999/07/13 11:04:37
*************** h8500_read_fp ()
*** 624,636 ****
}
void
- h8500_write_fp (v)
- CORE_ADDR v;
- {
- write_register (PR6_REGNUM, v);
- }
-
- void
_initialize_h8500_tdep ()
{
tm_print_insn = print_insn_h8500;
--- 624,629 ----
Index: inferior.h
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/inferior.h,v
retrieving revision 1.72
diff -p -r1.72 inferior.h
*** inferior.h 1999/07/07 23:51:27 1.72
--- inferior.h 1999/07/13 11:04:38
*************** extern CORE_ADDR read_fp PARAMS ((void))
*** 154,163 ****
extern CORE_ADDR generic_target_read_fp PARAMS ((void));
- extern void write_fp PARAMS ((CORE_ADDR));
-
- extern void generic_target_write_fp PARAMS ((CORE_ADDR));
-
extern void wait_for_inferior PARAMS ((void));
extern void fetch_inferior_event PARAMS ((void));
--- 154,159 ----
Index: sparc-tdep.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/sparc-tdep.c,v
retrieving revision 1.103
diff -p -r1.103 sparc-tdep.c
*** sparc-tdep.c 1999/07/07 23:52:05 1.103
--- sparc-tdep.c 1999/07/13 11:04:53
***************
*** 55,60 ****
--- 55,62 ----
#define SPARC_INTREG_SIZE (REGISTER_RAW_SIZE (G0_REGNUM))
+ static void sparc64_write_fp PARAMS ((CORE_ADDR val));
+
/* From infrun.c */
extern int stop_after_trap;
*************** sparc_push_dummy_frame ()
*** 902,908 ****
if (strcmp (target_shortname, "sim") != 0)
{
! write_fp (old_sp);
/* Set return address register for the call dummy to the current PC. */
write_register (I7_REGNUM, read_pc () - 8);
--- 904,914 ----
if (strcmp (target_shortname, "sim") != 0)
{
! #ifdef GDB_TARGET_IS_SPARC64
! sparc64_write_fp (old_sp);
! #else
! write_register (FP_REGNUM, old_sp);
! #endif
/* Set return address register for the call dummy to the current PC. */
write_register (I7_REGNUM, read_pc () - 8);
*************** sparc64_write_sp (val)
*** 1996,2002 ****
write_register (SP_REGNUM, val);
}
! void
sparc64_write_fp (val)
CORE_ADDR val;
{
--- 2002,2008 ----
write_register (SP_REGNUM, val);
}
! static void
sparc64_write_fp (val)
CORE_ADDR val;
{
Index: config/d10v/tm-d10v.h
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/config/d10v/tm-d10v.h,v
retrieving revision 1.67
diff -p -r1.67 tm-d10v.h
*** tm-d10v.h 1999/07/07 23:52:28 1.67
--- tm-d10v.h 1999/07/13 11:04:54
*************** void d10v_write_pc PARAMS ((CORE_ADDR va
*** 283,295 ****
CORE_ADDR d10v_read_pc PARAMS ((int pid));
void d10v_write_sp PARAMS ((CORE_ADDR val));
CORE_ADDR d10v_read_sp PARAMS ((void));
- void d10v_write_fp PARAMS ((CORE_ADDR val));
CORE_ADDR d10v_read_fp PARAMS ((void));
#define TARGET_READ_PC(pid) d10v_read_pc (pid)
#define TARGET_WRITE_PC(val,pid) d10v_write_pc (val, pid)
#define TARGET_READ_FP() d10v_read_fp ()
- #define TARGET_WRITE_FP(val) d10v_write_fp (val)
#define TARGET_READ_SP() d10v_read_sp ()
#define TARGET_WRITE_SP(val) d10v_write_sp (val)
--- 283,293 ----
Index: config/h8500/tm-h8500.h
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/config/h8500/tm-h8500.h,v
retrieving revision 1.28
diff -p -r1.28 tm-h8500.h
*** tm-h8500.h 1999/07/07 23:52:29 1.28
--- tm-h8500.h 1999/07/13 11:04:55
*************** extern CORE_ADDR h8500_read_sp PARAMS ((
*** 277,283 ****
extern void h8500_write_sp PARAMS ((CORE_ADDR));
extern CORE_ADDR h8500_read_fp PARAMS ((void));
- extern void h8500_write_fp PARAMS ((CORE_ADDR));
extern CORE_ADDR h8500_read_pc PARAMS ((int));
extern void h8500_write_pc PARAMS ((CORE_ADDR, int));
--- 277,282 ----
*************** extern void h8500_write_pc PARAMS ((CORE
*** 289,292 ****
#define TARGET_WRITE_PC(x,pid) h8500_write_pc(x,pid)
#define TARGET_READ_FP() h8500_read_fp()
- #define TARGET_WRITE_FP(x) h8500_write_fp(x)
--- 288,290 ----
Index: config/sparc/tm-sp64.h
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/config/sparc/tm-sp64.h,v
retrieving revision 1.15
diff -p -r1.15 tm-sp64.h
*** tm-sp64.h 1999/07/07 23:52:43 1.15
--- tm-sp64.h 1999/07/13 11:04:58
*************** get_longjmp_target PARAMS ((CORE_ADDR *)
*** 358,369 ****
extern CORE_ADDR sparc64_read_sp ();
extern CORE_ADDR sparc64_read_fp ();
extern void sparc64_write_sp PARAMS ((CORE_ADDR));
- extern void sparc64_write_fp PARAMS ((CORE_ADDR));
#define TARGET_READ_SP() (sparc64_read_sp ())
#define TARGET_READ_FP() (sparc64_read_fp ())
#define TARGET_WRITE_SP(X) (sparc64_write_sp (X))
- #define TARGET_WRITE_FP(X) (sparc64_write_fp (X))
#undef TM_PRINT_INSN_MACH
#define TM_PRINT_INSN_MACH bfd_mach_sparc_v9a
--- 358,367 ----
Index: doc/ChangeLog
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/doc/ChangeLog,v
retrieving revision 2.318
diff -p -r2.318 ChangeLog
*** ChangeLog 1999/07/01 09:20:35 2.318
--- ChangeLog 1999/07/13 11:05:03
***************
*** 1,3 ****
--- 1,8 ----
+ Tue Jul 13 20:59:52 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbint.texinfo: Delete all references to write_fp and
+ TARGET_WRITE_FP.
+
Tue Jun 29 11:43:55 1999 Andrew Cagney <cagney@b1.cygnus.com>
* gdbint.texinfo (SAVE_DUMMY_FRAME_TOS): Define.
Index: doc/gdbint.texinfo
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/doc/gdbint.texinfo,v
retrieving revision 1.127
diff -p -r1.127 gdbint.texinfo
*** gdbint.texinfo 1999/07/01 09:20:35 1.127
--- gdbint.texinfo 1999/07/13 11:05:14
*************** the processor's floating point unit.
*** 1338,1345 ****
If the virtual frame pointer is kept in a register, then define this
macro to be the number (greater than or equal to zero) of that register.
! This should only need to be defined if @code{TARGET_READ_FP} and
! @code{TARGET_WRITE_FP} are not defined.
@item FRAMELESS_FUNCTION_INVOCATION(fi)
Define this to an expression that returns 1 if the function invocation
--- 1338,1345 ----
If the virtual frame pointer is kept in a register, then define this
macro to be the number (greater than or equal to zero) of that register.
! This should only need to be defined if @code{TARGET_READ_FP} is not
! defined.
@item FRAMELESS_FUNCTION_INVOCATION(fi)
Define this to an expression that returns 1 if the function invocation
*************** Number of bits in a short integer; defau
*** 1686,1696 ****
@item TARGET_READ_SP
@item TARGET_WRITE_SP
@item TARGET_READ_FP
- @item TARGET_WRITE_FP
These change the behavior of @code{read_pc}, @code{write_pc},
! @code{read_sp}, @code{write_sp}, @code{read_fp} and @code{write_fp}.
! For most targets, these may be left undefined. GDB will call the read
! and write register functions with the relevant @code{_REGNUM} argument.
These macros are useful when a target keeps one of these registers in a
hard to get at place; for example, part in a segment register and part
--- 1686,1695 ----
@item TARGET_READ_SP
@item TARGET_WRITE_SP
@item TARGET_READ_FP
These change the behavior of @code{read_pc}, @code{write_pc},
! @code{read_sp}, @code{write_sp} and @code{read_fp}. For most targets,
! these may be left undefined. GDB will call the read and write register
! functions with the relevant @code{_REGNUM} argument.
These macros are useful when a target keeps one of these registers in a
hard to get at place; for example, part in a segment register and part