Added context sensitive prompt for remote debugger. It now shows "> "
when the debuggee is running, and "dbg> " when the debuggee is stopped. Patch by Mark Lam from Hewlett-Packard Development Company, LP Review URL: http://codereview.chromium.org/5966004 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6126 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
0a128e5ae7
commit
cbfcef150a
@ -34,12 +34,21 @@
|
|||||||
|
|
||||||
namespace v8 {
|
namespace v8 {
|
||||||
|
|
||||||
void PrintPrompt() {
|
static bool was_running = true;
|
||||||
printf("dbg> ");
|
|
||||||
|
void PrintPrompt(bool is_running) {
|
||||||
|
const char* prompt = is_running? "> " : "dbg> ";
|
||||||
|
was_running = is_running;
|
||||||
|
printf("%s", prompt);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void PrintPrompt() {
|
||||||
|
PrintPrompt(was_running);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void HandleDebugEvent(DebugEvent event,
|
void HandleDebugEvent(DebugEvent event,
|
||||||
Handle<Object> exec_state,
|
Handle<Object> exec_state,
|
||||||
Handle<Object> event_data,
|
Handle<Object> event_data,
|
||||||
@ -91,7 +100,7 @@ void HandleDebugEvent(DebugEvent event,
|
|||||||
bool running = false;
|
bool running = false;
|
||||||
while (!running) {
|
while (!running) {
|
||||||
char command[kBufferSize];
|
char command[kBufferSize];
|
||||||
PrintPrompt();
|
PrintPrompt(running);
|
||||||
char* str = fgets(command, kBufferSize, stdin);
|
char* str = fgets(command, kBufferSize, stdin);
|
||||||
if (str == NULL) break;
|
if (str == NULL) break;
|
||||||
|
|
||||||
@ -284,7 +293,9 @@ void RemoteDebugger::HandleMessageReceived(char* message) {
|
|||||||
} else {
|
} else {
|
||||||
printf("???\n");
|
printf("???\n");
|
||||||
}
|
}
|
||||||
PrintPrompt();
|
|
||||||
|
bool is_running = details->Get(String::New("running"))->ToBoolean()->Value();
|
||||||
|
PrintPrompt(is_running);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user