Skip to content

Commit b8a0503

Browse files
committed
Improve the error message when we can't find the requested thread
1 parent 0dd7797 commit b8a0503

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

Python/remote_debugging.c

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -835,6 +835,13 @@ send_exec_to_proc_handle(proc_handle_t *handle, int tid, const char *debugger_sc
835835
return -1;
836836
}
837837
}
838+
839+
if (thread_state_addr == 0) {
840+
PyErr_SetString(
841+
PyExc_RuntimeError,
842+
"Can't find the specified thread in the remote process");
843+
return -1;
844+
}
838845
} else {
839846
if (0 != read_memory(
840847
handle,
@@ -844,11 +851,13 @@ send_exec_to_proc_handle(proc_handle_t *handle, int tid, const char *debugger_sc
844851
{
845852
return -1;
846853
}
847-
}
848854

849-
if (thread_state_addr == 0) {
850-
PyErr_SetString(PyExc_RuntimeError, "No thread state found");
851-
return -1;
855+
if (thread_state_addr == 0) {
856+
PyErr_SetString(
857+
PyExc_RuntimeError,
858+
"Can't find the main thread in the remote process");
859+
return -1;
860+
}
852861
}
853862

854863
uintptr_t eval_breaker;

0 commit comments

Comments
 (0)