@@ -35,40 +35,42 @@ def test_basic_command(self):
35
35
bt = self .get_stack_trace (script = SAMPLE_SCRIPT ,
36
36
cmds_after_breakpoint = ['py-list' ])
37
37
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 ' ,
46
46
bt )
47
47
48
48
def test_one_abs_arg (self ):
49
49
'Verify the "py-list" command with one absolute argument'
50
50
bt = self .get_stack_trace (script = SAMPLE_SCRIPT ,
51
51
cmds_after_breakpoint = ['py-list 9' ])
52
52
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 ' ,
57
57
bt )
58
58
59
59
def test_two_abs_args (self ):
60
60
'Verify the "py-list" command with two absolute arguments'
61
61
bt = self .get_stack_trace (script = SAMPLE_SCRIPT ,
62
- cmds_after_breakpoint = ['py-list 1,3 ' ])
62
+ cmds_after_breakpoint = ['py-list 1,4 ' ])
63
63
64
64
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 ' ,
67
68
bt )
68
69
69
70
SAMPLE_WITH_C_CALL = """
70
71
71
72
from _testcapi import pyobject_vectorcall
73
+ from _typing import _idfunc
72
74
73
75
def foo(a, b, c):
74
76
bar(a, b, c)
@@ -77,7 +79,7 @@ def bar(a, b, c):
77
79
pyobject_vectorcall(baz, (a, b, c), None)
78
80
79
81
def baz(*args):
80
- id (42)
82
+ _idfunc (42)
81
83
82
84
foo(1, 2, 3)
83
85
@@ -94,7 +96,7 @@ def test_pyup_command(self):
94
96
cmds_after_breakpoint = ['py-up' , 'py-up' ])
95
97
self .assertMultilineMatches (bt ,
96
98
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\)\)
98
100
#[0-9]+ <built-in method pyobject_vectorcall of module object at remote 0x[0-9a-f]+>
99
101
$''' )
100
102
@@ -123,9 +125,9 @@ def test_up_then_down(self):
123
125
cmds_after_breakpoint = ['py-up' , 'py-up' , 'py-down' ])
124
126
self .assertMultilineMatches (bt ,
125
127
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\)\)
127
129
#[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\)\)
129
131
$''' )
130
132
131
133
class PyPrintTests (DebuggerTests ):
0 commit comments