From: Paul Smith <psmith@gnu.org>
To: gdb@sourceware.org
Subject: Debugging in multithreaded systems
Date: Thu, 06 Feb 2020 22:06:00 -0000 [thread overview]
Message-ID: <2a0eff24d5b58db30efc9d8a16b256f4748d0071.camel@gnu.org> (raw)
Can someone provide some insight on multithreaded debugging?
I'm trying to track down a really gnarly issue in a multithreaded system.
I really need to control the way threads run while I'm debugging.
I'm using GDB 8.2.1 on a GNU/Linux (x86_64) system.
I'm setting 'set scheduler-locking step', which I thought would do what I
wanted: when I'm debugging only my thread under debug will run and other
threads are suspended: this is critical for me because if other threads run
they perturb the bug.
The problem is that the docs say that "step" mode will keep other threads
locked in "step" and will free them up for "continue", "until", and
"finish".
But the docs don't say anything about "next".
I had assumed that "next" would work like "step", but it appears that
instead it works like "finish" etc. and allows other threads to run :(.
I sort of get it because "next" is akin to stepping into a method then
calling "finish", but this is a big bummer because I'm debugging a C++
program and trying to step through every STL statement in every method,
etc. etc. is very time consuming.
Abstractly it would make much more sense (to me) if "next" worked like
"step" and kept the other threads locked out.
Am I missing something? Is "next" supposed to work like "step"? If not
could it be changed to do so? Or, I guess, if there really is some useful
reason to have "next" allow other threads to run, a new scheduler-locking
mode for "next" could be added...?
For now I guess I'll (try to remember to) force "set scheduler-locking off"
and then back on again by hand each time.
next reply other threads:[~2020-02-06 22:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-06 22:06 Paul Smith [this message]
2020-02-06 22:25 ` Jonah Graham
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2a0eff24d5b58db30efc9d8a16b256f4748d0071.camel@gnu.org \
--to=psmith@gnu.org \
--cc=gdb@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox