diff --git a/frysk-core/frysk/pkglibdir/funit-stepping-asm.S b/frysk-core/frysk/pkglibdir/funit-stepping-asm.S index 4af1506..cde2b22 100644 --- a/frysk-core/frysk/pkglibdir/funit-stepping-asm.S +++ b/frysk-core/frysk/pkglibdir/funit-stepping-asm.S @@ -40,10 +40,18 @@ #include "frysk-asm.h" + FUNCTION_BEGIN(fifth,1) + FUNCTION_PROLOGUE(fifth,1) ; NO_OP // _stepOverPrologue_ + FUNCTION_EPILOGUE(fifth,1) + FUNCTION_RETURN(fifth,1) + FUNCTION_END(fifth,1) + + FUNCTION_BEGIN(fourth,0) FUNCTION_PROLOGUE(fourth,0) NO_OP // _stepAdvanceStart_ NO_OP + FUNCTION_CALL(fifth) FUNCTION_EPILOGUE(fourth,0) FUNCTION_RETURN(fourth,0) FUNCTION_END(fourth,0) diff --git a/frysk-core/frysk/stepping/TestStepping.java b/frysk-core/frysk/stepping/TestStepping.java index 7f14ea1..cab4480 100644 --- a/frysk-core/frysk/stepping/TestStepping.java +++ b/frysk-core/frysk/stepping/TestStepping.java @@ -952,6 +952,52 @@ public class TestStepping extends TestLib { cleanup(); } + /** + * Tests that the line stepper steps OK even when stack pointer + * changes. + */ + public void testASMFunctionStepOverPrologue() { + + /** Variable setup */ + String source = Config.getRootSrcDir() + + "frysk-core/frysk/pkglibdir/funit-stepping-asm.S"; + + this.scanner = new TestfileTokenScanner(new File(source)); + + /* The line number where the test begins, prologue of fifth + function. */ + int startLine = this.scanner.findTokenLine("_stepOverPrologue_"); + + /* The line number the test should end up at, still the same + line (only prologue is stepped over, not the NO_OP) */ + int endLine = this.scanner.findTokenLine("_stepOverPrologue_"); + + /* The test process */ + dbae = new DaemonBlockedAtEntry(Config + .getPkgLibFile("funit-stepping-asm")); + + Task theTask = dbae.getMainTask(); + + this.testStarted = false; + + initTaskWithTask(theTask, source, startLine, endLine); + + this.currentTest = new AssertLine(endLine, theTask); + + DebugInfoFrame frame = DebugInfoStackFactory + .createDebugInfoStackTrace(theTask); + assertTrue("Line information present", frame.getLines().length > 0); + + /** The stepping operation */ + this.se.stepOver(theTask, frame); + + this.testStarted = true; + /** Run to completion */ + assertRunUntilStop("Running test"); + cleanup(); + } + + boolean genericUpdate = false; public Task initTask(Offspring process, String source, int startLine,