diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2011-06-29 22:19:24 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2011-06-29 22:19:24 +0000 |
commit | e0d00bc749e6b35f45c3497a55c9d2b0606b33d2 (patch) | |
tree | 836d19cf711688fa0240628fb192a86c4b758a31 /gdb | |
parent | 4632c0d0fff081cb28947ede3d6804e8a470423c (diff) | |
download | gdb-e0d00bc749e6b35f45c3497a55c9d2b0606b33d2.zip gdb-e0d00bc749e6b35f45c3497a55c9d2b0606b33d2.tar.gz gdb-e0d00bc749e6b35f45c3497a55c9d2b0606b33d2.tar.bz2 |
gdb/
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.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 11 | ||||
-rw-r--r-- | gdb/amd64-tdep.c | 5 | ||||
-rw-r--r-- | gdb/dwarf2read.c | 3 | ||||
-rw-r--r-- | gdb/i386-tdep.c | 5 | ||||
-rw-r--r-- | gdb/symtab.h | 5 |
5 files changed, 29 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a64f76c..3f43944 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,16 @@ 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. * dwarf2read.c (producer_is_gcc_ge_4_0): Rename to ... (producer_is_gcc_ge_4): ... here, change the return value. diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c index 8dc4363..4524f03 100644 --- a/gdb/amd64-tdep.c +++ b/gdb/amd64-tdep.c @@ -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. */ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index b17d74d..e078c62 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -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) diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index ab266ef..366d0fa 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -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. */ diff --git a/gdb/symtab.h b/gdb/symtab.h index 4f96398..41a0fd6 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -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. */ |