public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@palves.net>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org, Takashi Yano <takashi.yano@nifty.ne.jp>
Subject: Re: [PATCH] Cygwin: Fix putting inferior in foreground (fix input)
Date: Tue, 27 Feb 2024 14:40:11 +0000	[thread overview]
Message-ID: <44f87c35-6279-4555-9d7c-5dcbc1275114@palves.net> (raw)
In-Reply-To: <87zfvmuhah.fsf@tromey.com>

On 2024-02-27 14:13, Tom Tromey wrote:
>>>>>> "Pedro" == Pedro Alves <pedro@palves.net> writes:
> 
> Pedro> The problem is that inflow.c:child_terminal_inferior is failing to put
> Pedro> the inferior in the foreground, because we're passing down the
> Pedro> inferior's Windows PID instead of the Cygwin PID to Cygwin tcsetpgrp.
> 
> Thanks.  My first thought was that this should really be
> target-specific, but I dug into the code and I see that this is only
> called from inf_child_target -- i.e., it is.  I wonder if a bunch of
> that code could be moved out of inflow.c and into inf-child.c.

I'm not sure.  I think I prefer having all the terminal handling code in
the same place, as the data structures, #ifdefs, etc. are all the same.
Also, there was a suggestion to use terminal shuffling when debugging
with "local gdbserver", and remote isn't an inf_child_target target.

What I think we should do (and I've avoided it thus far because I have a lot of pending
changes to this code), is to rename the file. It is severely misnamed, I think due to
how it ended up being what it is.  At the top you see:

 /* Low level interface to ptrace, for GDB when running under Unix.

That is obviously incorrect.  We have inf-ptrace.c nowadays, and inflow.c has no
ptrace code.  I think what happened is that everything other than terminal handling moved
out of the file over the years.   So I think we could rename it.  Several of the exported
functions from inflow.c are declared in terminal.h, so I guess we could just rename it to
terminal.c.

> 
> Approved-By: Tom Tromey <tom@tromey.com>
> 

Thanks, I've merged it.

Pedro Alves

  reply	other threads:[~2024-02-27 14:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-26 20:44 Pedro Alves
2024-02-27 14:13 ` Tom Tromey
2024-02-27 14:40   ` Pedro Alves [this message]
2024-02-27 14:44     ` Simon Marchi

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=44f87c35-6279-4555-9d7c-5dcbc1275114@palves.net \
    --to=pedro@palves.net \
    --cc=gdb-patches@sourceware.org \
    --cc=takashi.yano@nifty.ne.jp \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).