forked from Imagelibrary/binutils-gdb
gdb: new $_inferior_thread_count convenience variable
Add a new convenience variable $_inferior_thread_count that contains the number of live (non-exited) threads in the current inferior. This can be used in command scripts, or breakpoint conditions, etc to adjust the behaviour for multi-threaded inferiors. This value is only stable in all-stop mode. In non-stop mode, where new threads can be started, and existing threads exit, at any time, this convenience variable can give a different value each time it is evaluated.
This commit is contained in:
@@ -53,6 +53,10 @@ struct iterator_range
|
||||
IteratorType end () const
|
||||
{ return m_end; }
|
||||
|
||||
/* The number of items in this iterator_range. */
|
||||
std::size_t size () const
|
||||
{ return std::distance (m_begin, m_end); }
|
||||
|
||||
private:
|
||||
IteratorType m_begin, m_end;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user