This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] bfd/dwarf2.c gives wrong line number for inlined code


>> Maybe it's time to throw away these old hacks? ?They date back to
>> http://sourceware.org/ml/binutils/2002-03/msg00292.html
>
> I think so, too.

OK, how's this?

-cary


bfd/ChangeLog:

        PR binutils/10654
        * dwarf2.c (lookup_address_in_line_info_table): Remove obsolete code
        that handled line table rows spanning functions.


Index: dwarf2.c
===================================================================
RCS file: /cvs/src/src/bfd/dwarf2.c,v
retrieving revision 1.123
diff -u -p -r1.123 dwarf2.c
--- dwarf2.c	9 Sep 2009 21:38:57 -0000	1.123
+++ dwarf2.c	18 Sep 2009 18:06:05 -0000
@@ -1523,45 +1523,8 @@ lookup_address_in_line_info_table (struc
       if (each_line->address <= addr && addr < next_line->address)
 	{
 	  addr_match = TRUE;
-
-	  /* If this line appears to span functions, and addr is in the
-	     later function, return the first line of that function instead
-	     of the last line of the earlier one.  This check is for GCC
-	     2.95, which emits the first line number for a function late.  */
-
-	  if (function != NULL)
-	    {
-	      bfd_vma lowest_pc;
-	      struct arange *arange;
-
-	      /* Find the lowest address in the function's range list */
-	      lowest_pc = function->arange.low;
-	      for (arange = &function->arange;
-		   arange;
-		   arange = arange->next)
-		{
-		  if (function->arange.low < lowest_pc)
-		    lowest_pc = function->arange.low;
-		}
-	      /* Check for spanning function and set outgoing line info */
-	      if (addr >= lowest_pc
-		  && each_line->address < lowest_pc
-		  && next_line->address > lowest_pc)
-		{
-		  *filename_ptr = next_line->filename;
-		  *linenumber_ptr = next_line->line;
-		}
-	      else
-		{
-		  *filename_ptr = each_line->filename;
-		  *linenumber_ptr = each_line->line;
-		}
-	    }
-	  else
-	    {
-	      *filename_ptr = each_line->filename;
-	      *linenumber_ptr = each_line->line;
-	    }
+	  *filename_ptr = each_line->filename;
+	  *linenumber_ptr = each_line->line;
 	}

       if (addr_match && !each_line->end_sequence)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]