Async + all-stop mode for gdbserver

Yibo Yan via Gdb <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <CAPcWAF9nkr_NTf4oMhuaFDRhSEjHBtACDeh_ZvWJZygw8jSF6A@mail.gmail.com>
Hi,

I am working on a project to support a unified view for debugging
distributed systems, and I am using gdbserver to be attached to the remote
processes.

I need to use gdbserver with `mi-async on` and `non-stop off`, which seems
to work correctly with gdb, but this is not the case when the gdb is
connected to the gdbserver.

One simple use case here is to list all thread information (-thread-info)
when the target is running. The command gets executed correctly when the
gdb is locally attached to a running process and returns the list of thread
information. When the gdb is remotely connected to the gdbserver, the
behavior is not consistent, as it doesn't allow me to run `-thread-info`
anymore.

Looking at the design of RSP, I can tell it doesn't have a specific packet
for enabling async mode besides `QNonStop` for enabling non-stop mode.
Looks like the source code of gdbserver also indicates the same thing ---
the async mode is only enabled when the non-stop mode is enabled.

My question is whether this is intended behavior or potentially a design
flaw or bug? I am aware that I can still manually interrupt and resume all
threads to mimic the behavior of async + all-stop. I am just wondering if I
can achieve the same thing directly from gdbserver instead of hacking it
this way.

Many thanks!

Best,
---
*Yibo Yan*

CS Ph.D Student
Networked Systems Laboratory
University of Southern California

LinkedIn <https://www.linkedin.com/in/ybyan/> | GitHub
<https://github.com/totoroyyb>
he / him / his
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.