Skip to content

Commit 1b7a5fe

Browse files
committed
Improve error msg in DNBProcessAttach if we can't stop inferior
When we attach to a process, we task_for_pid(), ptrace(), and then we try to halt execution of the process and time out after thirty seconds if we cannot interrupt it. At this point, we must assume we have no control of the inferior process and the attach has failed. The error message we return currently is "operation timed out"; this change improves on that error message to make it more clear what is going on. Thanks to Jim for pointing this out. rdar://101152233 (cherry picked from commit 71548de)
1 parent 06da450 commit 1b7a5fe

File tree

1 file changed

+3
-1
lines changed
  • lldb/tools/debugserver/source

1 file changed

+3
-1
lines changed

lldb/tools/debugserver/source/DNB.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,9 @@ nub_process_t DNBProcessAttach(nub_process_t attach_pid,
521521

522522
if (set_events == 0) {
523523
if (err_str && err_len > 0)
524-
snprintf(err_str, err_len, "operation timed out");
524+
snprintf(err_str, err_len,
525+
"attached to process, but could not pause execution; attach "
526+
"failed");
525527
pid = INVALID_NUB_PROCESS;
526528
} else {
527529
if (set_events & (eEventProcessRunningStateChanged |

0 commit comments

Comments
 (0)