This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[patch/rfc] Zap remaining Wunused-function
- From: Andrew Cagney <cagney at gnu dot org>
- To: gdb-patches at sources dot redhat dot com
- Date: Thu, 05 Feb 2004 12:28:22 -0500
- Subject: [patch/rfc] Zap remaining Wunused-function
This removes the remaining unused-functions. While its fairly obvious,
and I've checked that things still compile, I'll leave it for a week.
Andrew
2004-02-05 Andrew Cagney <cagney@redhat.com>
* remote-rdi.c (arm_rdi_start_remote): Delete unused function.
(arm_rdi_interrupt, arm_rdi_interrupt_twice): Ditto.
(interrupt_query): Ditto.
(ofunc): Delete unused variable.
* cris-tdep.c (cris_abi): Delete unused function.
(reg_pop_op, move_reg_to_mem_index_inc_op): Ditto.
(cris_get_wide_opcode, cris_get_short_size): Ditto.
(cris_get_asr_quick_shift_steps): Ditto.
(cris_skip_prologue_frameless_p): Ditto.
* arm-tdep.c (arm_push_return_address): Delete unused function.
(arm_push_dummy_frame, arm_fix_call_dummy): Ditto.
* rs6000-tdep.c (rs6000_pc_in_call_dummy): Delete unused function.
* s390-tdep.c (s390_function_start): Delete unused function.
Index: arm-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/arm-tdep.c,v
retrieving revision 1.159
diff -u -r1.159 arm-tdep.c
--- arm-tdep.c 26 Jan 2004 20:51:58 -0000 1.159
+++ arm-tdep.c 5 Feb 2004 17:09:11 -0000
@@ -1188,51 +1188,6 @@
return frame_unwind_register_unsigned (this_frame, ARM_SP_REGNUM);
}
-/* Set the return address for a generic dummy frame. ARM uses the
- entry point. */
-
-static CORE_ADDR
-arm_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
-{
- write_register (ARM_LR_REGNUM, entry_point_address ());
- return sp;
-}
-
-/* Push an empty stack frame, to record the current PC, etc. */
-
-static void
-arm_push_dummy_frame (void)
-{
- CORE_ADDR old_sp = read_register (ARM_SP_REGNUM);
- CORE_ADDR sp = old_sp;
- CORE_ADDR fp, prologue_start;
- int regnum;
-
- /* Push the two dummy prologue instructions in reverse order,
- so that they'll be in the correct low-to-high order in memory. */
- /* sub fp, ip, #4 */
- sp = push_word (sp, 0xe24cb004);
- /* stmdb sp!, {r0-r10, fp, ip, lr, pc} */
- prologue_start = sp = push_word (sp, 0xe92ddfff);
-
- /* Push a pointer to the dummy prologue + 12, because when stm
- instruction stores the PC, it stores the address of the stm
- instruction itself plus 12. */
- fp = sp = push_word (sp, prologue_start + 12);
-
- /* Push the processor status. */
- sp = push_word (sp, read_register (ARM_PS_REGNUM));
-
- /* Push all 16 registers starting with r15. */
- for (regnum = ARM_PC_REGNUM; regnum >= 0; regnum--)
- sp = push_word (sp, read_register (regnum));
-
- /* Update fp (for both Thumb and ARM) and sp. */
- write_register (ARM_FP_REGNUM, fp);
- write_register (THUMB_FP_REGNUM, fp);
- write_register (ARM_SP_REGNUM, sp);
-}
-
/* DEPRECATED_CALL_DUMMY_WORDS:
This sequence of words is the instructions
@@ -1264,70 +1219,6 @@
set_gdbarch_deprecated_call_dummy_breakpoint_offset (current_gdbarch, 4);
else
set_gdbarch_deprecated_call_dummy_breakpoint_offset (current_gdbarch, 8);
-}
-
-/* Fix up the call dummy, based on whether the processor is currently
- in Thumb or ARM mode, and whether the target function is Thumb or
- ARM. There are three different situations requiring three
- different dummies:
-
- * ARM calling ARM: uses the call dummy in tm-arm.h, which has already
- been copied into the dummy parameter to this function.
- * ARM calling Thumb: uses the call dummy in tm-arm.h, but with the
- "mov pc,r4" instruction patched to be a "bx r4" instead.
- * Thumb calling anything: uses the Thumb dummy defined below, which
- works for calling both ARM and Thumb functions.
-
- All three call dummies expect to receive the target function
- address in R4, with the low bit set if it's a Thumb function. */
-
-static void
-arm_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs,
- struct value **args, struct type *type, int gcc_p)
-{
- static short thumb_dummy[4] =
- {
- 0xf000, 0xf801, /* bl label */
- 0xdf18, /* swi 24 */
- 0x4720, /* label: bx r4 */
- };
- static unsigned long arm_bx_r4 = 0xe12fff14; /* bx r4 instruction */
-
- /* Set flag indicating whether the current PC is in a Thumb function. */
- caller_is_thumb = arm_pc_is_thumb (read_pc ());
- arm_set_call_dummy_breakpoint_offset ();
-
- /* If the target function is Thumb, set the low bit of the function
- address. And if the CPU is currently in ARM mode, patch the
- second instruction of call dummy to use a BX instruction to
- switch to Thumb mode. */
- target_is_thumb = arm_pc_is_thumb (fun);
- if (target_is_thumb)
- {
- fun |= 1;
- if (!caller_is_thumb)
- store_unsigned_integer (dummy + 4, sizeof (arm_bx_r4), arm_bx_r4);
- }
-
- /* If the CPU is currently in Thumb mode, use the Thumb call dummy
- instead of the ARM one that's already been copied. This will
- work for both Thumb and ARM target functions. */
- if (caller_is_thumb)
- {
- int i;
- char *p = dummy;
- int len = sizeof (thumb_dummy) / sizeof (thumb_dummy[0]);
-
- for (i = 0; i < len; i++)
- {
- store_unsigned_integer (p, sizeof (thumb_dummy[0]), thumb_dummy[i]);
- p += sizeof (thumb_dummy[0]);
- }
- }
-
- /* Put the target address in r4; the call dummy will copy this to
- the PC. */
- write_register (4, fun);
}
/* When arguments must be pushed onto the stack, they go on in reverse
Index: cris-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/cris-tdep.c,v
retrieving revision 1.96
diff -u -r1.96 cris-tdep.c
--- cris-tdep.c 18 Jan 2004 00:01:32 -0000 1.96
+++ cris-tdep.c 5 Feb 2004 17:09:12 -0000
@@ -172,12 +172,6 @@
return (gdbarch_tdep (current_gdbarch)->cris_mode);
}
-static const char *
-cris_abi (void)
-{
- return (gdbarch_tdep (current_gdbarch)->cris_abi);
-}
-
struct frame_extra_info
{
CORE_ADDR return_pc;
@@ -293,18 +287,6 @@
/* Additional functions in order to handle opcodes. */
static int
-cris_get_wide_opcode (unsigned short insn)
-{
- return ((insn & 0x03E0) >> 5);
-}
-
-static int
-cris_get_short_size (unsigned short insn)
-{
- return ((insn & 0x0010) >> 4);
-}
-
-static int
cris_get_quick_value (unsigned short insn)
{
return (insn & 0x003F);
@@ -329,12 +311,6 @@
}
static int
-cris_get_asr_quick_shift_steps (unsigned short insn)
-{
- return (insn & 0x1F);
-}
-
-static int
cris_get_clear_size (unsigned short insn)
{
return ((insn) & 0xC000);
@@ -717,16 +693,6 @@
return cris_skip_prologue_main (pc, 0);
}
-/* As cris_skip_prologue, but stops as soon as it knows that the function
- has a frame. Its result is equal to its input pc if the function is
- frameless, unequal otherwise. */
-
-static CORE_ADDR
-cris_skip_prologue_frameless_p (CORE_ADDR pc)
-{
- return cris_skip_prologue_main (pc, 1);
-}
-
/* Given a PC value corresponding to the start of a function, return the PC
of the first instruction after the function prologue. */
@@ -2769,63 +2735,6 @@
}
inst_env->reg[REG_PC] += 4 * (cris_get_operand2 (inst) + 1);
}
- }
- inst_env->slot_needed = 0;
- inst_env->prefix_found = 0;
- inst_env->xflag_found = 0;
- inst_env->disable_interrupt = 0;
-}
-
-/* Handles the pop instruction to a general register.
- POP is a assembler macro for MOVE.D [SP+], Rd. */
-
-static void
-reg_pop_op (unsigned short inst, inst_env_type *inst_env)
-{
- /* POP can't have a prefix. */
- if (inst_env->prefix_found)
- {
- inst_env->invalid = 1;
- return;
- }
- if (cris_get_operand2 (inst) == REG_PC)
- {
- /* It's invalid to change the PC in a delay slot. */
- if (inst_env->slot_needed)
- {
- inst_env->invalid = 1;
- return;
- }
- inst_env->reg[REG_PC] =
- read_memory_unsigned_integer (inst_env->reg[REG_SP], 4);
- }
- inst_env->slot_needed = 0;
- inst_env->prefix_found = 0;
- inst_env->xflag_found = 0;
- inst_env->disable_interrupt = 0;
-}
-
-/* Handles moves from register to memory. */
-
-static void
-move_reg_to_mem_index_inc_op (unsigned short inst, inst_env_type *inst_env)
-{
- /* Check if we have a prefix. */
- if (inst_env->prefix_found)
- {
- /* The only thing that can change the PC is an assign. */
- check_assign (inst, inst_env);
- }
- else if ((cris_get_operand1 (inst) == REG_PC)
- && (cris_get_mode (inst) == AUTOINC_MODE))
- {
- /* It's invalid to change the PC in a delay slot. */
- if (inst_env->slot_needed)
- {
- inst_env->invalid = 1;
- return;
- }
- process_autoincrement (cris_get_size (inst), inst, inst_env);
}
inst_env->slot_needed = 0;
inst_env->prefix_found = 0;
Index: remote-rdi.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-rdi.c,v
retrieving revision 1.30
diff -u -r1.30 remote-rdi.c
--- remote-rdi.c 21 Jan 2004 04:11:16 -0000 1.30
+++ remote-rdi.c 5 Feb 2004 17:09:12 -0000
@@ -66,8 +66,6 @@
static void arm_rdi_resume (ptid_t pid, int step,
enum target_signal siggnal);
-static int arm_rdi_start_remote (char *dummy);
-
static void arm_rdi_open (char *name, int from_tty);
static void arm_rdi_create_inferior (char *exec_file, char *args, char **env);
@@ -82,12 +80,6 @@
static void arm_rdi_detach (char *args, int from_tty);
-static void arm_rdi_interrupt (int signo);
-
-static void arm_rdi_interrupt_twice (int signo);
-
-static void interrupt_query (void);
-
static int arm_rdi_insert_breakpoint (CORE_ADDR, char *);
static int arm_rdi_remove_breakpoint (CORE_ADDR, char *);
@@ -130,15 +122,6 @@
}
*local_bp_list;
-
-/* Stub for catch_errors. */
-
-static int
-arm_rdi_start_remote (char *dummy)
-{
- return 1;
-}
-
/* Helper callbacks for the "host interface" structure. RDI functions call
these to forward output from the target system and so forth. */
@@ -479,29 +462,6 @@
}
}
-/* Send ^C to target to halt it. Target will respond, and send us a
- packet. */
-
-static void
-arm_rdi_interrupt (int signo)
-{
-}
-
-static void (*ofunc) ();
-
-/* The user typed ^C twice. */
-static void
-arm_rdi_interrupt_twice (int signo)
-{
-}
-
-/* Ask the user what to do when an interrupt is received. */
-
-static void
-interrupt_query (void)
-{
-}
-
/* Wait until the remote machine stops, then return, storing status in
STATUS just as `wait' would. Returns "pid" (though it's not clear
what, if anything, that means in the case of this target). */
Index: rs6000-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/rs6000-tdep.c,v
retrieving revision 1.177
diff -u -r1.177 rs6000-tdep.c
--- rs6000-tdep.c 26 Jan 2004 20:52:11 -0000 1.177
+++ rs6000-tdep.c 5 Feb 2004 17:09:13 -0000
@@ -2046,17 +2046,6 @@
return 0;
}
-/* Return whether PC is in a dummy function call.
-
- FIXME: This just checks for the end of the stack, which is broken
- for things like stepping through gcc nested function stubs. */
-
-static int
-rs6000_pc_in_call_dummy (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR fp)
-{
- return sp < pc && pc < fp;
-}
-
/* Hook called when a new child process is started. */
void
Index: s390-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/s390-tdep.c,v
retrieving revision 1.120
diff -u -r1.120 s390-tdep.c
--- s390-tdep.c 26 Jan 2004 20:52:11 -0000 1.120
+++ s390-tdep.c 5 Feb 2004 17:09:16 -0000
@@ -1565,22 +1565,6 @@
}
-
-static CORE_ADDR
-s390_function_start (struct frame_info *fi)
-{
- CORE_ADDR function_start = 0;
-
- if (get_frame_extra_info (fi) && get_frame_extra_info (fi)->initialised)
- function_start = get_frame_extra_info (fi)->function_start;
- else if (get_frame_pc (fi))
- function_start = get_frame_func (fi);
- return function_start;
-}
-
-
-
-
static int
s390_frameless_function_invocation (struct frame_info *fi)
{