@@ -679,7 +679,7 @@ class StackNavigationTests(DebuggerTests):
679
679
def test_pyup_command (self ):
680
680
'Verify that the "py-up" command works'
681
681
bt = self .get_stack_trace (script = self .get_sample_script (),
682
- cmds_after_breakpoint = ['py-up' ])
682
+ cmds_after_breakpoint = ['py-up' , 'py-up' ])
683
683
self .assertMultilineMatches (bt ,
684
684
r'''^.*
685
685
#[0-9]+ Frame 0x-?[0-9a-f]+, for file .*gdb_sample.py, line 7, in bar \(a=1, b=2, c=3\)
@@ -698,7 +698,7 @@ def test_down_at_bottom(self):
698
698
def test_up_at_top (self ):
699
699
'Verify handling of "py-up" at the top of the stack'
700
700
bt = self .get_stack_trace (script = self .get_sample_script (),
701
- cmds_after_breakpoint = ['py-up' ] * 4 )
701
+ cmds_after_breakpoint = ['py-up' ] * 5 )
702
702
self .assertEndsWith (bt ,
703
703
'Unable to find an older python frame\n ' )
704
704
@@ -708,7 +708,7 @@ def test_up_at_top(self):
708
708
def test_up_then_down (self ):
709
709
'Verify "py-up" followed by "py-down"'
710
710
bt = self .get_stack_trace (script = self .get_sample_script (),
711
- cmds_after_breakpoint = ['py-up' , 'py-down' ])
711
+ cmds_after_breakpoint = ['py-up' , 'py-up' , 'py- down' ])
712
712
self .assertMultilineMatches (bt ,
713
713
r'''^.*
714
714
#[0-9]+ Frame 0x-?[0-9a-f]+, for file .*gdb_sample.py, line 7, in bar \(a=1, b=2, c=3\)
@@ -727,6 +727,7 @@ def test_bt(self):
727
727
self .assertMultilineMatches (bt ,
728
728
r'''^.*
729
729
Traceback \(most recent call first\):
730
+ <built-in method id of module object .*>
730
731
File ".*gdb_sample.py", line 10, in baz
731
732
id\(42\)
732
733
File ".*gdb_sample.py", line 7, in bar
@@ -815,7 +816,6 @@ def test_gc(self):
815
816
)
816
817
self .assertIn ('Garbage-collecting' , gdb_output )
817
818
818
- @unittest .skip ("FIXME: builtin method is not shown in py-bt and py-bt-full" )
819
819
@unittest .skipIf (python_is_optimized (),
820
820
"Python was compiled with optimizations" )
821
821
# Some older versions of gdb will fail with
@@ -854,7 +854,7 @@ class PyPrintTests(DebuggerTests):
854
854
def test_basic_command (self ):
855
855
'Verify that the "py-print" command works'
856
856
bt = self .get_stack_trace (script = self .get_sample_script (),
857
- cmds_after_breakpoint = ['py-print args' ])
857
+ cmds_after_breakpoint = ['py-up' , 'py- print args' ])
858
858
self .assertMultilineMatches (bt ,
859
859
r".*\nlocal 'args' = \(1, 2, 3\)\n.*" )
860
860
@@ -863,23 +863,23 @@ def test_basic_command(self):
863
863
@unittest .skipUnless (HAS_PYUP_PYDOWN , "test requires py-up/py-down commands" )
864
864
def test_print_after_up (self ):
865
865
bt = self .get_stack_trace (script = self .get_sample_script (),
866
- cmds_after_breakpoint = ['py-up' , 'py-print c' , 'py-print b' , 'py-print a' ])
866
+ cmds_after_breakpoint = ['py-up' , 'py-up' , 'py- print c' , 'py-print b' , 'py-print a' ])
867
867
self .assertMultilineMatches (bt ,
868
868
r".*\nlocal 'c' = 3\nlocal 'b' = 2\nlocal 'a' = 1\n.*" )
869
869
870
870
@unittest .skipIf (python_is_optimized (),
871
871
"Python was compiled with optimizations" )
872
872
def test_printing_global (self ):
873
873
bt = self .get_stack_trace (script = self .get_sample_script (),
874
- cmds_after_breakpoint = ['py-print __name__' ])
874
+ cmds_after_breakpoint = ['py-up' , 'py- print __name__' ])
875
875
self .assertMultilineMatches (bt ,
876
876
r".*\nglobal '__name__' = '__main__'\n.*" )
877
877
878
878
@unittest .skipIf (python_is_optimized (),
879
879
"Python was compiled with optimizations" )
880
880
def test_printing_builtin (self ):
881
881
bt = self .get_stack_trace (script = self .get_sample_script (),
882
- cmds_after_breakpoint = ['py-print len' ])
882
+ cmds_after_breakpoint = ['py-up' , 'py- print len' ])
883
883
self .assertMultilineMatches (bt ,
884
884
r".*\nbuiltin 'len' = <built-in method len of module object at remote 0x-?[0-9a-f]+>\n.*" )
885
885
@@ -888,7 +888,7 @@ class PyLocalsTests(DebuggerTests):
888
888
"Python was compiled with optimizations" )
889
889
def test_basic_command (self ):
890
890
bt = self .get_stack_trace (script = self .get_sample_script (),
891
- cmds_after_breakpoint = ['py-locals' ])
891
+ cmds_after_breakpoint = ['py-up' , 'py- locals' ])
892
892
self .assertMultilineMatches (bt ,
893
893
r".*\nargs = \(1, 2, 3\)\n.*" )
894
894
@@ -897,7 +897,7 @@ def test_basic_command(self):
897
897
"Python was compiled with optimizations" )
898
898
def test_locals_after_up (self ):
899
899
bt = self .get_stack_trace (script = self .get_sample_script (),
900
- cmds_after_breakpoint = ['py-up' , 'py-locals' ])
900
+ cmds_after_breakpoint = ['py-up' , 'py-up' , 'py- locals' ])
901
901
self .assertMultilineMatches (bt ,
902
902
r".*\na = 1\nb = 2\nc = 3\n.*" )
903
903
0 commit comments