2004-02-17 Andrew Cagney <cagney@redhat.com>
authorAndrew Cagney <cagney@redhat.com>
Tue, 17 Feb 2004 15:21:22 +0000 (15:21 +0000)
committerAndrew Cagney <cagney@redhat.com>
Tue, 17 Feb 2004 15:21:22 +0000 (15:21 +0000)
* 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.

gdb/ChangeLog
gdb/Makefile.in
gdb/frv-tdep.c
gdb/ia64-tdep.c
gdb/mips-tdep.c
gdb/rs6000-tdep.c
gdb/symtab.c
gdb/symtab.h

index b7a112cb8241f0d4a3079ef0a66e01dea98c53ed..c2767d0b81ea2eb056b4eab6ad85484bacbb97de 100644 (file)
@@ -1,4 +1,16 @@
-2004-02-09  Andrew Cagney  <cagney@redhat.com>
+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.
+
+2004-02-16  Andrew Cagney  <cagney@redhat.com>
 
        * config/alpha/tm-nbsd.h: Update copyright, delete #undef
        START_INFERIOR_TRAPS_EXPECTED.
index f600575c164d7e742380df6e850247517c389e10..c9235197b6e93c9821787f9d582b057290ae4dcc 100644 (file)
@@ -1703,7 +1703,7 @@ frame-unwind.o: frame-unwind.c $(defs_h) $(frame_h) $(frame_unwind_h) \
 frv-tdep.o: frv-tdep.c $(defs_h) $(gdb_string_h) $(inferior_h) $(gdbcore_h) \
        $(arch_utils_h) $(regcache_h) $(frame_h) $(frame_unwind_h) \
        $(frame_base_h) $(trad_frame_h) $(dis_asm_h) $(gdb_assert_h) \
-       $(sim_regno_h) $(gdb_sim_frv_h) $(opcodes_frv_desc_h)
+       $(sim_regno_h) $(gdb_sim_frv_h) $(opcodes_frv_desc_h) $(symtab_h)
 f-typeprint.o: f-typeprint.c $(defs_h) $(gdb_obstack_h) $(bfd_h) $(symtab_h) \
        $(gdbtypes_h) $(expression_h) $(value_h) $(gdbcore_h) $(target_h) \
        $(f_lang_h) $(gdb_string_h)
index 621848e4d46c7890b717ff0d1fde8da359593ac9..b7936e7e454ef93c39849d6e089c06550729535b 100644 (file)
@@ -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.
index 2b293f2325e804b51fb9eea359f828af32c0461c..f871533c9df13f625730382021c124946868d7ca 100644 (file)
@@ -930,6 +930,9 @@ static int max_skip_non_prologue_insns = 40;
    used with no further scanning in the event that the function is
    frameless.  */
 
+/* FIXME: cagney/2004-02-14: This function and logic have largely been
+   superseded by skip_prologue_using_sal.  */
+
 static CORE_ADDR
 refine_prologue_limit (CORE_ADDR pc, CORE_ADDR lim_pc, int *trust_limit)
 {
index fb80964e6ed81d75c9bcd41c6c63451f3201b68c..9638b0862f433b63c05679e9bc8a103c964a1b8f 100644 (file)
@@ -4564,62 +4564,6 @@ mips_step_skips_delay (CORE_ADDR pc)
                     extract_unsigned_integer (buf, MIPS_INSTLEN));
 }
 
-
-/* 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;
-}
-
 /* Skip the PC past function prologue instructions (32-bit version).
    This is a helper function for mips_skip_prologue.  */
 
index 32cedc048fe749025318ef29e4bf6e7e31b4b145..5eef8959115048aa8420fc7e4586b1a99e5b3444 100644 (file)
@@ -425,6 +425,10 @@ static int max_skip_non_prologue_insns = 10;
    the line data in the symbol table.  If successful, a better guess
    on where the prologue ends is returned, otherwise the previous
    value of lim_pc is returned.  */
+
+/* FIXME: cagney/2004-02-14: This function and logic have largely been
+   superseded by skip_prologue_using_sal.  */
+
 static CORE_ADDR
 refine_prologue_limit (CORE_ADDR pc, CORE_ADDR lim_pc)
 {
index 622e27788cab7d6919011413cabe13d669543c47..99f138a30630d7254cdc38ab38888e3b235fbc1b 100644 (file)
@@ -3860,6 +3860,60 @@ in_prologue (CORE_ADDR pc, CORE_ADDR func_start)
   return func_addr <= pc && pc < sal.end;
 }
 
+/* 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).  */
+
+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;
+}
 \f
 struct symtabs_and_lines
 decode_line_spec (char *string, int funfirstline)
index b5d9ffd65b4ca9e760f23784d9dcfba0fdc777b9..5a6c3984bd1f6b13eb3008b94dc5372af6c8d7c2 100644 (file)
@@ -1318,6 +1318,8 @@ extern enum language deduce_language_from_filename (char *);
 
 extern int in_prologue (CORE_ADDR pc, CORE_ADDR func_start);
 
+extern CORE_ADDR skip_prologue_using_sal (CORE_ADDR func_addr);
+
 extern struct symbol *fixup_symbol_section (struct symbol *,
                                            struct objfile *);
 
This page took 0.039589 seconds and 4 git commands to generate.