Unnamed Fossil Project

Check-in [d786060953]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Provide hook so environment can hold off threads while we're in a debugging session.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:d786060953deca9f94890221812fb39aafcb2f5929651807a7a7179f8a7711e0
User & Date: vandys 2018-12-07 22:21:29
Context
2019-04-10
13:55
Make readline available in sub-debug if it's available at the top level. Leaf check-in: d5db276631 user: vandys tags: trunk
2018-12-07
22:21
Provide hook so environment can hold off threads while we're in a debugging session. check-in: d786060953 user: vandys tags: trunk
2018-11-20
01:07
"fs extras" clean check-in: 71a5c376c1 user: vandys tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to pdb.py.

1
2
3
4
5
6
7

8
9
10
11
12
13
14
..
15
16
17
18
19
20
21












22
23
24
25
26
27
28
#! /usr/bin/env python

"""A Python debugger."""

# (See pdb.doc for documentation.)

import sys

import linecache
import cmd
import bdb
from repr import Repr
import os
import re
import pprint
................................................................................
import traceback
import threading

# Coordinate who's talking with the user
# Thread -> (Pdb instance, state, paused-mutex)
Jobs = {}
Jobnum = 0













class Restart(Exception):
    """Causes a debugger to be restarted for the debugged python program."""
    pass

# Create a custom safe Repr instance and increase its maxstring.
# The default of 30 truncates error messages too easily.







>







 







>
>
>
>
>
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
..
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#! /usr/bin/env python

"""A Python debugger."""

# (See pdb.doc for documentation.)

import sys
import time
import linecache
import cmd
import bdb
from repr import Repr
import os
import re
import pprint
................................................................................
import traceback
import threading

# Coordinate who's talking with the user
# Thread -> (Pdb instance, state, paused-mutex)
Jobs = {}
Jobnum = 0

# Convenience hook
# Call this to be quiesced until all debugging jobs
#  are finished
QWaiters = 0
def defer_quiesce():
    global Jobs, QWaiters

    while Jobs:
	QWaiters += 1
	time.sleep(1)
	QWaiters -= 1

class Restart(Exception):
    """Causes a debugger to be restarted for the debugged python program."""
    pass

# Create a custom safe Repr instance and increase its maxstring.
# The default of 30 truncates error messages too easily.