MCPcopy Create free account
hub / github.com/MJx0/KittyMemoryEx / stop

Method stop

KittyMemoryEx/KittyTrace.cpp:106–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104}
105
106bool KittyTraceMgr::stop()
107{
108 if (!_attached || _pid <= 0)
109 return false;
110
111 errno = 0;
112
113 if (_seized)
114 {
115 if (ptrace(PTRACE_INTERRUPT, _pid, nullptr, nullptr) == -1L)
116 {
117 KITTY_LOGE("PTRACE_INTERRUPT failed for pid %d. \"%s\".", _pid, strerror(errno));
118 return false;
119 }
120 }
121 else
122 {
123 if (tgkill(_pid, _pid, SIGSTOP) == -1)
124 {
125 KITTY_LOGE("tgkill failed for pid %d. \"%s\".", _pid, strerror(errno));
126 return false;
127 }
128 }
129
130 int status;
131 if (waitpid(_pid, &status, 0) != _pid || !WIFSTOPPED(status))
132 {
133 KITTY_LOGE("Error occurred while waiting for pid %d to stop. \"%s\".", _pid, strerror(errno));
134 return false;
135 }
136
137 return true;
138}
139
140bool KittyTraceMgr::cont(int sig)
141{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected