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

patch for bug 3259


On Oct  5, 2006, Mike Cvet <mcvet@redhat.com> wrote:

> http://sourceware.org/bugzilla/show_bug.cgi?id=3259

> For whatever reason, the unwinding expects the innermost frame to be
> looping at line 61, when in fact it should be 62. This doesn't happen in
> the following backtrace testcase, or anywhere else I've seen... a
> strange anomaly.

I've just attached a patch to bugzilla that works around the compiler
over-optimization of debug info that causes this symptom.  Ok to
install?

for  frysk-core/frysk/pkglibexecdir
from  Alexandre Oliva  <aoliva@redhat.com>

	* funit-rt-looper.c (baz): Avoid overoptimization of the
	infinite loop's debug info.

for  frysk-core/frysk/rt/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* tests/TestStackBacktrace.java (TestLib): Revert.

Index: frysk/frysk-core/frysk/rt/tests/TestStackBacktrace.java
===================================================================
--- frysk.orig/frysk-core/frysk/rt/tests/TestStackBacktrace.java	2006-10-05 23:37:39.000000000 -0300
+++ frysk/frysk-core/frysk/rt/tests/TestStackBacktrace.java	2006-10-06 03:43:51.000000000 -0300
@@ -156,8 +156,7 @@ public class TestStackBacktrace
     assertEquals("baz", frame.getMethodName());
     assertNull(frame.getInner());
     
-    if (!brokenXXX(3295))
-      assertEquals(62, frame.getLineNumber());
+    assertEquals(62, frame.getLineNumber());
 
     frame = frame.getOuter();
     assertTrue(frame.getSourceFile().endsWith(
Index: frysk/frysk-core/frysk/pkglibexecdir/funit-rt-looper.c
===================================================================
--- frysk.orig/frysk-core/frysk/pkglibexecdir/funit-rt-looper.c	2006-10-06 03:47:15.000000000 -0300
+++ frysk/frysk-core/frysk/pkglibexecdir/funit-rt-looper.c	2006-10-06 03:57:10.000000000 -0300
@@ -59,7 +59,7 @@ void *signal_parent(void* args)
 void baz()
 {
   lock = 0;
-  while(1);
+  while(1) asm(""); /* GCC generates bad debug info without the asm.  */
 }
 
 void bar()
-- 
Alexandre Oliva         http://www.lsd.ic.unicamp.br/~oliva/
Secretary for FSF Latin America        http://www.fsfla.org/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}

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