@@ -36,3 +36,42 @@ def test_relative(self):
36
36
37
37
self .expect ("frame select -r 100" )
38
38
self .expect ("frame select -r 1" , error = True , substrs = ["Already at the top of the stack." ])
39
+
40
+ @no_debug_info_test
41
+ @skipIfWindows
42
+ def test_mixing_relative_and_abs (self ):
43
+ self .build ()
44
+
45
+ lldbutil .run_to_source_breakpoint (self ,
46
+ "// Set break point at this line." , lldb .SBFileSpec ("main.cpp" ))
47
+
48
+ # The function associated with each frame index can change depending
49
+ # on the function calling main (e.g. `start`), so this only tests that
50
+ # the frame index number is correct. We test the actual functions
51
+ # in the relative test.
52
+
53
+ # Jump to the top of the stack.
54
+ self .expect ("frame select 0" , substrs = ["frame #0" ])
55
+
56
+ # Run some relative commands.
57
+ self .expect ("up" , substrs = ["frame #1" ])
58
+ self .expect ("frame select -r 1" , substrs = ["frame #2" ])
59
+ self .expect ("frame select -r -1" , substrs = ["frame #1" ])
60
+
61
+ # Test that absolute indices still work.
62
+ self .expect ("frame select 2" , substrs = ["frame #2" ])
63
+ self .expect ("frame select 1" , substrs = ["frame #1" ])
64
+ self .expect ("frame select 3" , substrs = ["frame #3" ])
65
+ self .expect ("frame select 0" , substrs = ["frame #0" ])
66
+ self .expect ("frame select 1" , substrs = ["frame #1" ])
67
+
68
+ # Run some other relative frame select commands.
69
+ self .expect ("down" , substrs = ["frame #0" ])
70
+ self .expect ("frame select -r 1" , substrs = ["frame #1" ])
71
+ self .expect ("frame select -r -1" , substrs = ["frame #0" ])
72
+
73
+ # Test that absolute indices still work.
74
+ self .expect ("frame select 2" , substrs = ["frame #2" ])
75
+ self .expect ("frame select 1" , substrs = ["frame #1" ])
76
+ self .expect ("frame select 3" , substrs = ["frame #3" ])
77
+ self .expect ("frame select 0" , substrs = ["frame #0" ])
0 commit comments