From ab260dad3930dcea79a76a1d62b2210be782c68d Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Fri, 16 Mar 2012 18:26:02 +0000 Subject: [PATCH] gdb/ PR symtab/13777 * dwarf2read.c (process_full_comp_unit): Set LOCATIONS_VALID only for GCC >=4.5. gdb/testsuite/ PR symtab/13777 * gdb.dwarf2/dw2-skip-prologue.S (DW_AT_producer): Set it to 4.5.0. --- gdb/ChangeLog | 6 ++++++ gdb/dwarf2read.c | 6 ++++-- gdb/testsuite/ChangeLog | 5 +++++ gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.S | 2 +- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 8368c07ef97..7325047b2b2 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2012-03-16 Jan Kratochvil + + PR symtab/13777 + * dwarf2read.c (process_full_comp_unit): Set LOCATIONS_VALID only for + GCC >=4.5. + 2012-03-16 Chris January * tui-tui.win.c (tui_resize_all): Use erase and clearok instead diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 7944e0f9a0d..2eb5f40f3d9 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -4868,7 +4868,9 @@ process_full_comp_unit (struct dwarf2_per_cu_data *per_cu) /* GCC-4.0 has started to support -fvar-tracking. GCC-3.x still can produce DW_AT_location with location lists but it can be possibly - invalid without -fvar-tracking. + invalid without -fvar-tracking. Still up to GCC-4.4.x incl. 4.4.0 + there were bugs in prologue debug info, fixed later in GCC-4.5 + by "unwind info for epilogues" patch (which is not directly related). For -gdwarf-4 type units LOCATIONS_VALID indication is fortunately not needed, it would be wrong due to missing DW_AT_producer there. @@ -4876,7 +4878,7 @@ process_full_comp_unit (struct dwarf2_per_cu_data *per_cu) Still one can confuse GDB by using non-standard GCC compilation options - this waits on GCC PR other/32998 (-frecord-gcc-switches). */ - if (cu->has_loclist && gcc_4_minor >= 0) + if (cu->has_loclist && gcc_4_minor >= 5) symtab->locations_valid = 1; if (gcc_4_minor >= 5) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index f4a75ddb281..eacbbba89a8 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2012-03-16 Jan Kratochvil + + PR symtab/13777 + * gdb.dwarf2/dw2-skip-prologue.S (DW_AT_producer): Set it to 4.5.0. + 2012-03-16 Joel Brobecker * gdb.ada/set_pckd_arr_elt: New testcase. diff --git a/gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.S b/gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.S index 1d2c006c4ff..725c6947d15 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.S +++ b/gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.S @@ -30,7 +30,7 @@ .4byte func_start /* DW_AT_low_pc */ .4byte func_end /* DW_AT_high_pc */ .ascii "main.c\0" /* DW_AT_name */ - .ascii "GNU C 4.0.0\0" /* DW_AT_producer must be >= 4.0 */ + .ascii "GNU C 4.5.0\0" /* DW_AT_producer must be >= 4.5 */ .byte 2 /* DW_AT_language (DW_LANG_C) */ .uleb128 2 /* Abbrev: DW_TAG_subprogram */ -- 2.30.2