Bug 28440 - GDB sends vCont;s packets on targets that don't report support for single-stepping
Summary: GDB sends vCont;s packets on targets that don't report support for single-ste...
Status: NEW
Alias: None
Product: gdb
Classification: Unclassified
Component: remote (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: ---
Assignee: Tom Tromey
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-10 21:36 UTC by Daniel Prilik
Modified: 2023-08-03 16:30 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed: 2023-08-03 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Prilik 2021-10-10 21:36:33 UTC
On certain architectures, the GDB client doesn't seem to respect `vCont?` responses that don't include `;s;S`, and will unconditionally send single-step resume packets, even when the target has not explicitly acknowledges support.

e.g: when connected to a x86_64 target:

  Sending packet: $vCont?#49...Packet received: vCont;c;C
  Packet vCont (verbose-resume) is supported
  Sending packet: $vCont;s:p1.1;c:p1.-1#f7...Remote connection closed

Interestingly enough, this is _not_ the case for all architectures. When connected to an `armv4t` target:

  Sending packet: $vCont?#49...Packet received: vCont;c;C
  Packet vCont (verbose-resume) is supported
  Sending packet: $m55550000,4#61...Packet received: 00000000
  Sending packet: $m55550000,4#61...Packet received: 00000000
  Sending packet: $m55550004,4#65...Packet received: 00000000
  Sending packet: $m55550000,4#61...Packet received: 00000000
  Sending packet: $m55550000,4#61...Packet received: 00000000
  Sending packet: $m55550000,4#61...Packet received: 00000000
  Sending packet: $Z0,55550004,4#ae...Packet received:
  Packet Z0 (software-breakpoint) is NOT supported
  Sending packet: $m55550004,4#65...Packet received: 00000000
  Sending packet: $X55550004,0:#86...Packet received: OK
  binary downloading supported by target
  Sending packet: $X55550004,4:\001\000\237�#19...Packet received: OK
  Sending packet: $vCont;c:p1.-1#0f

Which is what I would expect (i.e: it attempts to set a temporary software breakpoint, and then continues the target).

* * *

While looking into this bug, I created a basic set of "dummy" remote targets to figure out why this was happening. I've uploaded these targets to Github, in hope that they can be useful while looking into this bug:

https://github.com/daniel5151/gdb-optional-step-bug

For more context, here is the (unrelated) issue where I stumbled across this bug:

https://github.com/daniel5151/gdbstub/issues/89#issuecomment-939203794
Comment 1 Tom Tromey 2023-08-03 16:30:39 UTC
I think this is solved here:

https://sourceware.org/pipermail/gdb-patches/2023-June/200249.html