[PATCH 0/4] gdb/remote: spot stop packets sent for the wrong thread

Andrew Burgess andrew.burgess@embecosm.com
Wed Jun 9 20:06:13 GMT 2021


This isn't a fix for bug gdb/26819, rather, it's an extension to GDB
to hopefully catch the bad packet from the remote before it triggers
an assertion GDB.

Currently it still leaves GDB in a broken state (i.e. unable to
interact with any threads, see patch #4 for more detail), but it at
least gives an error that hint to the user that the problem is the
remote, and stops GDB from falling over with an assertion, which
(understandably) makes it look like GDB is at fault.

I'd love suggestions for how to improve patch #4, so any feedback is
welcome.

Thanks,
Andrew

---

Andrew Burgess (4):
  gdb/remote: Use true/false instead of 1/0
  gdb/remote: better management of remote_state::starting_up flag
  gdb/remote: use remote_add_thread from extended_remote_target::attach
  gdb/remote: error if a stop arrives for a non-resumed thread

 gdb/ChangeLog | 23 +++++++++++++++++++++
 gdb/remote.c  | 56 ++++++++++++++++++++++++++++++++++++++++-----------
 2 files changed, 67 insertions(+), 12 deletions(-)

-- 
2.25.4



More information about the Gdb-patches mailing list