From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20520 invoked by alias); 30 Jul 2004 21:18:34 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 20512 invoked from network); 30 Jul 2004 21:18:33 -0000 Received: from unknown (HELO takamaka.act-europe.fr) (142.179.108.108) by sourceware.org with SMTP; 30 Jul 2004 21:18:33 -0000 Received: by takamaka.act-europe.fr (Postfix, from userid 507) id 5F8C047D91; Fri, 30 Jul 2004 14:18:32 -0700 (PDT) Date: Fri, 30 Jul 2004 21:18:00 -0000 From: Joel Brobecker To: Jim Blandy Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA/dwarf2] Small problem scanning line table for included files Message-ID: <20040730211832.GW1167@gnat.com> References: <20040725151137.GT20596@gnat.com> <20040730190104.GU1167@gnat.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="4Ckj6UjgE2iN1+kY" Content-Disposition: inline In-Reply-To: <20040730190104.GU1167@gnat.com> User-Agent: Mutt/1.4i X-SW-Source: 2004-07/txt/msg00522.txt.bz2 --4Ckj6UjgE2iN1+kY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 1073 Hello Jim, > I think you are right. Looking for DW_LNS_set_file was a mistake, since > it is not fullproof as you demonstrated above. I looked at the dwarf3 > (draft7) reference again, and setting that flag everytime we need to > record a line seems to be the perfect place to do (it's a bit > complicated to explain my resoning, I was concerned mostly because > I was a bit fuzzy on certain details which were cleared by rereding > the dwarf3 reference document). > > I shall give this a try, and report back. This worked beautifully, as expected. Here is a new patch, much simpler. 2004-07-30 Joel Brobecker * dwarf2read.c (dwarf_decode_lines): Do not consider the current file as included until we record the first line in the linetable. Tested on x86-linux with a GCC-3.4 based compiler, fixes the following two regressions: sep.exp: list using location inside included file sep.exp: breakpoint inside included file I also verified that this test still passes with GCC 3.2. OK to commit? Thanks, -- Joel --4Ckj6UjgE2iN1+kY Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="dwarf2read.c.diff" Content-length: 1643 Index: dwarf2read.c =================================================================== RCS file: /cvs/src/src/gdb/dwarf2read.c,v retrieving revision 1.157 diff -u -p -r1.157 dwarf2read.c --- dwarf2read.c 30 Jul 2004 12:22:27 -0000 1.157 +++ dwarf2read.c 30 Jul 2004 21:12:10 -0000 @@ -5977,6 +5977,7 @@ dwarf_decode_lines (struct line_header * address += (adj_opcode / lh->line_range) * lh->minimum_instruction_length; line += lh->line_base + (adj_opcode % lh->line_range); + lh->file_names[file - 1].included_p = 1; if (!decode_for_pst_p) { /* append row to matrix using current values */ @@ -5996,6 +5997,7 @@ dwarf_decode_lines (struct line_header * { case DW_LNE_end_sequence: end_sequence = 1; + lh->file_names[file - 1].included_p = 1; if (!decode_for_pst_p) record_line (current_subfile, 0, address); break; @@ -6030,6 +6032,7 @@ dwarf_decode_lines (struct line_header * } break; case DW_LNS_copy: + lh->file_names[file - 1].included_p = 1; if (!decode_for_pst_p) record_line (current_subfile, line, check_cu_functions (address, cu)); @@ -6054,7 +6057,6 @@ dwarf_decode_lines (struct line_header * file = read_unsigned_leb128 (abfd, line_ptr, &bytes_read); line_ptr += bytes_read; fe = &lh->file_names[file - 1]; - fe->included_p = 1; if (fe->dir_index) dir = lh->include_dirs[fe->dir_index - 1]; else --4Ckj6UjgE2iN1+kY--