OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
11 // with the distribution. | 11 // with the distribution. |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 | 303 |
304 void RemoteDebugger::HandleKeyboardCommand(char* command) { | 304 void RemoteDebugger::HandleKeyboardCommand(char* command) { |
305 Locker lock; | 305 Locker lock; |
306 HandleScope scope; | 306 HandleScope scope; |
307 | 307 |
308 // Convert the debugger command to a JSON debugger request. | 308 // Convert the debugger command to a JSON debugger request. |
309 TryCatch try_catch; | 309 TryCatch try_catch; |
310 Handle<Value> request = | 310 Handle<Value> request = |
311 Shell::DebugCommandToJSONRequest(String::New(command)); | 311 Shell::DebugCommandToJSONRequest(String::New(command)); |
312 if (try_catch.HasCaught()) { | 312 if (try_catch.HasCaught()) { |
313 v8::String::Utf8Value exception(try_catch.Exception()); | 313 Shell::ReportException(&try_catch); |
314 const char* exception_string = Shell::ToCString(exception); | |
315 printf("%s\n", exception_string); | |
316 PrintPrompt(); | 314 PrintPrompt(); |
317 return; | 315 return; |
318 } | 316 } |
319 | 317 |
320 // If undefined is returned the command was handled internally and there is | 318 // If undefined is returned the command was handled internally and there is |
321 // no JSON to send. | 319 // no JSON to send. |
322 if (request->IsUndefined()) { | 320 if (request->IsUndefined()) { |
323 PrintPrompt(); | 321 PrintPrompt(); |
324 return; | 322 return; |
325 } | 323 } |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 // Pass the keyboard command to the main thread. | 361 // Pass the keyboard command to the main thread. |
364 remote_debugger_->KeyboardCommand( | 362 remote_debugger_->KeyboardCommand( |
365 i::SmartArrayPointer<char>(i::StrDup(command))); | 363 i::SmartArrayPointer<char>(i::StrDup(command))); |
366 } | 364 } |
367 } | 365 } |
368 | 366 |
369 | 367 |
370 } // namespace v8 | 368 } // namespace v8 |
371 | 369 |
372 #endif // ENABLE_DEBUGGER_SUPPORT | 370 #endif // ENABLE_DEBUGGER_SUPPORT |
OLD | NEW |