public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Jan Vrany <jan.vrany@labware.com>
To: Simon Marchi <simon.marchi@polymtl.ca>,
	Simon Marchi <simark@simark.ca>,
	gdb-patches@sourceware.org
Cc: Andrew Burgess <aburgess@redhat.com>
Subject: Re: [pushed] gdb/mi: consistently notify user when GDB/MI client uses -thread-select
Date: Wed, 23 Mar 2022 15:13:06 +0000	[thread overview]
Message-ID: <14d27757ce39bcc7a19f74508e689acfa7fa33c2.camel@labware.com> (raw)
In-Reply-To: <ffd69e05-a4e7-2319-c7f9-f1ced29bc608@polymtl.ca>

Hi,

On Wed, 2022-03-23 at 08:36 -0400, Simon Marchi wrote:
> > Just tried on Ubuntu 20.04 and I do not any problem. 
> 
> I'm trying to look a bit more into it.  The state is that we have thread
> 2 already selected, issue a `-thread-select 2` on the MI UI, and expect
> to not have a CLI notification to say that the thread changed, since we
> try to select the already selected thread.
> 
> Before your patch I get:
> 
>     -thread-select 2
> 
>     ^done,new-thread-id="2",frame={level="0",addr="0x00005555555551b8",func="child_sub_function",args=[],file="/home/smarchi/src/binutils-
> gdb/gdb/testsuite/gdb.mi/user-selected-context-sync.c",fullname="/home/smarchi/src/binutils-gdb/gdb/testsuite/gdb.mi/user-selected-context-
> sync.c",line="33",arch="i386:x86-64"}
> 
>     (gdb) 
> 
>     PASS: gdb.mi/user-selected-context-sync.exp: mode=all-stop: test_mi_thread_select: thread 1.2: -thread-select again
>     print 666
> 
>     $9 = 666
> 
>     (gdb) PASS: gdb.mi/user-selected-context-sync.exp: mode=all-stop: test_mi_thread_select: thread 1.2: -thread-select again, event on CLI, ensure no output
> CLI
> 
> After:
> 
>     -thread-select 2
> 
>     ^done,new-thread-id="2",frame={level="0",addr="0x00005555555551b8",func="child_sub_function",args=[],file="/home/smarchi/src/binutils-
> gdb/gdb/testsuite/gdb.mi/user-selected-context-sync.c",fullname="/home/smarchi/src/binutils-gdb/gdb/testsuite/gdb.mi/user-selected-context-
> sync.c",line="33",arch="i386:x86-64"}
> 
>     (gdb) 
> 
>     PASS: gdb.mi/user-selected-context-sync.exp: mode=all-stop: test_mi_thread_select: thread 1.2: -thread-select again
>     [Switching to thread 1.2 (Thread 0x7ffff7d99700 (LWP 1885257))]
> 
>     #0  child_sub_function () at /home/smarchi/src/binutils-gdb/gdb/testsuite/gdb.mi/user-selected-context-sync.c:33
> 
>     33	    dummy = !dummy; /* thread loop line */
> 
>     print 666
> 
>     $9 = 666
> 
>     (gdb) FAIL: gdb.mi/user-selected-context-sync.exp: mode=all-stop: test_mi_thread_select: thread 1.2: -thread-select again, event on CLI, ensure no output
> CLI
> 
> So there is really a spurious "Switching to thread 1.2" notification in
> my case.
> 
> Trying a simpler case, just an empty main program, I do this (/dev/pts/8
> being the tty for my MI UI):
> 
>     $ ./gdb -q -nx --data-directory=data-directory a.out -ex "new-ui mi /dev/pts/8" -ex start
> 
> If I then type `-thread-select 1` on the MI UI, I do get:
> 
>     [Switching to thread 1 (process 1891548)]
> 
> ... which is unexpected.  Before your patch, I don't get it.  Can you
> give this small test a try?
> 

I gave it a go but I'm sorry: everything seem to work as expected 
here. I do not get "[Switching to thread 1 (process 1891548)]" message
on CLI when -thread-select already selected thread. 

I must be doing something differently. What commit is failing for you?
What's your ./configure incantation?

I'm happy to sit down with you and have a closer look at this, maybe using 
IRC or something. 

Jan




> Simon


  reply	other threads:[~2022-03-23 15:13 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-16 15:09 Jan Vrany
2022-03-21 20:35 ` Simon Marchi
2022-03-21 21:01   ` Jan Vrany
2022-03-22 14:37     ` Jan Vrany
2022-03-23 12:36       ` Simon Marchi
2022-03-23 15:13         ` Jan Vrany [this message]
2022-03-23 15:16           ` Simon Marchi
2022-03-23 16:09             ` Jan Vrany
2022-03-23 19:09               ` Andrew Burgess
2022-03-23 19:11                 ` Andrew Burgess
2022-03-23 20:33                 ` Jan Vrany
2022-03-24 14:47                 ` Simon Marchi
2022-03-24 18:52                   ` [PATCHv2] gdb/mi: fix use after free of frame_info causing spurious notifications Andrew Burgess
2022-03-24 20:32                     ` Simon Marchi
2022-03-29 10:10                       ` Andrew Burgess
2022-03-24 15:00               ` [pushed] gdb/mi: consistently notify user when GDB/MI client uses -thread-select 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=14d27757ce39bcc7a19f74508e689acfa7fa33c2.camel@labware.com \
    --to=jan.vrany@labware.com \
    --cc=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simark@simark.ca \
    --cc=simon.marchi@polymtl.ca \
    /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).