On FC5 gcc (GCC) 4.1.1 20060525: testBacktrace(frysk.rt.tests.TestStackBacktrace)junit.framework.AssertionFailedError: expected:<62> but was:<61> at frysk.rt.tests.TestStackBacktrace.testBacktrace(TestRunner) at frysk.junit.Runner.<init>(TestRunner) at TestRunner.main(TestRunner) This should not happen since the fix for the innermost frame is already in.
Created attachment 1352 [details] Patch that works around the bug in GCC GCC over-optimizes the empty loop, such that it ends up without line number notes, which is why debug info only mentions the previous line. Adding something that GCC does not understand (an empty asm) will still generate the same code, but the debug info won't be optimized away. I'll look into improving GCC so as to not over-optimize debug info in this case, but it looks hard and it's sort-of pointless.
Discussion about the GCC problem started at http://gcc.gnu.org/ml/gcc/2006-10/msg00199.html
The bug appears also in the frysk test program funit-rt-threader.c. The while loop at line 71 is sometimes reported as being at line 71 or at line 72.
*** Bug 3814 has been marked as a duplicate of this bug. ***
ping?
Confirmed still a problem with: gcc (GCC) 4.1.2 20070925 (Red Hat 4.1.2-31) $ frysk-core/frysk/pkglibdir/funit-rt-looper 0 0 & $ frysk-core/frysk/bindir/fstack -a $! Task #28422 #0 0x0804864e in baz() /home/mark/src/frysk-obj/frysk-core/../../frysk/frysk-core/frysk/pkglibdir/funit-rt-looper.c#61 [...] # Line number should be 62, not 61.