Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(137)

Unified Diff: src/d8-debug.cc

Issue 1566049: Tweak D8 remote debugger... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/d8.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/d8-debug.cc
===================================================================
--- src/d8-debug.cc (revision 4430)
+++ src/d8-debug.cc (working copy)
@@ -34,7 +34,12 @@
namespace v8 {
+void PrintPrompt() {
+ printf("dbg> ");
+ fflush(stdout);
+}
+
void HandleDebugEvent(DebugEvent event,
Handle<Object> exec_state,
Handle<Object> event_data,
@@ -86,7 +91,7 @@
bool running = false;
while (!running) {
char command[kBufferSize];
- printf("dbg> ");
+ PrintPrompt();
char* str = fgets(command, kBufferSize, stdin);
if (str == NULL) break;
@@ -178,6 +183,7 @@
// Start the keyboard thread.
KeyboardThread keyboard(this);
keyboard.Start();
+ PrintPrompt();
// Process events received from debugged VM and from the keyboard.
bool terminate = false;
@@ -264,7 +270,8 @@
Handle<Object> details =
Shell::DebugMessageDetails(Handle<String>::Cast(String::New(message)));
if (try_catch.HasCaught()) {
- Shell::ReportException(&try_catch);
+ Shell::ReportException(&try_catch);
+ PrintPrompt();
return;
}
String::Utf8Value str(details->Get(String::New("text")));
@@ -277,7 +284,7 @@
} else {
printf("???\n");
}
- printf("dbg> ");
+ PrintPrompt();
}
@@ -289,13 +296,17 @@
Handle<Value> request =
Shell::DebugCommandToJSONRequest(String::New(command));
if (try_catch.HasCaught()) {
- Shell::ReportException(&try_catch);
+ v8::String::Utf8Value exception(try_catch.Exception());
+ const char* exception_string = Shell::ToCString(exception);
+ printf("%s\n", exception_string);
+ PrintPrompt();
return;
}
// If undefined is returned the command was handled internally and there is
// no JSON to send.
if (request->IsUndefined()) {
+ PrintPrompt();
return;
}
« no previous file with comments | « src/d8.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698