| 225 | } |
| 226 | |
| 227 | bool 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 | |
| 250 | bool KittyTraceMgr::getRegs(user_regs_struct *regs) const |
| 251 | { |
nothing calls this directly
no outgoing calls
no test coverage detected