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