/* TID parsing for GDB, the GNU debugger.
- Copyright (C) 2015-2019 Free Software Foundation, Inc.
+ Copyright (C) 2015-2022 Free Software Foundation, Inc.
This file is part of GDB.
switch (m_state)
{
case STATE_INFERIOR:
- return *m_cur_tok == '\0';
+ /* Parsing is finished when at end of string or null string,
+ or we are not in a range and not in front of an integer, negative
+ integer, convenience var or negative convenience var. */
+ return (*m_cur_tok == '\0'
+ || !(isdigit (*m_cur_tok)
+ || *m_cur_tok == '$'
+ || *m_cur_tok == '*'));
case STATE_THREAD_RANGE:
case STATE_STAR_RANGE:
return m_range_parser.finished ();
}
- gdb_assert_not_reached (_("unhandled state"));
+ gdb_assert_not_reached ("unhandled state");
}
/* See tid-parse.h. */
return m_range_parser.cur_tok ();
}
- gdb_assert_not_reached (_("unhandled state"));
+ gdb_assert_not_reached ("unhandled state");
}
void
return m_state == STATE_STAR_RANGE;
}
+bool
+tid_range_parser::in_thread_range () const
+{
+ return m_state == STATE_THREAD_RANGE;
+}
+
/* See tid-parse.h. */
int
return 1;
tid_range_parser parser (list, default_inferior);
+ if (parser.finished ())
+ invalid_thread_id_error (parser.cur_tok ());
while (!parser.finished ())
{
int tmp_inf, tmp_thr_start, tmp_thr_end;