Commit c630fe56 authored by Chu's avatar Chu

check for attached

parent e5c070e5
......@@ -69,6 +69,7 @@ void Process::attach()
void Process::detach()
{
check_for_attached();
if (ptrace(PTRACE_DETACH, pid_, nullptr, nullptr) == -1)
throw std::runtime_error(std::strerror(errno));
wait(nullptr);
......@@ -164,6 +165,7 @@ void Process::check_for_attached()
void Process::continue_and_wait_for_trap()
{
check_for_attached();
if (ptrace(PTRACE_CONT, pid_, nullptr, nullptr) == -1)
throw std::runtime_error(std::strerror(errno));
int status;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment