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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user