aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2025-09-03 11:26:28 -0600
committerTom Tromey <tromey@adacore.com>2025-09-26 09:29:14 -0600
commitefdb47cc20cd335706e7547c8bc41b65a99ff341 (patch)
tree1351ffc49e3b5ecb3e3f61554756228accc11063 /gdb/python
parentecac42af735c3fa6abe49ec7cf9ebcd34096b2ac (diff)
downloadbinutils-efdb47cc20cd335706e7547c8bc41b65a99ff341.zip
binutils-efdb47cc20cd335706e7547c8bc41b65a99ff341.tar.gz
binutils-efdb47cc20cd335706e7547c8bc41b65a99ff341.tar.bz2
Use exec_and_log in next.py
Some code in next.py avoids exec_and_log due to its exception behavior. Now that exec_and_log always forwards exceptions, this is easily fixed.
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/lib/gdb/dap/next.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/gdb/python/lib/gdb/dap/next.py b/gdb/python/lib/gdb/dap/next.py
index a0fa18e..993e9d2 100644
--- a/gdb/python/lib/gdb/dap/next.py
+++ b/gdb/python/lib/gdb/dap/next.py
@@ -17,7 +17,7 @@ import gdb
from .events import exec_and_expect_stop
from .server import capability, request
-from .startup import in_gdb_thread
+from .startup import DAPException, exec_and_log, in_gdb_thread
from .state import set_thread
@@ -36,11 +36,9 @@ def _handle_thread_step(thread_id, single_thread, select=False):
result = False
arg = "off"
try:
- # This can fail, depending on the target, so catch the error
- # and report to our caller. We can't use exec_and_log because
- # that does not propagate exceptions.
- gdb.execute("set scheduler-locking " + arg, from_tty=True, to_string=True)
- except gdb.error:
+ # This can fail, depending on the target, so catch any error.
+ exec_and_log("set scheduler-locking " + arg)
+ except DAPException:
result = False
# Other DAP code may select a frame, and the "finish" command uses
# the selected frame.