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

Side by Side Diff: src/debug/debug.h

Issue 2622253004: [inspector] introduced debug::SetBreakEventListener,SetExceptionEventListener (Closed)
Patch Set: ready for review 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 SetAsyncTaskListener(debug::AsyncTaskListener listener, void* data);
470 void SetCompileEventListener(debug::CompileEventListener listener, 470 void SetCompileEventListener(debug::CompileEventListener listener,
471 void* data); 471 void* data);
472 void SetBreakEventListener(debug::BreakEventListener listener, void* data);
473 void SetExceptionEventListener(debug::ExceptionEventListener listener,
474 void* data);
472 475
473 // Returns whether the operation succeeded. Compilation can only be triggered 476 // Returns whether the operation succeeded. Compilation can only be triggered
474 // if a valid closure is passed as the second argument, otherwise the shared 477 // if a valid closure is passed as the second argument, otherwise the shared
475 // function needs to be compiled already. 478 // function needs to be compiled already.
476 bool EnsureDebugInfo(Handle<SharedFunctionInfo> shared, 479 bool EnsureDebugInfo(Handle<SharedFunctionInfo> shared,
477 Handle<JSFunction> function); 480 Handle<JSFunction> function);
478 void CreateDebugInfo(Handle<SharedFunctionInfo> shared); 481 void CreateDebugInfo(Handle<SharedFunctionInfo> shared);
479 static Handle<DebugInfo> GetDebugInfo(Handle<SharedFunctionInfo> shared); 482 static Handle<DebugInfo> GetDebugInfo(Handle<SharedFunctionInfo> shared);
480 483
481 template <typename C> 484 template <typename C>
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 Handle<Context> debug_context_; 679 Handle<Context> debug_context_;
677 Handle<Object> event_listener_; 680 Handle<Object> event_listener_;
678 Handle<Object> event_listener_data_; 681 Handle<Object> event_listener_data_;
679 682
680 v8::Debug::MessageHandler message_handler_; 683 v8::Debug::MessageHandler message_handler_;
681 684
682 debug::AsyncTaskListener async_task_listener_ = nullptr; 685 debug::AsyncTaskListener async_task_listener_ = nullptr;
683 void* async_task_listener_data_ = nullptr; 686 void* async_task_listener_data_ = nullptr;
684 debug::CompileEventListener compile_event_listener_ = nullptr; 687 debug::CompileEventListener compile_event_listener_ = nullptr;
685 void* compile_event_listener_data_ = nullptr; 688 void* compile_event_listener_data_ = nullptr;
689 debug::BreakEventListener break_event_listener_ = nullptr;
690 void* break_event_listener_data_ = nullptr;
691 debug::ExceptionEventListener exception_event_listener_ = nullptr;
692 void* exception_event_listener_data_ = nullptr;
686 693
687 static const int kQueueInitialSize = 4; 694 static const int kQueueInitialSize = 4;
688 base::Semaphore command_received_; // Signaled for each command received. 695 base::Semaphore command_received_; // Signaled for each command received.
689 LockingCommandMessageQueue command_queue_; 696 LockingCommandMessageQueue command_queue_;
690 697
691 // Debugger is active, i.e. there is a debug event listener attached. 698 // Debugger is active, i.e. there is a debug event listener attached.
692 bool is_active_; 699 bool is_active_;
693 // Debugger needs to be notified on every new function call. 700 // Debugger needs to be notified on every new function call.
694 // Used for stepping and read-only checks 701 // Used for stepping and read-only checks
695 bool hook_on_function_call_; 702 bool hook_on_function_call_;
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
887 Handle<Code> code); 894 Handle<Code> code);
888 static bool DebugBreakSlotIsPatched(Address pc); 895 static bool DebugBreakSlotIsPatched(Address pc);
889 static void ClearDebugBreakSlot(Isolate* isolate, Address pc); 896 static void ClearDebugBreakSlot(Isolate* isolate, Address pc);
890 }; 897 };
891 898
892 899
893 } // namespace internal 900 } // namespace internal
894 } // namespace v8 901 } // namespace v8
895 902
896 #endif // V8_DEBUG_DEBUG_H_ 903 #endif // V8_DEBUG_DEBUG_H_
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/debug/debug.cc » ('j') | src/inspector/v8-debugger.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698