Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Stephan Rohr <stephan.rohr@intel.com>
To: gdb-patches@sourceware.org
Subject: [PATCH v2 0/2] disable pagination for new inferior notification
Date: Wed, 25 Nov 2026 13:08:00 +0000	[thread overview]
Message-ID: <20261125130802.117043-1-stephan.rohr@intel.com> (raw)

Hi all,

this got somewhat lost; I forgot to ping it or post a new version for
a while.  This is now v2 of the patch fixing an incomplete inferior
when the "[New inferior ..]"  notification paginates and the user
answers "quit":

  (gdb) set width 10
  (gdb) set height 1
  (gdb) add-inferior
  [New infer--Type <RET> for more, q to quit, c to continue without paging--q
  Quit
  (gdb) set height unlimited

The inferior's program space is not setup and triggers an assertion:

  (gdb) info inferiors
  gdb/progspace.c:329: internal-error: set_current_program_space:
  Assertion `pspace != NULL' failed.

v1 was posted here:
https://sourceware.org/pipermail/gdb-patches/2026-July/228328.html

Patch 1 delays the new inferior notification until the inferior is
properly set up.

Patch 2 fixes the case if the user answers "quit" while following a
fork: this would leave the inferior without a target and threads.
Temporarily disable pagination when following a fork, similar to
"fetch_inferior_event ()".

Changes since v1:

- Delay the new inferior notification instead of disabling pagination.
- Remove "add_inferior" and replace with "add_inferior_silent ()" and
  "print_new_inferior ()".
- Extend to the "clone-inferior" and follow-fork cases.

Tested on x86_64 GNU/Linux with the unix, native-gdbserver and
native-extended-gdbserver board files; there are no regressions.

I appreciate your feedback.

Thanks
Stephan

Stephan Rohr (2):
  gdb: delay the new inferior notification
  gdb: disable pagination while following a fork

 gdb/inferior.c                                | 26 +++---
 gdb/inferior.h                                | 14 ++--
 gdb/infrun.c                                  | 18 +++-
 gdb/remote.c                                  |  6 +-
 .../gdb.base/add-inferior-paginate.exp        | 59 +++++++++++++
 .../gdb.base/fork-inferior-paginate.exp       | 83 +++++++++++++++++++
 6 files changed, 185 insertions(+), 21 deletions(-)
 create mode 100644 gdb/testsuite/gdb.base/add-inferior-paginate.exp
 create mode 100644 gdb/testsuite/gdb.base/fork-inferior-paginate.exp

-- 
2.43.0

________________________________________
Intel Deutschland GmbH 

Registered Address: Dornacher Strasse 1, 85622 Feldkirchen, Germany 

Tel: +49 (89) 99143-0 

www.intel.de 

Managing Directors: Candice Moore, Jeffrey Schneiderman, Ramachandran Sitaraman

Chairperson of the Supervisory Board: Sonja Pierer

Registered Seat: Munich Commercial Register B: Amtsgericht Munich HRB 186928

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


             reply	other threads:[~2026-11-25 13:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25 13:08 Stephan Rohr [this message]
2026-11-25 13:08 ` [PATCH v2 1/2] gdb: delay the " Stephan Rohr
2026-11-25 13:08 ` [PATCH v2 2/2] gdb: disable pagination while following a fork Stephan Rohr

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=20261125130802.117043-1-stephan.rohr@intel.com \
    --to=stephan.rohr@intel.com \
    --cc=gdb-patches@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