This is the mail archive of the insight@sources.redhat.com mailing list for the Insight 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]

RFA: Fix a disassembly/line-number bug


[Please CC me, I don't read insight@]

This code is duplicated in GDB (MI), and I just fixed a bug there.  What
Insight has appears to be support for the (now defunct, as far as I can
tell) stabs live range splitting markers that Cygnus wrote, once upon a
time.  These no longer crop up, and a 0 in the line table has gotten a new
meaning in GDB: End of function.  The best thing to do is probably to skip
them if we see them.

Is this patch OK?


-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer

2002-04-04  Daniel Jacobowitz  <drow@mvista.com>

        * generic/gdbtk-cmds.c (gdb_disassemble_driver): Skip
        end-of-function markers in the line table.

Index: gdbtk-cmds.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-cmds.c,v
retrieving revision 1.55
diff -u -p -r1.55 gdbtk-cmds.c
--- gdbtk-cmds.c	2002/04/01 22:29:21	1.55
+++ gdbtk-cmds.c	2002/04/04 20:21:39
@@ -2128,24 +2128,11 @@ gdb_disassemble_driver (CORE_ADDR low, C
               && le[i].pc == le[i + 1].pc)
             continue;		/* Ignore duplicates */
 
-	  /* GCC sometimes emits line directives with a linenumber
-	     of 0.  It does this to handle live range splitting.
-	     This may be a bug, but we need to be able to handle it.
-	     For now, use the previous instructions line number.
-	     Since this is a bit of a hack anyway, we will just lose
-	     if the bogus sline is the first line of the range.  For
-	     functions, I have never seen this to be the case.  */
-	  
-	  if (le[i].line != 0)
-	    {
-	      mle[newlines].line = le[i].line;
-	    }
-	  else
-	    {
-	      if (newlines > 0)
-		mle[newlines].line = mle[newlines - 1].line;
-	    }
-	  
+	  /* Skip any end-of-function markers.  */
+	  if (le[i].line == 0)
+	    continue;
+
+	  mle[newlines].line = le[i].line;
           if (le[i].line > le[i + 1].line)
             out_of_order = 1;
           mle[newlines].start_pc = le[i].pc;


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