Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Pawel Piech <pawel.piech@windriver.com>
To: Vladimir Prus <vladimir@codesourcery.com>
Cc: gdb@sourceware.org
Subject: Re: Non-stop multi-threaded debugging
Date: Thu, 29 Nov 2007 18:13:00 -0000	[thread overview]
Message-ID: <474F012A.8010503@windriver.com> (raw)
In-Reply-To: <200711292051.01519.vladimir@codesourcery.com>

Vladimir Prus wrote:
> On Thursday 29 November 2007 20:36:18 Pawel Piech wrote:
>   
>> Vladimir Prus wrote:
>>     
>>> On Thursday 29 November 2007 19:39:18 Pawel Piech wrote:
>>>
>>>   
>>>       
>>>>  I don't believe that I suggested adding any new command.
>>>>  Instead, I suggested only changing the behavior of 
>>>>  some of the existing commands to use the currently selected thread.
>>>>  It was Jim's proposal that included adding new commands.
>>>>  My point was that instead of adding new commands it would be cleaner
>>>>  to extend the functionality of -thread-select in order to select 
>>>>  a process context, i.e. a context that includes all threads. 
>>>>  This way existing commands, which currently can only operate
>>>>  on a global context, could now operate on a process or a thread context.        
>>>>     
>>>>         
>>> Ok, we have those choices:
>>>
>>> 1. Make -exec-continue work on all threads, until -thread-select is used.
>>> 2. Make -exec-continue work on one thread, and add another command
>>> to operate on all threads.
>>> 3. Make -exec-continue still operate on all threads, unless
>>> and explicit option to make it operate on a thread is given.
>>>
>>> You've indicated that (1) and (3) are about the same in complexity for you --
>>> am I right? 
>>>       
>> This is correct.
>>     
>>> I personally prefer (3), since it does not implicitly changes
>>> the meaning of existing commands.
>>>
>>> Surely, non-stop mode does require some changes in frontend, but the
>>> fewer changes are, the better, IMO.
>>>
>>> - Volodya
>>>   
>>>       
>> In that case I'll try to convince you otherwise :-)
>>
>> -exec-continue is not the only command that would need to be modified.  
>> -exec-interrupt, would all need to take the -p parameter, and in order 
>> to implement multi-process debugging, many of the commands that 
>> currently operate on a global context (too many to try to list) would 
>> all require an additional parameter to specify which process they are to 
>> act on.  There seems to be a well established paradigm in the MI (and 
>> CLI) protocol, where special commands: -thread-select and 
>> -stack-frame-select change the state of the protocol so that commands 
>> following these operate on the context selected by these commands.  
>>     
>
> There are different opinions about those commands ;-) For example, I believe
> that stateless protocol would be much easier.
>
>   
I completely agree with you, for a "machine interface" a stateless 
protocol would be much easier to use.  But GDB/MI is what it is and at 
this point trying to make it stateless would probably be counter productive.
>> My  
>> main point is to extend the functionality of these state-changing 
>> commands in order to add the ability to select an active context, and to 
>> select a context which will allow commands to operate on all the threads 
>> of a process. 
>>
>> IMO, the question of whether -exec-continue takes a -p argument is a 
>> rather minor one.  But for sake of consistency with other -exec-* 
>> commands I think it would be a mistake to add this parameter.  That's 
>> because the stepping commands already do operate on the currently 
>> selected thread.  While all the threads are resumed when stepping, 
>> execution does not stop until the next line of code is reached by the 
>> thread that was selected.  With non-stop debugging, stepping commands 
>> will continue to operate on the selected thread with the difference that 
>> other suspended threads will remain suspended.  
>>     
>
> Interesting. Presently, in CLI gdb set 'scheduler mode' that controls
> if step resumes all thread, or not. MI does not have a counterpart of that.
> Maybe, we should start by changing -exec-step to accept a thread parameter, too,
> which would mean "step only this thread, keep others suspended". Then,
> -exec-continue taking thread parameter will be quite consistent with -exec-step.
> I would say such change to -exec-step will be valuable in itself.
>
> - Volodya
>   
I'm rather confused here.  I thought that the point of non-stop 
multi-threaded debugging was to allow for this behavior.  Is "scheduler 
mode" some kind of partial implementation?  Either way though, I have no 
opinion whether it would be useful for the command line user to be able 
to specify the scheduling mode as an option to individual commands, but 
in an IDE such behavior would most likely be controlled with a toggle 
button, so a mode switch command would be sufficient.  If -exec-step 
would take a -p parameter to determine whether to resume all threads, 
then -exec-step without -p would still operate on the selected thread, 
in that it would suspend the process only when the selected thread 
reached the next line.  IHMO, this would only add to the confusion.

Cheers,
Pawel


  reply	other threads:[~2007-11-29 18:13 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-28  5:18 Pawel Piech
2007-11-29  2:08 ` Nick Roberts
2007-11-29  6:15   ` Pawel Piech
2007-11-29  6:46     ` gdb over RNDIS to PDA Steve DeLaney
2007-11-29  8:36     ` Non-stop multi-threaded debugging Vladimir Prus
2007-11-29 16:42       ` Pawel Piech
     [not found]       ` <474EEB36.1040203@windriver.com>
2007-11-29 16:46         ` Vladimir Prus
2007-11-29 17:36           ` Pawel Piech
2007-11-29 17:51             ` Vladimir Prus
2007-11-29 18:13               ` Pawel Piech [this message]
2007-12-04 18:34 ` Jim Blandy
2007-12-04 23:05   ` Pawel Piech
2007-12-05 21:52     ` Jim Blandy
  -- strict thread matches above, loose matches on Subject: below --
2007-11-20 17:21 Nathan Sidwell
2007-11-20 19:28 ` Nick Roberts
2007-11-20 20:12   ` Jim Blandy
2007-11-21 13:53 ` Michael Snyder
2007-11-26 23:13 ` Jim Blandy
2007-11-27 16:42 ` Ulrich Weigand
2007-11-30 20:48 ` Thiago Jung Bauermann
2007-12-04 18:17   ` Jim Blandy
2007-12-05 13:41     ` Fabian Cenedese
2007-12-05 20:01 ` Nigel Stephens

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=474F012A.8010503@windriver.com \
    --to=pawel.piech@windriver.com \
    --cc=gdb@sourceware.org \
    --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