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

Method waitStep

KittyMemoryEx/KittyTrace.cpp:227–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225}
226
227bool KittyTraceMgr::waitStep(int steps) const
228{
229 if (!_attached || _pid <= 0)
230 return false;
231
232 int status = 0;
233 for (int i = 0; i < steps; ++i)
234 {
235 errno = 0;
236 if (ptrace(PTRACE_SINGLESTEP, _pid, nullptr, nullptr) == -1L)
237 {
238 KITTY_LOGE("PTRACE_SINGLESTEP failed for pid %d. \"%s\".", _pid, strerror(errno));
239 return false;
240 }
241
242 waitpid(_pid, &status, 0);
243 if (!WIFSTOPPED(status))
244 return false;
245 }
246
247 return true;
248}
249
250bool KittyTraceMgr::getRegs(user_regs_struct *regs) const
251{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected