| OLD | NEW |
| 1 // Copyright 2007-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2008 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 2436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2447 expected_step_sequence = "bcc"; | 2447 expected_step_sequence = "bcc"; |
| 2448 b->Call(env->Global(), 0, NULL); | 2448 b->Call(env->Global(), 0, NULL); |
| 2449 CHECK_EQ(strlen(expected_step_sequence), break_point_hit_count); | 2449 CHECK_EQ(strlen(expected_step_sequence), break_point_hit_count); |
| 2450 | 2450 |
| 2451 // Step through invocation of d + e. | 2451 // Step through invocation of d + e. |
| 2452 v8::Local<v8::Function> d = CompileFunction(&env, src, "d"); | 2452 v8::Local<v8::Function> d = CompileFunction(&env, src, "d"); |
| 2453 SetBreakPoint(d, 0); | 2453 SetBreakPoint(d, 0); |
| 2454 ChangeBreakOnException(false, true); | 2454 ChangeBreakOnException(false, true); |
| 2455 step_action = StepIn; | 2455 step_action = StepIn; |
| 2456 break_point_hit_count = 0; | 2456 break_point_hit_count = 0; |
| 2457 expected_step_sequence = "ddedd"; | 2457 expected_step_sequence = "dded"; |
| 2458 d->Call(env->Global(), 0, NULL); | 2458 d->Call(env->Global(), 0, NULL); |
| 2459 CHECK_EQ(strlen(expected_step_sequence), break_point_hit_count); | 2459 CHECK_EQ(strlen(expected_step_sequence), break_point_hit_count); |
| 2460 | 2460 |
| 2461 // Step through invocation of d + e now with break on caught exceptions. | 2461 // Step through invocation of d + e now with break on caught exceptions. |
| 2462 ChangeBreakOnException(true, true); | 2462 ChangeBreakOnException(true, true); |
| 2463 step_action = StepIn; | 2463 step_action = StepIn; |
| 2464 break_point_hit_count = 0; | 2464 break_point_hit_count = 0; |
| 2465 expected_step_sequence = "ddeedd"; | 2465 expected_step_sequence = "ddeed"; |
| 2466 d->Call(env->Global(), 0, NULL); | 2466 d->Call(env->Global(), 0, NULL); |
| 2467 CHECK_EQ(strlen(expected_step_sequence), break_point_hit_count); | 2467 CHECK_EQ(strlen(expected_step_sequence), break_point_hit_count); |
| 2468 | 2468 |
| 2469 // Step through invocation of f + g + h. | 2469 // Step through invocation of f + g + h. |
| 2470 v8::Local<v8::Function> f = CompileFunction(&env, src, "f"); | 2470 v8::Local<v8::Function> f = CompileFunction(&env, src, "f"); |
| 2471 SetBreakPoint(f, 0); | 2471 SetBreakPoint(f, 0); |
| 2472 ChangeBreakOnException(false, true); | 2472 ChangeBreakOnException(false, true); |
| 2473 step_action = StepIn; | 2473 step_action = StepIn; |
| 2474 break_point_hit_count = 0; | 2474 break_point_hit_count = 0; |
| 2475 expected_step_sequence = "ffghff"; | 2475 expected_step_sequence = "ffghf"; |
| 2476 f->Call(env->Global(), 0, NULL); | 2476 f->Call(env->Global(), 0, NULL); |
| 2477 CHECK_EQ(strlen(expected_step_sequence), break_point_hit_count); | 2477 CHECK_EQ(strlen(expected_step_sequence), break_point_hit_count); |
| 2478 | 2478 |
| 2479 // Step through invocation of f + g + h now with break on caught exceptions. | 2479 // Step through invocation of f + g + h now with break on caught exceptions. |
| 2480 ChangeBreakOnException(true, true); | 2480 ChangeBreakOnException(true, true); |
| 2481 step_action = StepIn; | 2481 step_action = StepIn; |
| 2482 break_point_hit_count = 0; | 2482 break_point_hit_count = 0; |
| 2483 expected_step_sequence = "ffghhff"; | 2483 expected_step_sequence = "ffghhf"; |
| 2484 f->Call(env->Global(), 0, NULL); | 2484 f->Call(env->Global(), 0, NULL); |
| 2485 CHECK_EQ(strlen(expected_step_sequence), break_point_hit_count); | 2485 CHECK_EQ(strlen(expected_step_sequence), break_point_hit_count); |
| 2486 | 2486 |
| 2487 // Get rid of the debug event listener. | 2487 // Get rid of the debug event listener. |
| 2488 v8::Debug::RemoveDebugEventListener(DebugEventStepSequence); | 2488 v8::Debug::RemoveDebugEventListener(DebugEventStepSequence); |
| 2489 } | 2489 } |
| 2490 | 2490 |
| 2491 | 2491 |
| 2492 TEST(DebugBreak) { | 2492 TEST(DebugBreak) { |
| 2493 v8::HandleScope scope; | 2493 v8::HandleScope scope; |
| (...skipping 926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3420 " CheckSourceLine(2)\n" | 3420 " CheckSourceLine(2)\n" |
| 3421 " CheckSourceLine(3)\n" | 3421 " CheckSourceLine(3)\n" |
| 3422 "}; f()"))->Run(); | 3422 "}; f()"))->Run(); |
| 3423 | 3423 |
| 3424 // Test that a parameter can be passed to a function called in the debugger. | 3424 // Test that a parameter can be passed to a function called in the debugger. |
| 3425 v8::Script::Compile(v8::String::New("CheckDataParameter()"))->Run(); | 3425 v8::Script::Compile(v8::String::New("CheckDataParameter()"))->Run(); |
| 3426 | 3426 |
| 3427 // Test that a function with closure can be run in the debugger. | 3427 // Test that a function with closure can be run in the debugger. |
| 3428 v8::Script::Compile(v8::String::New("CheckClosure()"))->Run(); | 3428 v8::Script::Compile(v8::String::New("CheckClosure()"))->Run(); |
| 3429 } | 3429 } |
| OLD | NEW |