--- a/tests/GDBDebuggerTestsR.st Mon Jul 30 07:24:57 2018 +0100
+++ b/tests/GDBDebuggerTestsR.st Tue Aug 07 09:28:55 2018 +0100
@@ -450,8 +450,8 @@
"Created: / 07-02-2018 / 10:56:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
-test_stack_01
- "Tests that stack frames object are preserved amonh run/top cycles
+test_stack_01a
+ "Tests that stack frames object are preserved amonh run/stop cycles
if they 're still valid"
| stack1 stack2 |
@@ -489,8 +489,37 @@
debugger send: 'c' andWaitFor: GDBThreadGroupExitedEvent.
debugger send: 'quit' andWait: false.
- "Created: / 30-01-2018 / 15:54:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 01-02-2018 / 21:04:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Created: / 06-08-2018 / 15:06:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_stack_01b
+ "Tests that stack frames object are preserved amonh run/stop cycles
+ if they 're still valid"
+
+ | stack1 pc1 stack2 pc2 |
+
+ debugger := GDBDebugger new.
+ self assert: debugger isConnected.
+ debugger executable: GDBDebuggeesResource current binaryFactorial1.
+ debugger send: 'b factorial'.
+ debugger send: 'r' andWaitFor: GDBStoppedEvent.
+
+ stack1 := debugger selectedInferior threads first stack.
+ pc1 := stack1 first address.
+ debugger send: 'stepi' andWaitFor: GDBStoppedEvent.
+ stack2 := debugger selectedInferior threads first stack.
+ pc2 := stack2 first address.
+ self assert: stack1 size == 2.
+ self assert: stack2 size == 2.
+ self assert: pc1 ~= pc2.
+ self assert: stack1 first == stack1 first.
+ self assert: stack1 second == stack2 second.
+
+ debugger send: 'd'.
+ debugger send: 'c' andWaitFor: GDBThreadGroupExitedEvent.
+ debugger send: 'quit' andWait: false.
+
+ "Created: / 06-08-2018 / 15:07:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
test_stack_02