frysk.stack
Class TestLibFunctionStepFrame

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by frysk.junit.TestCase
              extended by frysk.testbed.TestLib
                  extended by frysk.stack.TestLibFunctionStepFrame
All Implemented Interfaces:
Observer, TaskObserver, TaskObserver.Code, TaskObserver.Instruction, Test

public class TestLibFunctionStepFrame
extends TestLib
implements TaskObserver.Code, TaskObserver.Instruction

Test making sure all frames are available when stepping (twice) through a shared library call that goes through a plt entry. It checks on each step that both the calling function and the main function are outer frames (in that order) of the inner frame. Note this checks the low level (libunwind) frames walking. It doesn't test anything at a higher level or with the SteppingEngine.


Nested Class Summary
 
Nested classes/interfaces inherited from interface frysk.proc.TaskObserver
TaskObserver.Cloned, TaskObserver.Code, TaskObserver.Execed, TaskObserver.Forked, TaskObserver.Instruction, TaskObserver.Signaled, TaskObserver.Syscalls, TaskObserver.Terminated, TaskObserver.Terminating, TaskObserver.Watch
 
Field Summary
 
Fields inherited from class frysk.testbed.TestLib
host
 
Constructor Summary
TestLibFunctionStepFrame()
           
 
Method Summary
 void addedTo(Object observable)
          Acknowledge the request to add this Observer from Object's set of observers was successful.
 void addFailed(Object observable, Throwable w)
          Notify that the attempt to add to the specified observer failed.
private  void assertFooAndMainOuterFrames(String message, Frame frame)
           
 void deletedFrom(Object observable)
          Acknowledge the request to delete this Observer from Object's set of observers was successful (or that the Observer was spontaneously deleted, e.g., due to a task exit).
private  void printBacktrace(Frame frame)
           
 void testStepIntoLibFunctionCall()
           
 Action updateExecuted(Task task)
          The task has started executing or has executed another instruction.
 Action updateHit(Task task, long address)
          The task has hit the breakpoint.
 
Methods inherited from class frysk.testbed.TestLib
addToTearDown, addToTearDown, assertRunToFindProc, assertRunUntilStop, assertRunUntilStop, getExecPath, isChildOf, isChildOfMine, isDescendantOf, isDescendantOfMine, runPending, setUp, tearDown
 
Methods inherited from class frysk.junit.TestCase
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, getTimeoutMilliseconds, getTimeoutSeconds, missing32or64, unresolved, unresolvedOffUtrace, unresolvedOn32On64, unresolvedOnIA32, unresolvedOnPPC, unresolvedOnUtrace, unresolvedOnx8664, unsupported
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TestLibFunctionStepFrame

public TestLibFunctionStepFrame()
Method Detail

testStepIntoLibFunctionCall

public void testStepIntoLibFunctionCall()

assertFooAndMainOuterFrames

private void assertFooAndMainOuterFrames(String message,
                                         Frame frame)

printBacktrace

private void printBacktrace(Frame frame)

updateHit

public Action updateHit(Task task,
                        long address)
Description copied from interface: TaskObserver.Code
The task has hit the breakpoint. Return Action.BLOCK to block the task's further execution. Note that all Tasks of a Proc share their breakpoints, so this method needs to check the actual Task that got hit.

Specified by:
updateHit in interface TaskObserver.Code

updateExecuted

public Action updateExecuted(Task task)
Description copied from interface: TaskObserver.Instruction
The task has started executing or has executed another instruction. Return Action.BLOCK to block the task's further execution. When Action.CONTINUE is returned this method will be called as soon as one instruction has been executed.

Specified by:
updateExecuted in interface TaskObserver.Instruction

addFailed

public void addFailed(Object observable,
                      Throwable w)
Description copied from interface: Observer
Notify that the attempt to add to the specified observer failed.

Specified by:
addFailed in interface Observer

addedTo

public void addedTo(Object observable)
Description copied from interface: Observer
Acknowledge the request to add this Observer from Object's set of observers was successful.

Specified by:
addedTo in interface Observer

deletedFrom

public void deletedFrom(Object observable)
Description copied from interface: Observer
Acknowledge the request to delete this Observer from Object's set of observers was successful (or that the Observer was spontaneously deleted, e.g., due to a task exit).

Specified by:
deletedFrom in interface Observer