Debugger CliContext: More event handling, current thread

* Introduce the notion of a current thread. That's the one certain
  commands will target (by default).
* Add more event handling in CliContext. There's now a queue of pending
  events which are printed in the input loop at convenient times to
  inform the user about what happened (new/deleted/stopped threads,
  etc.).
This commit is contained in:
Ingo Weinhold
2012-08-05 01:07:17 +02:00
parent 59dbbd147e
commit 86b1039b42
3 changed files with 203 additions and 10 deletions
@@ -214,9 +214,19 @@ CommandLineUserInterface::_InputLoopEntry(void* data)
status_t
CommandLineUserInterface::_InputLoop()
{
thread_id currentThread = -1;
while (!fTerminating) {
// Wait for a thread or Ctrl-C.
fContext.WaitForThreadOrUser();
if (fContext.IsTerminating())
break;
// Print the active thread, if it changed.
if (fContext.CurrentThreadID() != currentThread) {
fContext.PrintCurrentThread();
currentThread = fContext.CurrentThreadID();
}
// read a command line
const char* line = fContext.PromptUser(kDebuggerPrompt);