public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* Insufficient documentation of struct thread_info
@ 2015-06-10 15:24 Eli Zaretskii
  2015-06-15 14:31 ` Pedro Alves
  0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2015-06-10 15:24 UTC (permalink / raw)
  To: gdb-patches

As result of this thread:

  https://sourceware.org/ml/gdb/2015-03/msg00024.html

I looked at the above-mentioned structure and found there this:

  struct thread_info
  {
    [...]

    /* Non-zero means the thread is executing.  Note: this is different
       from saying that there is an active target and we are stopped at
       a breakpoint, for instance.  This is a real indicator whether the
       thread is off and running.  */
    int executing;

    /* Frontend view of the thread state.  Note that the THREAD_RUNNING/
       THREAD_STOPPED states are different from EXECUTING.  When the
       thread is stopped internally while handling an internal event,
       like a software single-step breakpoint, EXECUTING will be false,
       but STATE will still be THREAD_RUNNING.  */
    enum thread_state state;

I think the semantics of these two fields and the difference between
'executing' being non-zero and 'state' being THREAD_RUNNING are
insufficiently and even confusingly explained in the comments.  At
least I couldn't figure out why we set each one from different parts
of code and under different conditions.  The significance of "software
single-step breakpoint" mentioned in the comment and what exactly
counts as "internal events" is left unclear.

Could someone please clarify these comments?  TIA.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-06-15 17:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-10 15:24 Insufficient documentation of struct thread_info Eli Zaretskii
2015-06-15 14:31 ` Pedro Alves
2015-06-15 17:04   ` Eli Zaretskii

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).