Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kevin Buettner <kevinb@redhat.com>
To: Tankut Baris Aktemur via Gdb-patches <gdb-patches@sourceware.org>
Cc: Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Subject: Re: [PATCH v2] gdb/infrun: do not restart a stepped thread if not running (was: gdb/infrun: reset thread control's step info in end_stepping_range)
Date: Sat, 21 Feb 2026 13:44:58 -0700	[thread overview]
Message-ID: <20260221134458.51f80ad5@f42-zbm-amd> (raw)
In-Reply-To: <20230620152455.471716-1-tankut.baris.aktemur@intel.com>

Hi Baris,

I've taken a look at your patch and have found a few nits that'll
merit a v3, though some, I think, are due to changes made to the
testing framework since you originally posted your patch.

The C code looks okay to me, but posting a v3 with the testsuite nits
fixed might get a few more pairs of eyes on it before it goes in.

On Tue, 20 Jun 2023 17:24:55 +0200
Tankut Baris Aktemur via Gdb-patches <gdb-patches@sourceware.org> wrote:

[...]
> diff --git a/gdb/testsuite/gdb.multi/detach-stepi.exp
> b/gdb/testsuite/gdb.multi/detach-stepi.exp new file mode 100644
> index 00000000000..28ef8c4f9f7
> --- /dev/null
> +++ b/gdb/testsuite/gdb.multi/detach-stepi.exp
> @@ -0,0 +1,66 @@
> +# This testcase is part of GDB, the GNU debugger.
> +
> +# Copyright 2022 Free Software Foundation, Inc.

I think that the copyright year should be updated.

[...]
> +standard_testfile
> +
> +if {[use_gdb_stub]} {
> +    untested "using gdb stub"
> +    return 0
> +}

The above should be replaced with:

  require !use_gdb_stub

Other tests in gdb.multi also use:

  require allow_multi_inferior_tests

...so I recommend adding this too.

> +
> +if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
> +    return -1
> +}
> +
> +if {![runto_main]} {
> +    return -1
> +}
> +
> +delete_breakpoints
> +
> +# Setup inferior 2.
> +gdb_test "add-inferior" "Added inferior .*" \
> +    "add empty inferior"
> +gdb_test "inferior 2" "Switching to inferior .*" \
> +    "switch to inferior"
> +
> +gdb_load $binfile
> +runto "a_function"
> +gdb_test "info inferiors"

Is there something that you want to look for with "info inferiors"?
Or is it for debugging purposes?

> +
> +# The bug for which this regression test is written appears in
> +# schedule-multi mode.
> +gdb_test_no_output "set schedule-multiple on"
> +
> +# Single-step the thread in Inferior 2, then detach Inferior 1.
> +gdb_test "info threads" ".*" "threads before stepi"
> +gdb_test "stepi"

Is there some pattern which might be usefully matched for the stepi?

> +gdb_test "info threads" ".*" "threads after stepi"
> +
> +gdb_test "set debug infrun on"

Use gdb_test_no_output for the above command.

> +gdb_test_multiple "detach inferior 1" "" {
> +    -re "resuming previously stepped thread.*$gdb_prompt" {
> +	fail $gdb_test_name
> +    }
> +    -re "$gdb_prompt $" {
> +	pass $gdb_test_name
> +    }
> +}


  parent reply	other threads:[~2026-02-21 20:48 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-20 15:24 Tankut Baris Aktemur via Gdb-patches
2023-06-21 12:35 ` Bruno Larsen via Gdb-patches
2023-06-22  7:02   ` Aktemur, Tankut Baris via Gdb-patches
2023-06-22  7:39     ` Bruno Larsen via Gdb-patches
2023-06-22  8:01       ` Aktemur, Tankut Baris via Gdb-patches
2023-11-21 20:00 ` Aktemur, Tankut Baris
2025-02-19 12:52   ` Aktemur, Tankut Baris
2025-03-18 18:11     ` Aktemur, Tankut Baris
2025-04-04 13:44       ` Aktemur, Tankut Baris
2025-04-23  7:59         ` Aktemur, Tankut Baris
2026-02-20 12:11           ` Aktemur, Tankut Baris
2026-02-21 20:44 ` Kevin Buettner [this message]
2026-02-23 10:34   ` Aktemur, Tankut Baris
2026-02-23 10:36 ` [PATCH v3] gdb/infrun: do not restart a stepped thread if not running Tankut Baris Aktemur
2026-02-28 18:33   ` Kevin Buettner

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=20260221134458.51f80ad5@f42-zbm-amd \
    --to=kevinb@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tankut.baris.aktemur@intel.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