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 4136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4147 f1->Call(env->Global(), 0, NULL); | 4147 f1->Call(env->Global(), 0, NULL); |
4148 f2->Call(env->Global(), 0, NULL); | 4148 f2->Call(env->Global(), 0, NULL); |
4149 f3->Call(env->Global(), 0, NULL); | 4149 f3->Call(env->Global(), 0, NULL); |
4150 | 4150 |
4151 // Set the debug break flag. | 4151 // Set the debug break flag. |
4152 v8::Debug::DebugBreak(env->GetIsolate()); | 4152 v8::Debug::DebugBreak(env->GetIsolate()); |
4153 CHECK(v8::Debug::CheckDebugBreak(env->GetIsolate())); | 4153 CHECK(v8::Debug::CheckDebugBreak(env->GetIsolate())); |
4154 | 4154 |
4155 // Call all functions with different argument count. | 4155 // Call all functions with different argument count. |
4156 break_point_hit_count = 0; | 4156 break_point_hit_count = 0; |
4157 for (unsigned int i = 0; i < ARRAY_SIZE(argv); i++) { | 4157 for (unsigned int i = 0; i < arraysize(argv); i++) { |
4158 f0->Call(env->Global(), i, argv); | 4158 f0->Call(env->Global(), i, argv); |
4159 f1->Call(env->Global(), i, argv); | 4159 f1->Call(env->Global(), i, argv); |
4160 f2->Call(env->Global(), i, argv); | 4160 f2->Call(env->Global(), i, argv); |
4161 f3->Call(env->Global(), i, argv); | 4161 f3->Call(env->Global(), i, argv); |
4162 } | 4162 } |
4163 | 4163 |
4164 // One break for each function called. | 4164 // One break for each function called. |
4165 CHECK_EQ(4 * ARRAY_SIZE(argv), break_point_hit_count); | 4165 CHECK_EQ(4 * arraysize(argv), break_point_hit_count); |
4166 | 4166 |
4167 // Get rid of the debug event listener. | 4167 // Get rid of the debug event listener. |
4168 v8::Debug::SetDebugEventListener(NULL); | 4168 v8::Debug::SetDebugEventListener(NULL); |
4169 CheckDebuggerUnloaded(); | 4169 CheckDebuggerUnloaded(); |
4170 } | 4170 } |
4171 | 4171 |
4172 | 4172 |
4173 // Test to ensure that JavaScript code keeps running while the debug break | 4173 // Test to ensure that JavaScript code keeps running while the debug break |
4174 // through the stack limit flag is set but breaks are disabled. | 4174 // through the stack limit flag is set but breaks are disabled. |
4175 TEST(DisableBreak) { | 4175 TEST(DisableBreak) { |
(...skipping 3228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7404 v8::Isolate* isolate = env->GetIsolate(); | 7404 v8::Isolate* isolate = env->GetIsolate(); |
7405 v8::HandleScope scope(isolate); | 7405 v8::HandleScope scope(isolate); |
7406 v8::Debug::SetDebugEventListener(DebugBreakTriggerTerminate); | 7406 v8::Debug::SetDebugEventListener(DebugBreakTriggerTerminate); |
7407 TerminationThread terminator(isolate); | 7407 TerminationThread terminator(isolate); |
7408 terminator.Start(); | 7408 terminator.Start(); |
7409 v8::TryCatch try_catch; | 7409 v8::TryCatch try_catch; |
7410 v8::Debug::DebugBreak(isolate); | 7410 v8::Debug::DebugBreak(isolate); |
7411 CompileRun("while (true);"); | 7411 CompileRun("while (true);"); |
7412 CHECK(try_catch.HasTerminated()); | 7412 CHECK(try_catch.HasTerminated()); |
7413 } | 7413 } |
OLD | NEW |