Re: MI commands changing current thread

Vladimir Prus <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <[email protected]>
On 15-Oct-15 12:01 PM, Tedeschi, Walfred wrote:
> Hi Simon,
>
> Documentation says that you should rely on the selected thread, best method is always to pass the argument --thread.

I think you meant "should not rely", above.

>
> Here is the part of the documentation:
>
> ' In particular, if the frontend sends several commands to gdb, and one of the commands changes the selected thread, then the behaviour of subsequent commands will change. So, a frontend should either wait for response from such problematic commands, or explicitly add -thread-select for all subsequent commands.
> No frontend is known to do this exactly right, so it is suggested to just always pass the ‘--thread’ and ‘--frame’ options.'

That's correct, the current behavior is intended. If I remember correctly, if one starts to do async/non-stop,
then the notion of current thread breaks down completely. If one issues a command in one another, another command
in another thread and then we hit breakpoint in a third thread, it's no longer clear what thread should be current
in the end.

Since MI is for frontends, it's easier for all parties to just always pass --thread.

HTH,

-- 
Vladimir Prus
http://vladimirprus.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.