Skip to content

Commit

Permalink
switch fatal error signal from T06 to S05
Browse files Browse the repository at this point in the history
With the old signal, the first thing a GDB client would do post-mortem
is to send a resume-with-signal, which gdbstub doesn't currently
support.

This _could_ be suppressed by having users set `handle all nopass`, but
that's pretty no-beuno.

By simply reporting a standard TRAP signal, the GDB client won't do
anything too fancy, and users won't enounter the unfortunate
"ResumeWithSignalNotImplemented" error for no reason.
  • Loading branch information
daniel5151 committed Oct 11, 2020
1 parent 22f6b0a commit da716bd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/gdbstub_impl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,12 @@ impl<T: Target, C: Connection> GdbStubImpl<T, C> {
None
}
Err(Error::TargetError(e)) => {
// unlike all other errors, which are "unrecoverable", there's a chance
// that a target may be able to recover from a target-specific error. In
// this case, we may as well report a SIGABRT stop reason, giving the
// target a chance to open a "post-mortem" GDB session.
// unlike all other errors which are "unrecoverable" in the sense that
// the GDB session cannot continue, there's still a chance that a target
// might want to keep the debugging session alive to do a "post-mortem"
// analysis. As such, we simply report a standard TRAP stop reason.
let mut res = ResponseWriter::new(conn);
res.write_str("T06")?; // SIGABRT
res.write_str("S05")?;
res.flush()?;
return Err(Error::TargetError(e));
}
Expand Down

0 comments on commit da716bd

Please sign in to comment.