Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Thiago Jung Bauermann via Gdb-patches <gdb-patches@sourceware.org>
To: Eduard Sargsyan <eduard.sargsyan@intel.com>
Cc: Aleksandar Paunovic <aleksandar.paunovic@intel.com>,
	gdb-patches@sourceware.org
Subject: Re: [PATCH 1/2] gdb: Fix deleted thread when issuing next command
Date: Thu, 25 Aug 2022 23:11:54 +0000	[thread overview]
Message-ID: <87wnavex51.fsf@linaro.org> (raw)
In-Reply-To: <20220523180056.1415229-2-eduard.sargsyan@intel.com>


Hello Eduard,

Eduard Sargsyan via Gdb-patches <gdb-patches@sourceware.org> writes:

> From: Aleksandar Paunovic <aleksandar.paunovic@intel.com>
>
> When issuing "next" command the thread got deleted even though it was still
> alive and running.  This happened because the thread was examined under a
> wrong inferior.
>
> The fixed scenario:
> ~~~
> $ gdb -q breakpoint-running-inferior-1-exe
> (gdb) set schedule-multiple off
> (gdb) break breakpoint-running-inferior-1.c:26
> (gdb) run
> (gdb) add-inferior -no-connection
> (gdb) inferior 2
> (gdb) spawn gdbserver :2346 breakpoint-running-inferior-2-exe
> (gdb) target remote :2346
> (gdb) break breakpoint-running-inferior-2.c:26
> (gdb) continue
> (gdb) thread 1.1
> (gdb) clear breakpoint-running-inferior-2.c:26
> (gdb) set schedule-multiple on
> (gdb) next
> (gdb) thread 1.1
> ~~~
>
> Before:
> ~~~
> Thread ID 1.1 has terminated.
> ~~~
>
> Now:
> ~~~
> Switching to thread 1.1
> ~~~
>
> gdb/ChangeLog:
> 2021-04-30  Aleksandar Paunovic  <aleksandar.paunovic@intel.com>
>
> 	* infrun.c (keep_going_stepped_thread): Switch to correct
> 	inferior and check if thread is executing.
>
> gdb/testsuite/ChangeLog:
> 2021-04-30  Aleksandar Paunovic  <aleksandar.paunovic@intel.com>
>
> 	* gdb.base/breakpoint-running-inferior-1.c: New file.
> 	* gdb.base/breakpoint-running-inferior-2.c: New file.
> 	* gdb.base/breakpoint-running-inferior.exp: New file.
>
> Signed-off-by: Aleksandar Paunovic <aleksandar.paunovic@intel.com>
> ---
>  gdb/infrun.c                                  |  2 +
>  .../gdb.base/breakpoint-running-inferior-1.c  | 39 +++++++++
>  .../gdb.base/breakpoint-running-inferior-2.c  | 39 +++++++++
>  .../gdb.base/breakpoint-running-inferior.exp  | 84 +++++++++++++++++++
>  4 files changed, 164 insertions(+)
>  create mode 100644 gdb/testsuite/gdb.base/breakpoint-running-inferior-1.c
>  create mode 100644 gdb/testsuite/gdb.base/breakpoint-running-inferior-2.c
>  create mode 100644 gdb/testsuite/gdb.base/breakpoint-running-inferior.exp

Aleksandar last posted version 4 of this patch, but this email seems to
contain either v1 or v2. Consequently, Simon's review comments aren't
addressed here. Was there a reason to return to the older version?

Also, I applied the patch to a commit from a few days ago which I had
handy (f8bfbd5b751b) and there were some failures when running the test:

                === gdb Summary ===

# of expected passes            10
# of unexpected failures        3
# of duplicate test names       1

Are the tests passing for you?

Interestingly, running the testcase with the infun.c change reverted
produced one less failure:

                === gdb Summary ===

# of expected passes            11
# of unexpected failures        2
# of duplicate test names       1

-- 
Thiago

  reply	other threads:[~2022-08-25 23:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-23 18:00 [PATCH 0/2] Some patches for multi inferior case Eduard Sargsyan via Gdb-patches
2022-05-23 18:00 ` [PATCH 1/2] gdb: Fix deleted thread when issuing next command Eduard Sargsyan via Gdb-patches
2022-08-25 23:11   ` Thiago Jung Bauermann via Gdb-patches [this message]
2022-05-23 18:00 ` [PATCH 2/2] gdb: Improve the resuming of the stepped thread Eduard Sargsyan via Gdb-patches
2022-08-25 23:20   ` Thiago Jung Bauermann via Gdb-patches
2022-06-22  8:22 ` [PATCH 0/2] Some patches for multi inferior case Sargsyan, Eduard via Gdb-patches
  -- strict thread matches above, loose matches on Subject: below --
2021-06-07  8:42 [PATCH 0/2] Fix next command in the running inferior aleksandar.paunovic via Gdb-patches
2021-06-07  8:42 ` [PATCH 1/2] gdb: Fix deleted thread when issuing next command aleksandar.paunovic via Gdb-patches

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=87wnavex51.fsf@linaro.org \
    --to=gdb-patches@sourceware.org \
    --cc=aleksandar.paunovic@intel.com \
    --cc=eduard.sargsyan@intel.com \
    --cc=thiago.bauermann@linaro.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