OLD | NEW |
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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 void ClearStepOut(); | 349 void ClearStepOut(); |
350 | 350 |
351 bool PrepareFunctionForBreakPoints(Handle<SharedFunctionInfo> shared); | 351 bool PrepareFunctionForBreakPoints(Handle<SharedFunctionInfo> shared); |
352 bool GetPossibleBreakpoints(Handle<Script> script, int start_position, | 352 bool GetPossibleBreakpoints(Handle<Script> script, int start_position, |
353 int end_position, std::set<int>* positions); | 353 int end_position, std::set<int>* positions); |
354 | 354 |
355 void RecordGenerator(Handle<JSGeneratorObject> generator_object); | 355 void RecordGenerator(Handle<JSGeneratorObject> generator_object); |
356 | 356 |
357 int NextAsyncTaskId(Handle<JSObject> promise); | 357 int NextAsyncTaskId(Handle<JSObject> promise); |
358 | 358 |
359 void SetDebugEventListener(debug::DebugEventListener* listener); | 359 bool IsBlackboxed(Handle<SharedFunctionInfo> shared); |
| 360 |
| 361 void SetDebugDelegate(debug::DebugDelegate* delegate); |
360 | 362 |
361 // Returns whether the operation succeeded. Compilation can only be triggered | 363 // Returns whether the operation succeeded. Compilation can only be triggered |
362 // if a valid closure is passed as the second argument, otherwise the shared | 364 // if a valid closure is passed as the second argument, otherwise the shared |
363 // function needs to be compiled already. | 365 // function needs to be compiled already. |
364 bool EnsureDebugInfo(Handle<SharedFunctionInfo> shared, | 366 bool EnsureDebugInfo(Handle<SharedFunctionInfo> shared, |
365 Handle<JSFunction> function); | 367 Handle<JSFunction> function); |
366 void CreateDebugInfo(Handle<SharedFunctionInfo> shared); | 368 void CreateDebugInfo(Handle<SharedFunctionInfo> shared); |
367 static Handle<DebugInfo> GetDebugInfo(Handle<SharedFunctionInfo> shared); | 369 static Handle<DebugInfo> GetDebugInfo(Handle<SharedFunctionInfo> shared); |
368 | 370 |
369 template <typename C> | 371 template <typename C> |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 // JavaScript event listener and C++ event listener. | 489 // JavaScript event listener and C++ event listener. |
488 // Currently inspector still uses C++ event listener and installs | 490 // Currently inspector still uses C++ event listener and installs |
489 // more specific event listeners for part of events. Calling of | 491 // more specific event listeners for part of events. Calling of |
490 // C++ event listener is redundant when more specific event listener | 492 // C++ event listener is redundant when more specific event listener |
491 // is presented. Other clients can install JavaScript event listener | 493 // is presented. Other clients can install JavaScript event listener |
492 // (e.g. some of NodeJS module). | 494 // (e.g. some of NodeJS module). |
493 bool non_inspector_listener_exists() const { | 495 bool non_inspector_listener_exists() const { |
494 return !event_listener_.is_null() && !event_listener_->IsForeign(); | 496 return !event_listener_.is_null() && !event_listener_->IsForeign(); |
495 } | 497 } |
496 | 498 |
| 499 bool IsBlackboxed(SharedFunctionInfo* shared); |
| 500 |
497 void OnException(Handle<Object> exception, Handle<Object> promise); | 501 void OnException(Handle<Object> exception, Handle<Object> promise); |
498 | 502 |
499 // Constructors for debug event objects. | 503 // Constructors for debug event objects. |
500 MUST_USE_RESULT MaybeHandle<Object> MakeExecutionState(); | 504 MUST_USE_RESULT MaybeHandle<Object> MakeExecutionState(); |
501 MUST_USE_RESULT MaybeHandle<Object> MakeBreakEvent( | 505 MUST_USE_RESULT MaybeHandle<Object> MakeBreakEvent( |
502 Handle<Object> break_points_hit); | 506 Handle<Object> break_points_hit); |
503 MUST_USE_RESULT MaybeHandle<Object> MakeExceptionEvent( | 507 MUST_USE_RESULT MaybeHandle<Object> MakeExceptionEvent( |
504 Handle<Object> exception, | 508 Handle<Object> exception, |
505 bool uncaught, | 509 bool uncaught, |
506 Handle<Object> promise); | 510 Handle<Object> promise); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
547 | 551 |
548 void ThreadInit(); | 552 void ThreadInit(); |
549 | 553 |
550 void PrintBreakLocation(); | 554 void PrintBreakLocation(); |
551 | 555 |
552 // Global handles. | 556 // Global handles. |
553 Handle<Context> debug_context_; | 557 Handle<Context> debug_context_; |
554 Handle<Object> event_listener_; | 558 Handle<Object> event_listener_; |
555 Handle<Object> event_listener_data_; | 559 Handle<Object> event_listener_data_; |
556 | 560 |
557 debug::DebugEventListener* debug_event_listener_ = nullptr; | 561 debug::DebugDelegate* debug_delegate_ = nullptr; |
558 | 562 |
559 // Debugger is active, i.e. there is a debug event listener attached. | 563 // Debugger is active, i.e. there is a debug event listener attached. |
560 bool is_active_; | 564 bool is_active_; |
561 // Debugger needs to be notified on every new function call. | 565 // Debugger needs to be notified on every new function call. |
562 // Used for stepping and read-only checks | 566 // Used for stepping and read-only checks |
563 bool hook_on_function_call_; | 567 bool hook_on_function_call_; |
564 // Suppress debug events. | 568 // Suppress debug events. |
565 bool is_suppressed_; | 569 bool is_suppressed_; |
566 // LiveEdit is enabled. | 570 // LiveEdit is enabled. |
567 bool live_edit_enabled_; | 571 bool live_edit_enabled_; |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
755 Handle<Code> code); | 759 Handle<Code> code); |
756 static bool DebugBreakSlotIsPatched(Address pc); | 760 static bool DebugBreakSlotIsPatched(Address pc); |
757 static void ClearDebugBreakSlot(Isolate* isolate, Address pc); | 761 static void ClearDebugBreakSlot(Isolate* isolate, Address pc); |
758 }; | 762 }; |
759 | 763 |
760 | 764 |
761 } // namespace internal | 765 } // namespace internal |
762 } // namespace v8 | 766 } // namespace v8 |
763 | 767 |
764 #endif // V8_DEBUG_DEBUG_H_ | 768 #endif // V8_DEBUG_DEBUG_H_ |
OLD | NEW |