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

Method step

KittyMemoryEx/KittyTrace.cpp:201–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199}
200
201bool KittyTraceMgr::step(int steps) const
202{
203 if (!_attached || _pid <= 0)
204 return false;
205
206 int status = 0;
207 for (int i = 0; i < steps; ++i)
208 {
209 errno = 0;
210 if (ptrace(PTRACE_SINGLESTEP, _pid, nullptr, nullptr) == -1L)
211 {
212 KITTY_LOGE("PTRACE_SINGLESTEP failed for pid %d. \"%s\".", _pid, strerror(errno));
213 return false;
214 }
215
216 if ((i + 1) < steps)
217 {
218 waitpid(_pid, &status, 0);
219 if (!WIFSTOPPED(status))
220 return false;
221 }
222 }
223
224 return true;
225}
226
227bool KittyTraceMgr::waitStep(int steps) const
228{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected