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

Side by Side Diff: src/d8-debug.cc

Issue 21076: Fixed the debugger compile events.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/d8.js ('k') | src/debug.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2008 the V8 project authors. All rights reserved. 1 // Copyright 2008 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
(...skipping 21 matching lines...) Expand all
32 32
33 namespace v8 { 33 namespace v8 {
34 34
35 35
36 void HandleDebugEvent(DebugEvent event, 36 void HandleDebugEvent(DebugEvent event,
37 Handle<Object> exec_state, 37 Handle<Object> exec_state,
38 Handle<Object> event_data, 38 Handle<Object> event_data,
39 Handle<Value> data) { 39 Handle<Value> data) {
40 HandleScope scope; 40 HandleScope scope;
41 41
42 // Currently only handles break and exception events. 42 // Check for handled event.
43 if (event != Break && event != Exception) return; 43 if (event != Break && event != Exception && event != AfterCompile) {
44 return;
45 }
44 46
45 TryCatch try_catch; 47 TryCatch try_catch;
46 48
47 // Print the event details. 49 // Print the event details.
48 Handle<String> details = Shell::DebugEventToText(event_data); 50 Handle<String> details = Shell::DebugEventToText(event_data);
51 if (details->Length() == 0) {
52 // Empty string is used to signal not to process this event.
53 return;
54 }
49 String::Utf8Value str(details); 55 String::Utf8Value str(details);
50 printf("%s\n", *str); 56 printf("%s\n", *str);
51 57
52 // Get the debug command processor. 58 // Get the debug command processor.
53 Local<String> fun_name = String::New("debugCommandProcessor"); 59 Local<String> fun_name = String::New("debugCommandProcessor");
54 Local<Function> fun = Function::Cast(*exec_state->Get(fun_name)); 60 Local<Function> fun = Function::Cast(*exec_state->Get(fun_name));
55 Local<Object> cmd_processor = 61 Local<Object> cmd_processor =
56 Object::Cast(*fun->Call(exec_state, 0, NULL)); 62 Object::Cast(*fun->Call(exec_state, 0, NULL));
57 if (try_catch.HasCaught()) { 63 if (try_catch.HasCaught()) {
58 Shell::ReportException(&try_catch); 64 Shell::ReportException(&try_catch);
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 if (text_str.length() > 0) { 121 if (text_str.length() > 0) {
116 printf("%s\n", *text_str); 122 printf("%s\n", *text_str);
117 } 123 }
118 running = 124 running =
119 response_details->Get(String::New("running"))->ToBoolean()->Value(); 125 response_details->Get(String::New("running"))->ToBoolean()->Value();
120 } 126 }
121 } 127 }
122 128
123 129
124 } // namespace v8 130 } // namespace v8
OLDNEW
« no previous file with comments | « src/d8.js ('k') | src/debug.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698