Re: Debugging in multithreaded systems

Jonah Graham <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <CAPmGMvjvmCGVmSLymV9Govqc1w4-_qT1pFJPFLeKpZNnqePAyw@mail.gmail.com>
On Thu, 6 Feb 2020 at 17:06, Paul Smith <[email protected]> wrote:

> Can someone provide some insight on multithreaded debugging?
>

I'll try - but I can't answer your underlying question about changing next
behaviour in this case.

1. Consider using non-stop mode instead of all-stop mode if supported:
https://sourceware.org/gdb/current/onlinedocs/gdb/Non_002dStop-Mode.html#Non_002dStop-Mode
-
the key line is this:
"In non-stop mode, all execution commands apply only to the current thread
by default. That is, continue only continues one thread. To continue all
threads, issue continue -a or c -a." - so you can interrupt all threads,
and then just debug the one problematic thread. If course you need a system
that supports non-stop and I don't know which ones do and don't.
2. Try passing numeric argument to step to step multiple times at once.

HTH
Jonah
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.