Skip to content

Commit

Permalink
Propagate SIGTRAP to client during diversion
Browse files Browse the repository at this point in the history
Changes DiversionSession to propagate a SIGTRAP received by the target
process to the client, as a signal, when it was not produced by a
debugger breakpoint, a singlestep operation or a watchpoint.
  • Loading branch information
aarzilli committed Nov 20, 2020
1 parent 6658bdd commit 022902b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/DiversionSession.cc
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@ DiversionSession::DiversionResult DiversionSession::diversion_step(
if (t->stop_sig()) {
LOG(debug) << "Pending signal: " << t->get_siginfo();
result.break_status = diagnose_debugger_trap(t, command);
if (!result.break_status.breakpoint_hit && result.break_status.watchpoints_hit.empty() && !result.break_status.singlestep_complete && (t->stop_sig() == SIGTRAP)) {
result.break_status.signal = unique_ptr<siginfo_t>(new siginfo_t(t->get_siginfo()));
result.break_status.signal->si_signo = t->stop_sig();
}
LOG(debug) << "Diversion break at ip=" << (void*)t->ip().register_value()
<< "; break=" << result.break_status.breakpoint_hit
<< ", watch=" << !result.break_status.watchpoints_hit.empty()
Expand Down

0 comments on commit 022902b

Please sign in to comment.