From: Pawel Piech <pawel.piech@windriver.com>
To: Vladimir Prus <vladimir@codesourcery.com>
Cc: Marc Khouzam <marc.khouzam@ericsson.com>,
Pedro Alves <pedro@codesourcery.com>,
gdb@sourceware.org
Subject: Re: MI non-stop interface details
Date: Fri, 02 May 2008 16:59:00 -0000 [thread overview]
Message-ID: <481B4830.9040909@windriver.com> (raw)
In-Reply-To: <200805021820.47837.vladimir@codesourcery.com>
Vladimir Prus wrote:
> On Thursday 01 May 2008 22:06:03 Pawel Piech wrote:
>
>> Vladimir Prus wrote:
>>
>>> On Wednesday 30 April 2008 21:20:24 Pawel Piech wrote:
>>>
>>>
>>>> Vladimir Prus wrote:
>>>>
>>>>
>>>>> Again -- exec-continue resuming just one thread will be a change in behaviour.
>>>>> We can take two approaches:
>>>>>
>>>>> 1. The MI interface we've discussed for non-stop is essentially MI3 (and will
>>>>> be used both in all-stop and non-stop mode). We're in position to change anything
>>>>> we like, and are not bound by backward compatibility, or anything.
>>>>>
>>>>> 2. The MI interface for non-stop is MI2 + minimal set of changes. I think that
>>>>> Pawel's opposition to the --thread idea indicates that he prefers this approach.
>>>>> Then, we rather not change the behaviour of existing commands.
>>>>>
>>>>> There are not many high-level warts in MI2/non-stop/async, so I'm willing
>>>>> to go with (2).
>>>>>
>>>>> - Volodya
>>>>>
>>>>>
>>>>>
>>>> First of all I really appreciate your effort to maintain backward
>>>> compatibility. I know that it can seriously complicate the effort to
>>>> add new features but I believe this effort pays off in quicker and more
>>>> reliable adoption by the users (IDEs). However, there are two kinds of
>>>> backward compatibility goals to consider:
>>>> 1) Allowing old GDB clients to use the new, extended protocol.
>>>> 2) Allow clients that use the extended protocol to easily work with old
>>>> protocol versions. And by "easily", I mean that the client should be
>>>> able to not have "if(non-stop) { use command a } else { use command b}"
>>>> kind of logic scattered throughout its implementation.
>>>>
>>>>
>>> Why do you have such a goal?
>>>
>>>
>> Adoption of new versions of GDB is gradual, so for clients support for
>> old versions of GDB is very important.
>>
>
> The "else" branch of your conditional handles old version of GDB, no?
>
As I mentioned before, having lots of "if (new)... else (old)..." makes
the code hard to maintain after a while. I think Nick got it right,
maintaining backward compatibility is more work for the server, dealing
with incompatibilities is more work for the client. Right now what
you're saying is: "what's the big deal, just do a little more work".
Keep in mind though, there is one server, and many clients.
>
>>> Currently, both *running and *stopped have "thread-id" field.
>>>
>>>
>> But your proposal doesn't add any fields to the events indicating
>> whether the stopped event stops a single thread or the whole process.
>>
>
> If the thread-id field has a value of "all", then all threads are stopped,
> but it's just a shortcut for a number of *stopped, one per each thread.
>
This leaves out an important piece of information: the triggering
thread, which is used by the IDE to decide which thread should get the
focus. You may not see a use case for it now, but sooner or later you
will add an option to the breakpoint to stop all threads in non-stop
mode and you'll want to tell the client which thread hit the breakpoint.
Also this behavior is incompatible with the all-stop mode (in new or old
GDB versions). I.e. is the all-stop mode always going to report
thread-id="all" for every stopped and running event? I suppose you'll
say to just add another if-else statement...
>>> I'll probably start designing multi-process extensions for MI this week,
>>> and will look into these suggestions. Why are you trying to use same
>>> namespace for process ids and thread ids?
>>>
>>> - Volodya
>>>
>>>
>> I see no reason to create a separate name space and in fact adding
>> another name space just requires more logic to maintain it. thread-id
>> is just a handle that is obtained through well-documented commands, the
>> MI clients are not likely to get confused by the fact that containers
>> and threads are in the same namespace. Additionally, if GDB was ever to
>> support more hierarchical systems: such as
>> target->core->processes->threads, it will have to keep revising the
>> protocol (in incompatibility inducing ways) to keep up. But I guess
>> you'd have to believe that this is a real issue first.
>>
>
> I think the MI commands to query the hierarchy of "containers" will be fairly
> agnostic of the actual meaning of each containers (just like variable objects
> allow to describe arbitrary structure). That said, I'm not 100% that
> making the namespace of containers and namespace of thread IDs is not going
> to upset existing frontends.
>
> - Volodya
>
Can you think of a scenario in a client which would break? Would
KDevelop break? Maybe implementers of other client can speak up on this.
-Pawel
P.S. I really appreciate your effort and attention to resolve these issues.
next prev parent reply other threads:[~2008-05-02 16:59 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-26 18:09 Vladimir Prus
2008-04-26 18:16 ` Doug Evans
2008-04-26 19:49 ` Vladimir Prus
2008-04-30 7:18 ` Marc Khouzam
2008-04-28 16:21 ` Pedro Alves
2008-04-29 19:21 ` Vladimir Prus
2008-04-29 20:04 ` Pedro Alves
2008-04-30 7:00 ` Pawel Piech
2008-05-01 16:15 ` Vladimir Prus
2008-05-01 16:31 ` Pawel Piech
2008-05-01 16:38 ` Vladimir Prus
2008-05-01 16:58 ` Pawel Piech
[not found] ` <4819F4D4.4010305@windriver.com>
2008-05-01 17:00 ` Vladimir Prus
2008-05-01 17:53 ` Pawel Piech
2008-05-01 18:12 ` Vladimir Prus
2008-05-01 18:37 ` Pawel Piech
2008-05-02 1:23 ` Evolution of GDB/MI [was Re: MI non-stop interface details] Nick Roberts
2008-04-30 14:23 ` MI non-stop interface details Marc Khouzam
2008-04-30 17:21 ` Pedro Alves
[not found] ` <200804301117.42633.vladimir@codesourcery.com>
[not found] ` <4818AA58.4040201@windriver.com>
2008-05-01 17:11 ` Vladimir Prus
2008-05-01 18:08 ` Pawel Piech
2008-05-02 14:21 ` Vladimir Prus
2008-05-02 16:59 ` Pawel Piech [this message]
2008-05-02 17:13 ` Vladimir Prus
[not found] ` <481B4FDC.4010802@windriver.com>
2008-05-02 17:36 ` Vladimir Prus
2008-05-02 18:00 ` Pawel Piech
2008-05-02 18:19 ` Vladimir Prus
2008-05-02 18:36 ` Pawel Piech
2008-04-29 3:14 ` Pawel Piech
[not found] ` <200804301059.44112.vladimir@codesourcery.com>
[not found] ` <200804301534.48779.pedro@codesourcery.com>
2008-05-01 17:22 ` Vladimir Prus
2008-05-01 17:52 ` Pedro Alves
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=481B4830.9040909@windriver.com \
--to=pawel.piech@windriver.com \
--cc=gdb@sourceware.org \
--cc=marc.khouzam@ericsson.com \
--cc=pedro@codesourcery.com \
--cc=vladimir@codesourcery.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