This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[patch] workaround gcc46: prologue skip skips too far (PR 12435)
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Sat, 26 Mar 2011 08:00:48 +0100
- Subject: [patch] workaround gcc46: prologue skip skips too far (PR 12435)
Hi,
as FSF GCC 4.6.0 is going to be released with its debug/ regression:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47471
proposing here for 7.3 the patch present in Fedora 15 as attached now in:
gcc46: prologue skip skips too far
http://sourceware.org/bugzilla/show_bug.cgi?id=12435
It yet needs a testcase and check if it cannot regress on correct GCCs.
gcc (GCC) 4.6.1 20110326 (prerelease)
void f (int a, ...) {}
int main (void) { f (1); return 0; }
GNU gdb (GDB) 7.2.50.20110325-cvs
This GDB was configured as "x86_64-unknown-linux-gnu".
(gdb) break f
Breakpoint 1 at 0x400483: file 1.c, line 1.
(gdb) run
Starting program: .../1
[Inferior 1 (process 18457) exited normally]
(gdb) q
Thanks,
Jan
--- a/gdb/dwarf2read.c
+++ a/gdb/dwarf2read.c
@@ -10371,6 +10371,9 @@ dwarf_decode_lines (struct line_header *lh, const char *comp_dir, bfd *abfd,
if (op_code >= lh->opcode_base)
{
+ CORE_ADDR saved_address = address;
+ unsigned int saved_line = line;
+
/* Special operand. */
adj_opcode = op_code - lh->opcode_base;
address += (((op_index + (adj_opcode / lh->line_range))
@@ -10383,7 +10386,8 @@ dwarf_decode_lines (struct line_header *lh, const char *comp_dir, bfd *abfd,
dwarf2_debug_line_missing_file_complaint ();
/* For now we ignore lines not starting on an
instruction boundary. */
- else if (op_index == 0)
+ else if (op_index == 0
+ && (address != saved_address || line != saved_line))
{
lh->file_names[file - 1].included_p = 1;
if (!decode_for_pst_p && is_stmt)