diff options
author | Tom Tromey <tromey@adacore.com> | 2024-01-23 10:25:33 -0700 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2024-02-12 10:42:21 -0700 |
commit | 95fc420a40ebcbd510b41df77b93b11ec819f0a1 (patch) | |
tree | 9a7fe3bec7cc13c4af9845064a52ca6c12805304 /gdb/python | |
parent | eed5f59c8c7630787196f09d612456e877ffca65 (diff) | |
download | gdb-95fc420a40ebcbd510b41df77b93b11ec819f0a1.zip gdb-95fc420a40ebcbd510b41df77b93b11ec819f0a1.tar.gz gdb-95fc420a40ebcbd510b41df77b93b11ec819f0a1.tar.bz2 |
Clean up suppress_new_breakpoint_event
Kévin pointed out that suppress_new_breakpoint_event would do the
wrong thing if it happened to be used reentrantly. While I don't
think this can happen, it's also easy and clearly better to make it
robust.
Diffstat (limited to 'gdb/python')
-rw-r--r-- | gdb/python/lib/gdb/dap/breakpoint.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/python/lib/gdb/dap/breakpoint.py b/gdb/python/lib/gdb/dap/breakpoint.py index 9cbd7ae..87e7464 100644 --- a/gdb/python/lib/gdb/dap/breakpoint.py +++ b/gdb/python/lib/gdb/dap/breakpoint.py @@ -47,11 +47,12 @@ _suppress_bp = False def suppress_new_breakpoint_event(): """Return a new context manager that suppresses new breakpoint events.""" global _suppress_bp + saved = _suppress_bp _suppress_bp = True try: yield None finally: - _suppress_bp = False + _suppress_bp = saved @in_gdb_thread |