[0/3] Add assertion when marking the remote async flag

Message ID 20231004020701.260411-1-simon.marchi@polymtl.ca
Headers
Series Add assertion when marking the remote async flag |

Message

Simon Marchi Oct. 4, 2023, 2:03 a.m. UTC
  I had this idea while reviewing this patch [1].  When marking the remote
async flag, assert that the target is actually in async mode, instead of
relying on an assert that comes at a later time, in the wait method.
The first two patches are small preparatory refactorings, and the third
one adds the assertion.

[1] https://inbox.sourceware.org/gdb-patches/3d728a6e-1cb0-49c2-a4c8-0a974be39fee@simark.ca/T/#ma1903117423ae09c3574fd45ade2dd4af5280633

Simon Marchi (3):
  gdb: make remote_state's async token private
  gdb: add remote_state::{is_async_p,can_async_p}
  gdb: add assertion when marking the remote async flag

 gdb/remote.c | 93 ++++++++++++++++++++++++++++++++++------------------
 1 file changed, 62 insertions(+), 31 deletions(-)


base-commit: 1181bcd0d2572aee2c0947040e56bc1f9af634e3
  

Comments

Terekhov, Mikhail via Gdb-patches Oct. 6, 2023, 9:28 p.m. UTC | #1
> -----Original Message-----
> From: Gdb-patches <gdb-patches-
> bounces+mikhail.terekhov=dell.com@sourceware.org> On Behalf Of Simon
> Marchi via Gdb-patches
> Sent: Tuesday, October 3, 2023 10:04 PM
> To: gdb-patches@sourceware.org
> Cc: Simon Marchi <simon.marchi@polymtl.ca>
> Subject: [PATCH 0/3] Add assertion when marking the remote async flag
>
> I had this idea while reviewing this patch [1].  When marking the remote
> async flag, assert that the target is actually in async mode, instead of relying
> on an assert that comes at a later time, in the wait method.

After applying this series GDB fails in my setup in assert in mark_async_event_handler
right after call to it from queued_stop_reply. See my comment to PATCH 3/3.

> The first two patches are small preparatory refactorings, and the third one
> adds the assertion.
>
> [1] https://urldefense.com/v3/__https://inbox.sourceware.org/gdb-
> patches/3d728a6e-1cb0-49c2-a4c8-
> 0a974be39fee@simark.ca/T/*ma1903117423ae09c3574fd45ade2dd4af528063
> 3__;Iw!!LpKI!kBSMETr5QzzmvTDT4A0kxAcpgnOpWd2ZyualTzxDwp42So5Om
> byWvIb9bglZjsO4OCDKV_fIXMUj-
> Yh5Q6PUPj26WV9J$ [inbox[.]sourceware[.]org]
>
> Simon Marchi (3):
>   gdb: make remote_state's async token private
>   gdb: add remote_state::{is_async_p,can_async_p}
>   gdb: add assertion when marking the remote async flag
>
>  gdb/remote.c | 93 ++++++++++++++++++++++++++++++++++----------------
> --
>  1 file changed, 62 insertions(+), 31 deletions(-)
>
>
> base-commit: 1181bcd0d2572aee2c0947040e56bc1f9af634e3
> --
> 2.42.0


Internal Use - Confidential