| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 5391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5402 // Evaluate dog() finishes. | 5402 // Evaluate dog() finishes. |
| 5403 breakpoints_barriers->semaphore_1.Wait(); | 5403 breakpoints_barriers->semaphore_1.Wait(); |
| 5404 // Must have result 116. | 5404 // Must have result 116. |
| 5405 CHECK_EQ(116, evaluate_int_result); | 5405 CHECK_EQ(116, evaluate_int_result); |
| 5406 // 9: Continue evaluation of source2, reach end. | 5406 // 9: Continue evaluation of source2, reach end. |
| 5407 v8::Debug::SendCommand(isolate, buffer, AsciiToUtf16(command_8, buffer)); | 5407 v8::Debug::SendCommand(isolate, buffer, AsciiToUtf16(command_8, buffer)); |
| 5408 } | 5408 } |
| 5409 | 5409 |
| 5410 | 5410 |
| 5411 void TestRecursiveBreakpointsGeneric(bool global_evaluate) { | 5411 void TestRecursiveBreakpointsGeneric(bool global_evaluate) { |
| 5412 i::FLAG_debugger_auto_break = true; | |
| 5413 | |
| 5414 BreakpointsDebuggerThread breakpoints_debugger_thread(global_evaluate); | 5412 BreakpointsDebuggerThread breakpoints_debugger_thread(global_evaluate); |
| 5415 BreakpointsV8Thread breakpoints_v8_thread; | 5413 BreakpointsV8Thread breakpoints_v8_thread; |
| 5416 | 5414 |
| 5417 // Create a V8 environment | 5415 // Create a V8 environment |
| 5418 Barriers stack_allocated_breakpoints_barriers; | 5416 Barriers stack_allocated_breakpoints_barriers; |
| 5419 breakpoints_barriers = &stack_allocated_breakpoints_barriers; | 5417 breakpoints_barriers = &stack_allocated_breakpoints_barriers; |
| 5420 | 5418 |
| 5421 breakpoints_v8_thread.Start(); | 5419 breakpoints_v8_thread.Start(); |
| 5422 breakpoints_debugger_thread.Start(); | 5420 breakpoints_debugger_thread.Start(); |
| 5423 | 5421 |
| (...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5874 // Wait for host dispatch to be processed. | 5872 // Wait for host dispatch to be processed. |
| 5875 host_dispatch_barriers->semaphore_1.Wait(); | 5873 host_dispatch_barriers->semaphore_1.Wait(); |
| 5876 // 2: Continue evaluation | 5874 // 2: Continue evaluation |
| 5877 v8::Debug::SendCommand(isolate, buffer, AsciiToUtf16(command_2, buffer)); | 5875 v8::Debug::SendCommand(isolate, buffer, AsciiToUtf16(command_2, buffer)); |
| 5878 } | 5876 } |
| 5879 | 5877 |
| 5880 | 5878 |
| 5881 TEST(DebuggerHostDispatch) { | 5879 TEST(DebuggerHostDispatch) { |
| 5882 HostDispatchDebuggerThread host_dispatch_debugger_thread; | 5880 HostDispatchDebuggerThread host_dispatch_debugger_thread; |
| 5883 HostDispatchV8Thread host_dispatch_v8_thread; | 5881 HostDispatchV8Thread host_dispatch_v8_thread; |
| 5884 i::FLAG_debugger_auto_break = true; | |
| 5885 | 5882 |
| 5886 // Create a V8 environment | 5883 // Create a V8 environment |
| 5887 Barriers stack_allocated_host_dispatch_barriers; | 5884 Barriers stack_allocated_host_dispatch_barriers; |
| 5888 host_dispatch_barriers = &stack_allocated_host_dispatch_barriers; | 5885 host_dispatch_barriers = &stack_allocated_host_dispatch_barriers; |
| 5889 | 5886 |
| 5890 host_dispatch_v8_thread.Start(); | 5887 host_dispatch_v8_thread.Start(); |
| 5891 host_dispatch_debugger_thread.Start(); | 5888 host_dispatch_debugger_thread.Start(); |
| 5892 | 5889 |
| 5893 host_dispatch_v8_thread.Join(); | 5890 host_dispatch_v8_thread.Join(); |
| 5894 host_dispatch_debugger_thread.Join(); | 5891 host_dispatch_debugger_thread.Join(); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5941 debug_message_dispatch_barriers->barrier_1.Wait(); | 5938 debug_message_dispatch_barriers->barrier_1.Wait(); |
| 5942 SendContinueCommand(); | 5939 SendContinueCommand(); |
| 5943 debug_message_dispatch_barriers->barrier_2.Wait(); | 5940 debug_message_dispatch_barriers->barrier_2.Wait(); |
| 5944 } | 5941 } |
| 5945 | 5942 |
| 5946 | 5943 |
| 5947 TEST(DebuggerDebugMessageDispatch) { | 5944 TEST(DebuggerDebugMessageDispatch) { |
| 5948 DebugMessageDispatchDebuggerThread debug_message_dispatch_debugger_thread; | 5945 DebugMessageDispatchDebuggerThread debug_message_dispatch_debugger_thread; |
| 5949 DebugMessageDispatchV8Thread debug_message_dispatch_v8_thread; | 5946 DebugMessageDispatchV8Thread debug_message_dispatch_v8_thread; |
| 5950 | 5947 |
| 5951 i::FLAG_debugger_auto_break = true; | |
| 5952 | |
| 5953 // Create a V8 environment | 5948 // Create a V8 environment |
| 5954 Barriers stack_allocated_debug_message_dispatch_barriers; | 5949 Barriers stack_allocated_debug_message_dispatch_barriers; |
| 5955 debug_message_dispatch_barriers = | 5950 debug_message_dispatch_barriers = |
| 5956 &stack_allocated_debug_message_dispatch_barriers; | 5951 &stack_allocated_debug_message_dispatch_barriers; |
| 5957 | 5952 |
| 5958 debug_message_dispatch_v8_thread.Start(); | 5953 debug_message_dispatch_v8_thread.Start(); |
| 5959 debug_message_dispatch_debugger_thread.Start(); | 5954 debug_message_dispatch_debugger_thread.Start(); |
| 5960 | 5955 |
| 5961 debug_message_dispatch_v8_thread.Join(); | 5956 debug_message_dispatch_v8_thread.Join(); |
| 5962 debug_message_dispatch_debugger_thread.Join(); | 5957 debug_message_dispatch_debugger_thread.Join(); |
| (...skipping 1699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7662 CHECK(result->IsString()); | 7657 CHECK(result->IsString()); |
| 7663 v8::String::Utf8Value utf8(result); | 7658 v8::String::Utf8Value utf8(result); |
| 7664 CHECK_EQ("bar", *utf8); | 7659 CHECK_EQ("bar", *utf8); |
| 7665 | 7660 |
| 7666 v8::Debug::SetDebugEventListener2(NULL); | 7661 v8::Debug::SetDebugEventListener2(NULL); |
| 7667 CheckDebuggerUnloaded(); | 7662 CheckDebuggerUnloaded(); |
| 7668 } | 7663 } |
| 7669 | 7664 |
| 7670 | 7665 |
| 7671 #endif // ENABLE_DEBUGGER_SUPPORT | 7666 #endif // ENABLE_DEBUGGER_SUPPORT |
| OLD | NEW |