This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[commit/mips] Delete after_prologue
- From: Andrew Cagney <cagney at gnu dot org>
- To: gdb-patches at sources dot redhat dot com
- Date: Sat, 30 Oct 2004 14:11:41 -0400
- Subject: [commit/mips] Delete after_prologue
Joel's changes drew my attention to this. It's plain busted - in the
end it just uses the sal - deleted. heuristic_proc_desc is collateral
damage.
Andrew
2004-10-30 Andrew Cagney <cagney@gnu.org>
Total breakage identified by Joel Brobecker.
* mips-tdep.c (after_prologue): Delete.
(mips_skip_prologue): Use skip_prologue_using_sal.
(heuristic_proc_desc): Delete, unused.
Index: mips-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mips-tdep.c,v
retrieving revision 1.344
diff -p -u -r1.344 mips-tdep.c
--- mips-tdep.c 30 Oct 2004 17:53:46 -0000 1.344
+++ mips-tdep.c 30 Oct 2004 19:05:59 -0000
@@ -419,9 +419,6 @@ mips_stack_argsize (struct gdbarch *gdba
#define VM_MIN_ADDRESS (CORE_ADDR)0x400000
struct mips_frame_cache;
-static mips_extra_func_info_t heuristic_proc_desc (CORE_ADDR, CORE_ADDR,
- struct frame_info *,
- struct mips_frame_cache *);
static mips_extra_func_info_t non_heuristic_proc_desc (CORE_ADDR pc,
CORE_ADDR *addrptr);
@@ -431,8 +428,6 @@ static CORE_ADDR read_next_frame_reg (st
static void reinit_frame_cache_sfunc (char *, int, struct cmd_list_element *);
-static CORE_ADDR after_prologue (CORE_ADDR pc);
-
static struct type *mips_float_register_type (void);
static struct type *mips_double_register_type (void);
@@ -874,76 +869,6 @@ mips_write_pc (CORE_ADDR pc, ptid_t ptid
write_register_pid (mips_regnum (current_gdbarch)->pc, pc, ptid);
}
-/* This returns the PC of the first inst after the prologue. If we can't
- find the prologue, then return 0. */
-
-static CORE_ADDR
-after_prologue (CORE_ADDR pc)
-{
- mips_extra_func_info_t proc_desc;
- struct symtab_and_line sal;
- CORE_ADDR func_addr, func_end;
- CORE_ADDR startaddr = 0;
-
- /* Pass a NULL next_frame to heuristic_proc_desc. We should not
- attempt to read the stack pointer from the current machine state,
- because the current machine state has nothing to do with the
- information we need from the proc_desc; and the process may or
- may not exist right now. */
- proc_desc = non_heuristic_proc_desc (pc, &startaddr);
- if (proc_desc)
- {
- /* IF this is the topmost frame AND (this proc does not have
- debugging information OR the PC is in the procedure prologue)
- THEN create a "heuristic" proc_desc (by analyzing the actual
- code) to replace the "official" proc_desc. */
- struct symtab_and_line val;
- if (PROC_SYMBOL (proc_desc))
- {
- val = find_pc_line (BLOCK_START
- (SYMBOL_BLOCK_VALUE (PROC_SYMBOL (proc_desc))),
- 0);
- val.pc = val.end ? val.end : pc;
- }
- if (!PROC_SYMBOL (proc_desc) || pc < val.pc)
- {
- mips_extra_func_info_t found_heuristic =
- heuristic_proc_desc (PROC_LOW_ADDR (proc_desc), pc, NULL, NULL);
- if (found_heuristic)
- proc_desc = found_heuristic;
- }
- }
- else
- {
- if (startaddr == 0)
- startaddr = heuristic_proc_start (pc);
-
- proc_desc = heuristic_proc_desc (startaddr, pc, NULL, NULL);
- }
-
- if (proc_desc)
- {
- /* If function is frameless, then we need to do it the hard way. I
- strongly suspect that frameless always means prologueless... */
- if (PROC_FRAME_REG (proc_desc) == MIPS_SP_REGNUM
- && PROC_FRAME_OFFSET (proc_desc) == 0)
- return 0;
- }
-
- if (!find_pc_partial_function (pc, NULL, &func_addr, &func_end))
- return 0; /* Unknown */
-
- sal = find_pc_line (func_addr, 0);
-
- if (sal.end < func_end)
- return sal.end;
-
- /* The line after the prologue is after the end of the function. In this
- case, tell the caller to find the prologue the hard way. */
-
- return 0;
-}
-
/* Fetch and return instruction from the specified location. If the PC
is odd, assume it's a MIPS16 instruction; otherwise MIPS32. */
@@ -2665,27 +2590,6 @@ heuristic-fence-post' command.\n", paddr
return start_pc;
}
-static mips_extra_func_info_t
-heuristic_proc_desc (CORE_ADDR start_pc, CORE_ADDR limit_pc,
- struct frame_info *next_frame,
- struct mips_frame_cache *this_cache)
-{
- if (start_pc == 0)
- return NULL;
-
- memset (&temp_proc_desc, '\0', sizeof (temp_proc_desc));
- PROC_LOW_ADDR (&temp_proc_desc) = start_pc;
- PROC_FRAME_REG (&temp_proc_desc) = MIPS_SP_REGNUM;
- PROC_PC_REG (&temp_proc_desc) = MIPS_RA_REGNUM;
-
- if (mips_pc_is_mips16 (start_pc))
- mips16_scan_prologue (start_pc, limit_pc, next_frame, this_cache);
- else
- mips32_scan_prologue (start_pc, limit_pc, next_frame, this_cache);
-
- return &temp_proc_desc;
-}
-
struct mips_objfile_private
{
bfd_size_type size;
@@ -4774,15 +4678,18 @@ mips_step_skips_delay (CORE_ADDR pc)
static CORE_ADDR
mips_skip_prologue (CORE_ADDR pc)
{
+ CORE_ADDR limit_pc;
+ CORE_ADDR func_addr;
+
/* See if we can determine the end of the prologue via the symbol table.
If so, then return either PC, or the PC after the prologue, whichever
is greater. */
-
- CORE_ADDR post_prologue_pc = after_prologue (pc);
- CORE_ADDR limit_pc;
-
- if (post_prologue_pc != 0)
- return max (pc, post_prologue_pc);
+ if (find_pc_partial_function (pc, NULL, &func_addr, NULL))
+ {
+ CORE_ADDR post_prologue_pc = skip_prologue_using_sal (func_addr);
+ if (post_prologue_pc != 0)
+ return max (pc, post_prologue_pc);
+ }
/* Can't determine prologue from the symbol table, need to examine
instructions. */