OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
803 } else if ((event == v8::ScriptCollected) && | 803 } else if ((event == v8::ScriptCollected) && |
804 !FLAG_debug_script_collected_events) { | 804 !FLAG_debug_script_collected_events) { |
805 return false; | 805 return false; |
806 } | 806 } |
807 | 807 |
808 // Currently argument event is not used. | 808 // Currently argument event is not used. |
809 return !compiling_natives_ && Debugger::IsDebuggerActive(); | 809 return !compiling_natives_ && Debugger::IsDebuggerActive(); |
810 } | 810 } |
811 | 811 |
812 void set_compiling_natives(bool compiling_natives) { | 812 void set_compiling_natives(bool compiling_natives) { |
813 Debugger::compiling_natives_ = compiling_natives; | 813 compiling_natives_ = compiling_natives; |
814 } | 814 } |
815 bool compiling_natives() const { return compiling_natives_; } | 815 bool compiling_natives() const { return compiling_natives_; } |
816 void set_loading_debugger(bool v) { is_loading_debugger_ = v; } | 816 void set_loading_debugger(bool v) { is_loading_debugger_ = v; } |
817 bool is_loading_debugger() const { return is_loading_debugger_; } | 817 bool is_loading_debugger() const { return is_loading_debugger_; } |
| 818 void set_force_debugger_active(bool force_debugger_active) { |
| 819 force_debugger_active_ = force_debugger_active; |
| 820 } |
| 821 bool force_debugger_active() const { return force_debugger_active_; } |
818 | 822 |
819 bool IsDebuggerActive(); | 823 bool IsDebuggerActive(); |
820 | 824 |
821 private: | 825 private: |
822 explicit Debugger(Isolate* isolate); | 826 explicit Debugger(Isolate* isolate); |
823 | 827 |
824 void CallEventCallback(v8::DebugEvent event, | 828 void CallEventCallback(v8::DebugEvent event, |
825 Handle<Object> exec_state, | 829 Handle<Object> exec_state, |
826 Handle<Object> event_data, | 830 Handle<Object> event_data, |
827 v8::Debug::ClientData* client_data); | 831 v8::Debug::ClientData* client_data); |
828 void CallCEventCallback(v8::DebugEvent event, | 832 void CallCEventCallback(v8::DebugEvent event, |
829 Handle<Object> exec_state, | 833 Handle<Object> exec_state, |
830 Handle<Object> event_data, | 834 Handle<Object> event_data, |
831 v8::Debug::ClientData* client_data); | 835 v8::Debug::ClientData* client_data); |
832 void CallJSEventCallback(v8::DebugEvent event, | 836 void CallJSEventCallback(v8::DebugEvent event, |
833 Handle<Object> exec_state, | 837 Handle<Object> exec_state, |
834 Handle<Object> event_data); | 838 Handle<Object> event_data); |
835 void ListenersChanged(); | 839 void ListenersChanged(); |
836 | 840 |
837 Mutex* debugger_access_; // Mutex guarding debugger variables. | 841 Mutex* debugger_access_; // Mutex guarding debugger variables. |
838 Handle<Object> event_listener_; // Global handle to listener. | 842 Handle<Object> event_listener_; // Global handle to listener. |
839 Handle<Object> event_listener_data_; | 843 Handle<Object> event_listener_data_; |
840 bool compiling_natives_; // Are we compiling natives? | 844 bool compiling_natives_; // Are we compiling natives? |
841 bool is_loading_debugger_; // Are we loading the debugger? | 845 bool is_loading_debugger_; // Are we loading the debugger? |
842 bool never_unload_debugger_; // Can we unload the debugger? | 846 bool never_unload_debugger_; // Can we unload the debugger? |
| 847 bool force_debugger_active_; // Activate debugger without event listeners. |
843 v8::Debug::MessageHandler2 message_handler_; | 848 v8::Debug::MessageHandler2 message_handler_; |
844 bool debugger_unload_pending_; // Was message handler cleared? | 849 bool debugger_unload_pending_; // Was message handler cleared? |
845 v8::Debug::HostDispatchHandler host_dispatch_handler_; | 850 v8::Debug::HostDispatchHandler host_dispatch_handler_; |
846 Mutex* dispatch_handler_access_; // Mutex guarding dispatch handler. | 851 Mutex* dispatch_handler_access_; // Mutex guarding dispatch handler. |
847 v8::Debug::DebugMessageDispatchHandler debug_message_dispatch_handler_; | 852 v8::Debug::DebugMessageDispatchHandler debug_message_dispatch_handler_; |
848 MessageDispatchHelperThread* message_dispatch_helper_thread_; | 853 MessageDispatchHelperThread* message_dispatch_helper_thread_; |
849 int host_dispatch_micros_; | 854 int host_dispatch_micros_; |
850 | 855 |
851 DebuggerAgent* agent_; | 856 DebuggerAgent* agent_; |
852 | 857 |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
974 | 979 |
975 DISALLOW_COPY_AND_ASSIGN(MessageDispatchHelperThread); | 980 DISALLOW_COPY_AND_ASSIGN(MessageDispatchHelperThread); |
976 }; | 981 }; |
977 | 982 |
978 | 983 |
979 } } // namespace v8::internal | 984 } } // namespace v8::internal |
980 | 985 |
981 #endif // ENABLE_DEBUGGER_SUPPORT | 986 #endif // ENABLE_DEBUGGER_SUPPORT |
982 | 987 |
983 #endif // V8_DEBUG_H_ | 988 #endif // V8_DEBUG_H_ |
OLD | NEW |