@@ -35,40 +35,42 @@ def test_basic_command(self):
3535 bt = self .get_stack_trace (script = SAMPLE_SCRIPT ,
3636 cmds_after_breakpoint = ['py-list' ])
3737
38- self .assertListing (' 5 \n '
39- ' 6 def bar(a, b, c):\n '
40- ' 7 baz(a, b, c)\n '
41- ' 8 \n '
42- ' 9 def baz(*args):\n '
43- ' >10 id (42)\n '
44- ' 11 \n '
45- ' 12 foo(1, 2, 3)\n ' ,
38+ self .assertListing (' 6 \n '
39+ ' 7 def bar(a, b, c):\n '
40+ ' 8 baz(a, b, c)\n '
41+ ' 9 \n '
42+ ' 10 def baz(*args):\n '
43+ ' >11 _idfunc (42)\n '
44+ ' 12 \n '
45+ ' 13 foo(1, 2, 3)\n ' ,
4646 bt )
4747
4848 def test_one_abs_arg (self ):
4949 'Verify the "py-list" command with one absolute argument'
5050 bt = self .get_stack_trace (script = SAMPLE_SCRIPT ,
5151 cmds_after_breakpoint = ['py-list 9' ])
5252
53- self .assertListing (' 9 def baz(*args):\n '
54- ' >10 id (42)\n '
55- ' 11 \n '
56- ' 12 foo(1, 2, 3)\n ' ,
53+ self .assertListing (' 10 def baz(*args):\n '
54+ ' >11 _idfunc (42)\n '
55+ ' 12 \n '
56+ ' 13 foo(1, 2, 3)\n ' ,
5757 bt )
5858
5959 def test_two_abs_args (self ):
6060 'Verify the "py-list" command with two absolute arguments'
6161 bt = self .get_stack_trace (script = SAMPLE_SCRIPT ,
62- cmds_after_breakpoint = ['py-list 1,3 ' ])
62+ cmds_after_breakpoint = ['py-list 1,4 ' ])
6363
6464 self .assertListing (' 1 # Sample script for use by test_gdb\n '
65- ' 2 \n '
66- ' 3 def foo(a, b, c):\n ' ,
65+ ' 2 from _typing import _idfunc\n '
66+ ' 3 \n '
67+ ' 4 def foo(a, b, c):\n ' ,
6768 bt )
6869
6970SAMPLE_WITH_C_CALL = """
7071
7172from _testcapi import pyobject_vectorcall
73+ from _typing import _idfunc
7274
7375def foo(a, b, c):
7476 bar(a, b, c)
@@ -77,7 +79,7 @@ def bar(a, b, c):
7779 pyobject_vectorcall(baz, (a, b, c), None)
7880
7981def baz(*args):
80- id (42)
82+ _idfunc (42)
8183
8284foo(1, 2, 3)
8385
@@ -94,7 +96,7 @@ def test_pyup_command(self):
9496 cmds_after_breakpoint = ['py-up' , 'py-up' ])
9597 self .assertMultilineMatches (bt ,
9698 r'''^.*
97- #[0-9]+ Frame 0x-?[0-9a-f]+, for file <string>, line 12 , in baz \(args=\(1, 2, 3\)\)
99+ #[0-9]+ Frame 0x-?[0-9a-f]+, for file <string>, line 13 , in baz \(args=\(1, 2, 3\)\)
98100#[0-9]+ <built-in method pyobject_vectorcall of module object at remote 0x[0-9a-f]+>
99101$''' )
100102
@@ -123,9 +125,9 @@ def test_up_then_down(self):
123125 cmds_after_breakpoint = ['py-up' , 'py-up' , 'py-down' ])
124126 self .assertMultilineMatches (bt ,
125127 r'''^.*
126- #[0-9]+ Frame 0x-?[0-9a-f]+, for file <string>, line 12 , in baz \(args=\(1, 2, 3\)\)
128+ #[0-9]+ Frame 0x-?[0-9a-f]+, for file <string>, line 13 , in baz \(args=\(1, 2, 3\)\)
127129#[0-9]+ <built-in method pyobject_vectorcall of module object at remote 0x[0-9a-f]+>
128- #[0-9]+ Frame 0x-?[0-9a-f]+, for file <string>, line 12 , in baz \(args=\(1, 2, 3\)\)
130+ #[0-9]+ Frame 0x-?[0-9a-f]+, for file <string>, line 13 , in baz \(args=\(1, 2, 3\)\)
129131$''' )
130132
131133class PyPrintTests (DebuggerTests ):
0 commit comments