Skip to content

Commit

Permalink
mach-engine: Rudimentary support for crashing applications
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonKagstrom committed Apr 24, 2024
1 parent cbc903b commit ce4a8a1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/engines/mach-engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,17 @@ class MachEngine : public IEngine
mach_exception_data_t codes,
mach_msg_type_number_t num_codes)
{
kcov_debug(BP_MSG, "Mach exception 0x%x, 0x%llx\n", exception_type, codes[0]);
if (exception_type == EXC_SOFTWARE && codes[0] == EXC_SOFT_SIGNAL)
{
// Forward signals
ptrace(PT_THUPDATE, m_pid, (caddr_t)(uintptr_t)thread_port, codes[1]);
}
else if (exception_type == EXC_BAD_ACCESS)
{
m_listener->onEvent(IEngine::Event(ev_signal, codes[0], 0));
return KERN_ABORTED;
}
else if (exception_type == EXC_BREAKPOINT)
{
uint64_t regs[128];
Expand Down

0 comments on commit ce4a8a1

Please sign in to comment.