From: Jan Vrany <jan.vrany@labware.com>
To: gdb-patches@sourceware.org
Subject: Re: [PATCH v3 0/1] PR20684, preserve user selected context when invoking MI commands
Date: Mon, 07 Feb 2022 11:56:04 +0000 [thread overview]
Message-ID: <b9994552adfd82df10c1a00b62a9400999ad78c0.camel@labware.com> (raw)
In-Reply-To: <20220127145011.1153142-1-jan.vrany@labware.com>
Polite ping.
Jan
On Thu, 2022-01-27 at 14:50 +0000, Jan Vrany wrote:
> This is a next version of the patch fixing some regression
>
> Changes since previous iteration [1]:
>
> * updates to accomodate new C++ification of MI commands pushed in
> December last year.
> * updates to handle cases pointed out by Simon
> * add testcase
>
> Changes since v1:
>
> * address Simon's comments [2]
> * add more tests for -stack-select-frame
>
> Changes since v2:
>
> Fix regression in mi-nonstop.exp and mi-nsthrexec.exp. This
> was caused by extra user selected thread notification being sent
> when resuming a thread like:
>
> -exec-continue --thread 2
>
> The culprit was this part of mi_excecute_command ():
>
> else if (inferior_ptid != null_ptid)
> {
> struct thread_info *ti = inferior_thread ();
>
> report_change = (ti->global_num != command->thread);
> }
>
> This "else" is only executed when command specifies --thread.
>
> Imagine currently selected thread is thread 1 and -exec-continue --thread 2
> is issued.
>
> BEFORE applying this patch, no change would be reported because mi_cmd_execute ()
> would switch the thread to thread 2 so `ti->global_num != command->thread` would
> be false.
>
> AFTER appling this patch, mi_cmd_execute () would switch the thread *and then restore*
> back so `ti->global_num != command->thread` would be true.
>
> Therefore I removed this whole `else if` branch: since mi_cmd_execute () now restores
> the thread if --thread is passed (except few limited commands that notify themselves),
> this condition would hold each time thread passed to --thread is different than current
> thread. Removing it preserves the behavior.
>
> Removing that "else if" branch allowed me to merge two nested ifs into one to (hopefully)
> make the code simpler.
>
> Thanks!
>
> Jan
>
>
> [1]: https://sourceware.org/pipermail/gdb-patches/2021-February/175897.html
>
>
> Jan Vrany (1):
> gdb/mi: PR20684, preserve user selected thread and frame when invoking
> MI commands
>
> gdb/mi/mi-cmds.h | 12 ++
> gdb/mi/mi-main.c | 54 ++++---
> gdb/testsuite/gdb.mi/mi-cmd-user-context.exp | 155 +++++++++++++++++++
> 3 files changed, 198 insertions(+), 23 deletions(-)
> create mode 100644 gdb/testsuite/gdb.mi/mi-cmd-user-context.exp
>
next prev parent reply other threads:[~2022-02-07 11:56 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-25 14:51 [PATCH " Jan Vrany
2022-01-25 14:51 ` [PATCH 1/1] gdb/mi: PR20684, preserve user selected thread and frame " Jan Vrany
2022-01-25 18:59 ` Simon Marchi
2022-01-26 13:21 ` [PATCH v2 0/1] PR20684, preserve user selected context " Jan Vrany
2022-01-26 13:21 ` [PATCH v2 1/1] gdb/mi: PR20684, preserve user selected thread and frame " Jan Vrany
2022-01-26 15:01 ` Simon Marchi
2022-01-26 17:08 ` Jan Vrany
2022-01-27 14:50 ` [PATCH v3 0/1] PR20684, preserve user selected context " Jan Vrany
2022-02-07 11:56 ` Jan Vrany [this message]
2022-02-17 16:07 ` [PING] " Jan Vrany
2022-01-27 14:50 ` [PATCH v3 1/1] gdb/mi: PR20684, preserve user selected thread and frame " Jan Vrany
2022-02-17 22:24 ` Andrew Burgess
2022-02-18 17:45 ` Jan Vrany
2022-03-01 11:59 ` [PING] " Jan Vrany
2022-03-02 10:00 ` Andrew Burgess
2022-03-02 13:23 ` [PATCH v4] " Jan Vrany
2022-03-08 16:58 ` Andrew Burgess
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=b9994552adfd82df10c1a00b62a9400999ad78c0.camel@labware.com \
--to=jan.vrany@labware.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).