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
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.