Lines Matching full:pdb
1 # A test suite for pdb; not very comprehensive at the moment.
5 import pdb
17 # This little helper class is essential for testing pdb under doctest.
23 """Context manager that makes testing Pdb in doctests easier."""
40 """This tests the custom displayhook for pdb.
43 ... import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
55 (Pdb) foo
57 (Pdb) bar
58 (Pdb) for i in range(5): print(i)
64 (Pdb) continue
69 """Test the basic commands of pdb.
89 ... import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
122 (Pdb) step
126 (Pdb) args
129 (Pdb) list
141 (Pdb) bt
149 (Pdb) up
152 (Pdb) down
155 (Pdb) next
158 (Pdb) next
162 (Pdb) step
165 (Pdb) until
173 (Pdb) next
177 (Pdb) jump 8
180 (Pdb) return
186 (Pdb) retval
188 (Pdb) next
191 (Pdb) step
195 (Pdb) args
198 (Pdb) return
202 (Pdb) next
205 (Pdb) step
209 (Pdb) args
213 (Pdb) continue
225 ... import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
268 (Pdb) break 3
270 (Pdb) disable 1
272 (Pdb) ignore 1 10
274 (Pdb) condition 1 1 < 2
276 (Pdb) break 4
278 (Pdb) break 4
280 (Pdb) break
287 (Pdb) clear 3
289 (Pdb) break
295 (Pdb) condition 1
297 (Pdb) enable 1
299 (Pdb) clear 1
301 (Pdb) commands 2
305 (Pdb) continue
311 (Pdb) clear
314 (Pdb) tbreak 5
316 (Pdb) continue
321 (Pdb) break
322 (Pdb) continue
338 ... pdb.run('print()')
340 (Pdb) import test.test_pdb
341 (Pdb) break test.test_pdb.do_something
343 (Pdb) break test.test_pdb.do_nothing
345 (Pdb) break
349 (Pdb) continue
353 ... 'break pdb.find_function',
358 ... pdb.run('print()')
360 (Pdb) break
364 (Pdb) break pdb.find_function
365 Breakpoint 3 at ...pdb.py:94
366 (Pdb) break
370 3 breakpoint keep yes at ...pdb.py:...
371 (Pdb) clear 1
373 (Pdb) continue
381 ... pdb.run('print()')
383 (Pdb) break
386 3 breakpoint keep yes at ...pdb.py:...
387 (Pdb) clear 2
389 (Pdb) clear 3
390 Deleted breakpoint 3 at ...pdb.py:...
391 (Pdb) continue
403 ... import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
413 -> import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
414 (Pdb) p obj
416 (Pdb) pp obj
418 (Pdb) continue
429 """Test the list and source commands of pdb.
448 ... import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
469 (Pdb) list
471 2 import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
474 (Pdb) step
478 (Pdb) list
490 (Pdb) list
496 (Pdb) list 1,3
500 (Pdb) list x
502 (Pdb) next
505 (Pdb) next
508 (Pdb) step
512 (Pdb) longlist
515 (Pdb) source do_something
518 (Pdb) source fooxxx
520 (Pdb) continue
535 ... import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
549 -> import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
550 (Pdb) whatis myvar
552 (Pdb) whatis myfunc
554 (Pdb) whatis MyClass
556 (Pdb) whatis MyClass()
558 (Pdb) whatis MyClass.mymethod
560 (Pdb) whatis MyClass().mymethod
562 (Pdb) continue
575 ... import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
593 (Pdb) next
598 (Pdb) bt
606 (Pdb) list
608 2 import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
612 (Pdb) down
615 (Pdb) list
622 (Pdb) continue
632 ... import pdb; pdb.Pdb(skip=['stri*'], nosigint=True, readrc=False).set_trace()
642 (Pdb) step
646 (Pdb) continue
661 ... import pdb; pdb.Pdb(skip=['module_to_skip*'], nosigint=True, readrc=False).set_trace()
676 (Pdb) step
680 (Pdb) step
683 (Pdb) step
687 (Pdb) step
691 (Pdb) step
694 (Pdb) continue
702 ... import pdb, sys; inst = pdb.Pdb(nosigint=True, readrc=False)
721 (Pdb) next
724 (Pdb) break 7
726 (Pdb) continue
731 (Pdb) next
735 (Pdb) continue
741 """Run pdb.method(arg)."""
742 getattr(pdb.Pdb(nosigint=True, readrc=False), method)(arg)
767 (Pdb) step
770 (Pdb) x
772 (Pdb) continue
778 (Pdb) x
780 (Pdb) continue
784 """Test that pdb stops after a next/until/return issued at a return debug event.
791 ... import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
812 (Pdb) break test_function_2
814 (Pdb) continue
817 (Pdb) return
821 (Pdb) next
824 (Pdb) continue
827 (Pdb) return
831 (Pdb) until
834 (Pdb) continue
837 (Pdb) return
841 (Pdb) return
844 (Pdb) continue
856 ... import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
878 (Pdb) step
881 (Pdb) step
884 (Pdb) step
888 (Pdb) next
891 (Pdb) next
894 (Pdb) step
898 (Pdb) step
902 (Pdb) continue
917 ... import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
937 (Pdb) step
941 (Pdb) step
944 (Pdb) next
947 (Pdb) next
950 (Pdb) next
954 (Pdb) step
958 (Pdb) continue
977 ... import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
997 (Pdb) step
1001 (Pdb) step
1004 (Pdb) next
1007 (Pdb) next
1011 (Pdb) step
1015 (Pdb) next
1018 (Pdb) continue
1033 ... import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
1054 (Pdb) step
1057 (Pdb) step
1060 (Pdb) step
1064 (Pdb) return
1068 (Pdb) step
1071 (Pdb) step
1074 (Pdb) continue
1089 ... import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
1106 (Pdb) step
1110 (Pdb) step
1113 (Pdb) next
1116 (Pdb) continue
1130 ... import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
1143 (Pdb) step
1147 (Pdb) until 4
1152 (Pdb) step
1156 (Pdb) step
1159 (Pdb) continue
1180 ... import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
1196 (Pdb) step
1200 (Pdb) until 8
1206 (Pdb) continue
1219 ... import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
1234 (Pdb) break test_gen
1236 (Pdb) continue
1239 (Pdb) next
1243 (Pdb) next
1247 (Pdb) next
1250 (Pdb) continue
1265 ... import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
1279 (Pdb) step
1283 (Pdb) step
1286 (Pdb) next
1290 (Pdb) next
1294 (Pdb) next
1297 (Pdb) continue
1306 ... sess = pdb.Pdb()
1308 ... print('pdb %d: %s' % (i, sess._previous_sigint_handler))
1316 -> print('pdb %d: %s' % (i, sess._previous_sigint_handler))
1317 (Pdb) continue
1318 pdb 1: <built-in function default_int_handler>
1320 -> print('pdb %d: %s' % (i, sess._previous_sigint_handler))
1321 (Pdb) continue
1322 pdb 2: <built-in function default_int_handler>
1329 ... import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
1343 (Pdb) break 3
1345 (Pdb) clear <doctest test.test_pdb.test_pdb_issue_43318[0]>:3
1347 (Pdb) continue
1361 cmd = [sys.executable, '-m', 'pdb'] + pdb_args
1375 """Run 'script' lines with pdb and the pdb 'commands'."""
1403 expected, pdb.find_function(func_name, os_helper.TESTFN))
1454 f.write(b'print("testing my pdb")\r\n')
1455 cmd = [sys.executable, '-m', 'pdb', os_helper.TESTFN]
1464 "Got a syntax error running test script under PDB")
1473 import pdb
1474 pdb.Pdb.do_testcmdwithnodocs = do_testcmdwithnodocs
1530 import pdb
1533 pdb.Pdb(readrc=False).set_trace()
1549 "Got an error running test script under PDB")
1556 import pdb
1562 pdb.Pdb(readrc=False).set_trace()
1566 pdb.Pdb(readrc=False).set_trace()
1579 "Got an error running test script under PDB")
1593 # run command of pdb prompt echoes the correct args
1608 import pdb; pdb.Pdb(readrc=False).set_trace()
1646 self.assertEqual(pdb.Pdb().rcLines[0], "invalid")
1656 resources.enter_context(patch.object(pdb.Pdb, 'set_trace'))
1657 pdb.set_trace(header=header)
1701 stdout, stderr = self._run_pdb(["-m", "pdb"], commands)
1703 pdb._usage,
1825 '(Pdb) *** SyntaxError: \'(\' was never closed',
1827 '(Pdb) ENTERING RECURSIVE DEBUGGER',
1831 '(Pdb) ENTERING RECURSIVE DEBUGGER',
1833 "((Pdb)) *** NameError: name 'doesnotexist' is not defined",
1835 '(Pdb) ',
1848 f'(Pdb) *** Cannot run {bad_arg}: {msg}',
1849 '(Pdb) ',
1855 …'''When running `python foo.py` sys.path[0] is an absolute path. `python -m pdb foo.py` should beh…
1863 expected = f'(Pdb) sys.path[0] is {os.path.realpath(cwd)}'
1871 …'''When running `python foo.py` sys.path[0] resolves symlinks. `python -m pdb foo.py` should behav…
1882 expected = f'(Pdb) sys.path[0] is {dir_one}'
1914 expected = '(Pdb) The correct file was executed'
1920 linecache.clearcache() # Pdb.checkline() uses linecache.getline()
1928 db = pdb.Pdb()
1934 db = pdb.Pdb()
1950 db = pdb.Pdb()