diff options
author | Andrew Cagney <cagney@redhat.com> | 2004-02-17 15:21:22 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2004-02-17 15:21:22 +0000 |
commit | 634aa483dd4a87a16b9ebd0a1bd8621dc4196fb2 (patch) | |
tree | 66014fc7bd03522f4684fa59da67075bad2c6c58 /gdb/frv-tdep.c | |
parent | 6c74ac8bb4bd637279571bbe78fa224a6e01d41c (diff) | |
download | gdb-634aa483dd4a87a16b9ebd0a1bd8621dc4196fb2.zip gdb-634aa483dd4a87a16b9ebd0a1bd8621dc4196fb2.tar.gz gdb-634aa483dd4a87a16b9ebd0a1bd8621dc4196fb2.tar.bz2 |
2004-02-17 Andrew Cagney <cagney@redhat.com>
* symtab.c (skip_prologue_using_sal): New function.
* symtab.h (skip_prologue_using_sal): Declare.
* frv-tdep.c: Include "symtab.h".
(skip_prologue_using_sal): Delete function.
* mips-tdep.c (skip_prologue_using_sal): Delete function.
* rs6000-tdep.c (refine_prologue_limit): Mention
skip_prologue_using_sal.
* ia64-tdep.c (refine_prologue_limit): Ditto.
* Makefile.in: Update dependencies.
Diffstat (limited to 'gdb/frv-tdep.c')
-rw-r--r-- | gdb/frv-tdep.c | 57 |
1 files changed, 1 insertions, 56 deletions
diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c index 621848e..b7936e7 100644 --- a/gdb/frv-tdep.c +++ b/gdb/frv-tdep.c @@ -33,6 +33,7 @@ #include "sim-regno.h" #include "gdb/sim-frv.h" #include "opcodes/frv-desc.h" /* for the H_SPR_... enums */ +#include "symtab.h" extern void _initialize_frv_tdep (void); @@ -413,62 +414,6 @@ is_argument_reg (int reg) return (8 <= reg && reg <= 13); } -/* Given PC at the function's start address, attempt to find the - prologue end using SAL information. Return zero if the skip fails. - - A non-optimized prologue traditionally has one SAL for the function - and a second for the function body. A single line function has - them both pointing at the same line. - - An optimized prologue is similar but the prologue may contain - instructions (SALs) from the instruction body. Need to skip those - while not getting into the function body. - - The functions end point and an increasing SAL line are used as - indicators of the prologue's endpoint. - - This code is based on the function refine_prologue_limit (versions - found in both ia64 and ppc). */ - -static CORE_ADDR -skip_prologue_using_sal (CORE_ADDR func_addr) -{ - struct symtab_and_line prologue_sal; - CORE_ADDR start_pc; - CORE_ADDR end_pc; - - /* Get an initial range for the function. */ - find_pc_partial_function (func_addr, NULL, &start_pc, &end_pc); - start_pc += FUNCTION_START_OFFSET; - - prologue_sal = find_pc_line (start_pc, 0); - if (prologue_sal.line != 0) - { - while (prologue_sal.end < end_pc) - { - struct symtab_and_line sal; - - sal = find_pc_line (prologue_sal.end, 0); - if (sal.line == 0) - break; - /* Assume that a consecutive SAL for the same (or larger) - line mark the prologue -> body transition. */ - if (sal.line >= prologue_sal.line) - break; - /* The case in which compiler's optimizer/scheduler has - moved instructions into the prologue. We look ahead in - the function looking for address ranges whose - corresponding line number is less the first one that we - found for the function. This is more conservative then - refine_prologue_limit which scans a large number of SALs - looking for any in the prologue */ - prologue_sal = sal; - } - } - return prologue_sal.end; -} - - /* Scan an FR-V prologue, starting at PC, until frame->PC. If FRAME is non-zero, fill in its saved_regs with appropriate addresses. We assume FRAME's saved_regs array has already been allocated and cleared. |