gdb/
authorJan Kratochvil <jan.kratochvil@redhat.com>
Wed, 29 Jun 2011 22:19:24 +0000 (22:19 +0000)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Wed, 29 Jun 2011 22:19:24 +0000 (22:19 +0000)
Disable epilogue unwinders on recent GCCs.
* amd64-tdep.c (amd64_in_function_epilogue_p): New variable symtab,
initialize it, return 0 on EPILOGUE_UNWIND_VALID.
* dwarf2read.c (process_full_comp_unit): Initialize
EPILOGUE_UNWIND_VALID.
* i386-tdep.c (i386_in_function_epilogue_p): New variable symtab,
initialize it, return 0 on EPILOGUE_UNWIND_VALID.
* symtab.h (struct symtab): New field epilogue_unwind_valid.

gdb/ChangeLog
gdb/amd64-tdep.c
gdb/dwarf2read.c
gdb/i386-tdep.c
gdb/symtab.h

index a64f76ca701464f7a1bd6cd950e71c0619e194a8..3f439446debc63d1d81d2b0f6933ea76905d910a 100644 (file)
@@ -1,3 +1,14 @@
+2011-06-29  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       Disable epilogue unwinders on recent GCCs.
+       * amd64-tdep.c (amd64_in_function_epilogue_p): New variable symtab,
+       initialize it, return 0 on EPILOGUE_UNWIND_VALID.
+       * dwarf2read.c (process_full_comp_unit): Initialize
+       EPILOGUE_UNWIND_VALID.
+       * i386-tdep.c (i386_in_function_epilogue_p): New variable symtab,
+       initialize it, return 0 on EPILOGUE_UNWIND_VALID.
+       * symtab.h (struct symtab): New field epilogue_unwind_valid.
+
 2011-06-29  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        Code cleanup - reformatting.
index 8dc43638f9ab10d36cbfa0ec98133554fbae26b5..4524f03ecff6489c4e5c3570dff8b290f3492273 100644 (file)
@@ -2219,6 +2219,11 @@ static int
 amd64_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc)
 {
   gdb_byte insn;
+  struct symtab *symtab;
+
+  symtab = find_pc_symtab (pc);
+  if (symtab && symtab->epilogue_unwind_valid)
+    return 0;
 
   if (target_read_memory (pc, &insn, 1))
     return 0;   /* Can't read memory at pc.  */
index b17d74de4293c9523fd898fb3fae11752502307f..e078c62fa3c2676454b93889d106724f0ba83f6a 100644 (file)
@@ -4751,6 +4751,9 @@ process_full_comp_unit (struct dwarf2_per_cu_data *per_cu)
         */ 
       if (cu->has_loclist && gcc_4_minor >= 0)
        symtab->locations_valid = 1;
+
+      if (gcc_4_minor >= 5)
+       symtab->epilogue_unwind_valid = 1;
     }
 
   if (dwarf2_per_objfile->using_index)
index ab266eff1546e657334fed207457e01e65608fc7..366d0fa849171fc4b3180261760dbea0b7076b16 100644 (file)
@@ -1885,6 +1885,11 @@ static int
 i386_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc)
 {
   gdb_byte insn;
+  struct symtab *symtab;
+
+  symtab = find_pc_symtab (pc);
+  if (symtab && symtab->epilogue_unwind_valid)
+    return 0;
 
   if (target_read_memory (pc, &insn, 1))
     return 0;  /* Can't read memory at pc.  */
index 4f96398a4392f717ab736d908f16177af26ae034..41a0fd6bb1edd9f7779efa4fb9471a6f38eb5d1f 100644 (file)
@@ -779,6 +779,11 @@ struct symtab
 
   unsigned int locations_valid : 1;
 
+  /* DWARF unwinder for this CU is valid even for epilogues (PC at the return
+     instruction).  This is supported by GCC since 4.5.0.  */
+
+  unsigned int epilogue_unwind_valid : 1;
+
   /* The macro table for this symtab.  Like the blockvector, this
      may be shared between different symtabs --- and normally is for
      all the symtabs in a given compilation unit.  */
This page took 0.04314 seconds and 4 git commands to generate.