From: Patrick Monnerat <patrick@monnerat.net>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Implement windows_nat_target::stop
Date: Wed, 15 Apr 2026 14:55:47 +0200 [thread overview]
Message-ID: <e3f0ca23-8d40-4093-8ad6-4546b11e2f46@monnerat.net> (raw)
In-Reply-To: <874ildwnky.fsf@tromey.com>
On 4/14/26 5:47 PM, Tom Tromey wrote:
> Patrick> Insight makes a difference between hitting Ctrl-C (that triggers
> Patrick> target::pass_ctrlc) and clicking the GUI stop button, triggering
> Patrick> target::stop).
>
> I wonder why.
I can't tell you exactly: the use of target_stop() has been introduced
in 1994 without detailed explanation!
As a pure conjecture for the initial motivation, I can imagine:
- the target program may have no associated console thus may use SIGINT
for another purpose
- Bare gdb has only a console interface, so it borrows SIGINT for
stopping the target: a gui can do better (!).
Latest reworks of this are dated around 1997-1999.
Maybe this should be modernized.
>
> Also I see Insight calls target_stop and not target_stop_and_wait, which
> seems a bit weird.
Yes, you're right. target_stop_and_wait() introduction (2014) is
posterior to target_stop() and missed from insight point of view.
This is a perverse effect of having splitted out insight: not many gdb
developers dive into its code nowadays.
In all cases, a target_stop_and_wait() call ends in target_stop(), so
this change, although wise, would not fix the current problem.
>
> Patrick> As windows_nat did not implement the stop method, the GUI stop button
> Patrick> was inoperant on Windows.
>
> Patrick> +void
> Patrick> +windows_nat_target::stop (ptid_t ptid)
> Patrick> +{
> Patrick> + interrupt ();
> Patrick> +}
>
> I don't really know the contract here but is interrupt guaranteed to
> stop PTID? Like is the relevant inferior always selected? How does
> this interact with non-stop?
? Really out of my skills, sorry.
>
> Right now it's probably somewhat moot but there's ongoing work for
> non-stop and multi-inferior on Windows.
>
So you mean I should wait for this work to land and steady ?
In all cases, it should provide a target stop method compatible with
other targets.
Thanks for your review,
Patrick
prev parent reply other threads:[~2026-04-15 12:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-11 14:32 Patrick Monnerat
2026-04-14 15:47 ` Tom Tromey
2026-04-15 12:55 ` Patrick Monnerat [this message]
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=e3f0ca23-8d40-4093-8ad6-4546b11e2f46@monnerat.net \
--to=patrick@monnerat.net \
--cc=gdb-patches@sourceware.org \
--cc=tom@tromey.com \
/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