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/debug/debug.h

Issue 2622253004: [inspector] introduced debug::SetBreakEventListener,SetExceptionEventListener (Closed)
Patch Set: addressed comments Created 3 years, 11 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_DEBUG_DEBUG_H_ 5 #ifndef V8_DEBUG_DEBUG_H_
6 #define V8_DEBUG_DEBUG_H_ 6 #define V8_DEBUG_DEBUG_H_
7 7
8 #include "src/allocation.h" 8 #include "src/allocation.h"
9 #include "src/arguments.h" 9 #include "src/arguments.h"
10 #include "src/assembler.h" 10 #include "src/assembler.h"
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 bool is_event_; // Does this message represent a debug event? 279 bool is_event_; // Does this message represent a debug event?
280 DebugEvent event_; // Debug event causing the break. 280 DebugEvent event_; // Debug event causing the break.
281 bool running_; // Will the VM start running after this event? 281 bool running_; // Will the VM start running after this event?
282 Handle<JSObject> exec_state_; // Current execution state. 282 Handle<JSObject> exec_state_; // Current execution state.
283 Handle<JSObject> event_data_; // Data associated with the event. 283 Handle<JSObject> event_data_; // Data associated with the event.
284 Handle<String> response_json_; // Response JSON if message holds a response. 284 Handle<String> response_json_; // Response JSON if message holds a response.
285 v8::Debug::ClientData* client_data_; // Client data passed with the request. 285 v8::Debug::ClientData* client_data_; // Client data passed with the request.
286 }; 286 };
287 287
288 // Details of the debug event delivered to the debug event listener. 288 // Details of the debug event delivered to the debug event listener.
289 class EventDetailsImpl : public debug::EventDetails { 289 class EventDetailsImpl : public v8::Debug::EventDetails {
290 public: 290 public:
291 EventDetailsImpl(DebugEvent event, 291 EventDetailsImpl(DebugEvent event,
292 Handle<JSObject> exec_state, 292 Handle<JSObject> exec_state,
293 Handle<JSObject> event_data, 293 Handle<JSObject> event_data,
294 Handle<Object> callback_data, 294 Handle<Object> callback_data,
295 v8::Debug::ClientData* client_data); 295 v8::Debug::ClientData* client_data);
296 virtual DebugEvent GetEvent() const; 296 virtual DebugEvent GetEvent() const;
297 virtual v8::Local<v8::Object> GetExecutionState() const; 297 virtual v8::Local<v8::Object> GetExecutionState() const;
298 virtual v8::Local<v8::Object> GetEventData() const; 298 virtual v8::Local<v8::Object> GetEventData() const;
299 virtual v8::Local<v8::Context> GetEventContext() const; 299 virtual v8::Local<v8::Context> GetEventContext() const;
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 void ClearStepOut(); 459 void ClearStepOut();
460 460
461 bool PrepareFunctionForBreakPoints(Handle<SharedFunctionInfo> shared); 461 bool PrepareFunctionForBreakPoints(Handle<SharedFunctionInfo> shared);
462 bool GetPossibleBreakpoints(Handle<Script> script, int start_position, 462 bool GetPossibleBreakpoints(Handle<Script> script, int start_position,
463 int end_position, std::set<int>* positions); 463 int end_position, std::set<int>* positions);
464 464
465 void RecordGenerator(Handle<JSGeneratorObject> generator_object); 465 void RecordGenerator(Handle<JSGeneratorObject> generator_object);
466 466
467 int NextAsyncTaskId(Handle<JSObject> promise); 467 int NextAsyncTaskId(Handle<JSObject> promise);
468 468
469 void SetAsyncTaskListener(debug::AsyncTaskListener listener, void* data); 469 void SetDebugEventListener(debug::DebugEventListener* listener);
470 void SetCompileEventListener(debug::CompileEventListener listener,
471 void* data);
472 470
473 // Returns whether the operation succeeded. Compilation can only be triggered 471 // Returns whether the operation succeeded. Compilation can only be triggered
474 // if a valid closure is passed as the second argument, otherwise the shared 472 // if a valid closure is passed as the second argument, otherwise the shared
475 // function needs to be compiled already. 473 // function needs to be compiled already.
476 bool EnsureDebugInfo(Handle<SharedFunctionInfo> shared, 474 bool EnsureDebugInfo(Handle<SharedFunctionInfo> shared,
477 Handle<JSFunction> function); 475 Handle<JSFunction> function);
478 void CreateDebugInfo(Handle<SharedFunctionInfo> shared); 476 void CreateDebugInfo(Handle<SharedFunctionInfo> shared);
479 static Handle<DebugInfo> GetDebugInfo(Handle<SharedFunctionInfo> shared); 477 static Handle<DebugInfo> GetDebugInfo(Handle<SharedFunctionInfo> shared);
480 478
481 template <typename C> 479 template <typename C>
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 670
673 void PrintBreakLocation(); 671 void PrintBreakLocation();
674 672
675 // Global handles. 673 // Global handles.
676 Handle<Context> debug_context_; 674 Handle<Context> debug_context_;
677 Handle<Object> event_listener_; 675 Handle<Object> event_listener_;
678 Handle<Object> event_listener_data_; 676 Handle<Object> event_listener_data_;
679 677
680 v8::Debug::MessageHandler message_handler_; 678 v8::Debug::MessageHandler message_handler_;
681 679
682 debug::AsyncTaskListener async_task_listener_ = nullptr; 680 debug::DebugEventListener* debug_event_listener_ = nullptr;
683 void* async_task_listener_data_ = nullptr;
684 debug::CompileEventListener compile_event_listener_ = nullptr;
685 void* compile_event_listener_data_ = nullptr;
686 681
687 static const int kQueueInitialSize = 4; 682 static const int kQueueInitialSize = 4;
688 base::Semaphore command_received_; // Signaled for each command received. 683 base::Semaphore command_received_; // Signaled for each command received.
689 LockingCommandMessageQueue command_queue_; 684 LockingCommandMessageQueue command_queue_;
690 685
691 // Debugger is active, i.e. there is a debug event listener attached. 686 // Debugger is active, i.e. there is a debug event listener attached.
692 bool is_active_; 687 bool is_active_;
693 // Debugger needs to be notified on every new function call. 688 // Debugger needs to be notified on every new function call.
694 // Used for stepping and read-only checks 689 // Used for stepping and read-only checks
695 bool hook_on_function_call_; 690 bool hook_on_function_call_;
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
887 Handle<Code> code); 882 Handle<Code> code);
888 static bool DebugBreakSlotIsPatched(Address pc); 883 static bool DebugBreakSlotIsPatched(Address pc);
889 static void ClearDebugBreakSlot(Isolate* isolate, Address pc); 884 static void ClearDebugBreakSlot(Isolate* isolate, Address pc);
890 }; 885 };
891 886
892 887
893 } // namespace internal 888 } // namespace internal
894 } // namespace v8 889 } // namespace v8
895 890
896 #endif // V8_DEBUG_DEBUG_H_ 891 #endif // V8_DEBUG_DEBUG_H_
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/debug/debug.cc » ('j') | src/debug/debug.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698