@@ -4260,13 +4260,22 @@ def _create_fake_frozen_module():
4260
4260
mod = _create_fake_frozen_module()
4261
4261
mod.func()
4262
4262
"""
4263
- commands = """
4263
+ commands_list = """
4264
4264
break 20
4265
4265
continue
4266
4266
step
4267
+ break 4
4267
4268
list
4268
4269
quit
4269
4270
"""
4271
+ commands_longlist = """
4272
+ break 20
4273
+ continue
4274
+ step
4275
+ break 4
4276
+ longlist
4277
+ quit
4278
+ """
4270
4279
with open ('gh93696.py' , 'w' ) as f :
4271
4280
f .write (textwrap .dedent (frozen_src ))
4272
4281
@@ -4275,9 +4284,18 @@ def _create_fake_frozen_module():
4275
4284
4276
4285
self .addCleanup (os_helper .unlink , 'gh93696.py' )
4277
4286
self .addCleanup (os_helper .unlink , 'gh93696_host.py' )
4278
- stdout , stderr = self ._run_pdb (["gh93696_host.py" ], commands )
4279
- # verify that pdb found the source of the "frozen" function
4287
+
4288
+ # verify that pdb found the source of the "frozen" function and it
4289
+ # shows the breakpoint at the correct line for both list and longlist
4290
+ stdout , _ = self ._run_pdb (["gh93696_host.py" ], commands_list )
4291
+ self .assertIn ('x = "Sentinel string for gh-93696"' , stdout , "Sentinel statement not found" )
4292
+ self .assertIn ('4 B' , stdout , "breakpoint not found" )
4293
+ self .assertIn ('-> def func():' , stdout , "stack entry not found" )
4294
+
4295
+ stdout , _ = self ._run_pdb (["gh93696_host.py" ], commands_longlist )
4280
4296
self .assertIn ('x = "Sentinel string for gh-93696"' , stdout , "Sentinel statement not found" )
4297
+ self .assertIn ('4 B' , stdout , "breakpoint not found" )
4298
+ self .assertIn ('-> def func():' , stdout , "stack entry not found" )
4281
4299
4282
4300
def test_empty_file (self ):
4283
4301
script = ''
0 commit comments