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

Method getRegs

KittyMemoryEx/KittyTrace.cpp:250–272  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

248}
249
250bool KittyTraceMgr::getRegs(user_regs_struct *regs) const
251{
252 if (!_attached || _pid <= 0 || !regs)
253 return false;
254
255 errno = 0;
256
257#if defined(__LP64__)
258 iovec ioVec;
259 ioVec.iov_base = regs;
260 ioVec.iov_len = sizeof(*regs);
261 long ret = ptrace(KT_PTRACE_GETREG_REQ, _pid, NT_PRSTATUS, &ioVec);
262#else
263 long ret = ptrace(KT_PTRACE_GETREG_REQ, _pid, nullptr, regs);
264#endif
265 if (ret == -1L)
266 {
267 KITTY_LOGE("PTRACE_GETREGS failed for pid %d. \"%s\".", _pid, strerror(errno));
268 return false;
269 }
270
271 return true;
272}
273
274bool KittyTraceMgr::setRegs(user_regs_struct *regs) const
275{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected