| 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 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 | 501 |
| 502 // Create function and set the break point. | 502 // Create function and set the break point. |
| 503 Handle<v8::internal::JSFunction> fun = v8::Utils::OpenHandle( | 503 Handle<v8::internal::JSFunction> fun = v8::Utils::OpenHandle( |
| 504 *CompileFunction(env, source, name)); | 504 *CompileFunction(env, source, name)); |
| 505 int bp = SetBreakPoint(fun, position); | 505 int bp = SetBreakPoint(fun, position); |
| 506 | 506 |
| 507 // Check that the debug break function is as expected. | 507 // Check that the debug break function is as expected. |
| 508 Handle<v8::internal::SharedFunctionInfo> shared(fun->shared()); | 508 Handle<v8::internal::SharedFunctionInfo> shared(fun->shared()); |
| 509 CHECK(Debug::HasDebugInfo(shared)); | 509 CHECK(Debug::HasDebugInfo(shared)); |
| 510 TestBreakLocationIterator it1(Debug::GetDebugInfo(shared)); | 510 TestBreakLocationIterator it1(Debug::GetDebugInfo(shared)); |
| 511 it1.FindBreakLocationFromPosition(position); | 511 it1.FindBreakLocationFromPosition(position, true); |
| 512 v8::internal::RelocInfo::Mode actual_mode = it1.it()->rinfo()->rmode(); | 512 v8::internal::RelocInfo::Mode actual_mode = it1.it()->rinfo()->rmode(); |
| 513 if (actual_mode == v8::internal::RelocInfo::CODE_TARGET_WITH_ID) { | 513 if (actual_mode == v8::internal::RelocInfo::CODE_TARGET_WITH_ID) { |
| 514 actual_mode = v8::internal::RelocInfo::CODE_TARGET; | 514 actual_mode = v8::internal::RelocInfo::CODE_TARGET; |
| 515 } | 515 } |
| 516 CHECK_EQ(mode, actual_mode); | 516 CHECK_EQ(mode, actual_mode); |
| 517 if (mode != v8::internal::RelocInfo::JS_RETURN) { | 517 if (mode != v8::internal::RelocInfo::JS_RETURN) { |
| 518 CHECK_EQ(debug_break, | 518 CHECK_EQ(debug_break, |
| 519 Code::GetCodeFromTargetAddress(it1.it()->rinfo()->target_address())); | 519 Code::GetCodeFromTargetAddress(it1.it()->rinfo()->target_address())); |
| 520 } else { | 520 } else { |
| 521 CHECK(Debug::IsDebugBreakAtReturn(it1.it()->rinfo())); | 521 CHECK(Debug::IsDebugBreakAtReturn(it1.it()->rinfo())); |
| 522 } | 522 } |
| 523 | 523 |
| 524 // Clear the break point and check that the debug break function is no longer | 524 // Clear the break point and check that the debug break function is no longer |
| 525 // there | 525 // there |
| 526 ClearBreakPoint(bp); | 526 ClearBreakPoint(bp); |
| 527 CHECK(!debug->HasDebugInfo(shared)); | 527 CHECK(!debug->HasDebugInfo(shared)); |
| 528 CHECK(debug->EnsureDebugInfo(shared, fun)); | 528 CHECK(debug->EnsureDebugInfo(shared, fun)); |
| 529 TestBreakLocationIterator it2(Debug::GetDebugInfo(shared)); | 529 TestBreakLocationIterator it2(Debug::GetDebugInfo(shared)); |
| 530 it2.FindBreakLocationFromPosition(position); | 530 it2.FindBreakLocationFromPosition(position, true); |
| 531 actual_mode = it2.it()->rinfo()->rmode(); | 531 actual_mode = it2.it()->rinfo()->rmode(); |
| 532 if (actual_mode == v8::internal::RelocInfo::CODE_TARGET_WITH_ID) { | 532 if (actual_mode == v8::internal::RelocInfo::CODE_TARGET_WITH_ID) { |
| 533 actual_mode = v8::internal::RelocInfo::CODE_TARGET; | 533 actual_mode = v8::internal::RelocInfo::CODE_TARGET; |
| 534 } | 534 } |
| 535 CHECK_EQ(mode, actual_mode); | 535 CHECK_EQ(mode, actual_mode); |
| 536 if (mode == v8::internal::RelocInfo::JS_RETURN) { | 536 if (mode == v8::internal::RelocInfo::JS_RETURN) { |
| 537 CHECK(!Debug::IsDebugBreakAtReturn(it2.it()->rinfo())); | 537 CHECK(!Debug::IsDebugBreakAtReturn(it2.it()->rinfo())); |
| 538 } | 538 } |
| 539 } | 539 } |
| 540 | 540 |
| (...skipping 7030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7571 TEST(LiveEditDisabled) { | 7571 TEST(LiveEditDisabled) { |
| 7572 v8::internal::FLAG_allow_natives_syntax = true; | 7572 v8::internal::FLAG_allow_natives_syntax = true; |
| 7573 LocalContext env; | 7573 LocalContext env; |
| 7574 v8::HandleScope scope(env->GetIsolate()); | 7574 v8::HandleScope scope(env->GetIsolate()); |
| 7575 v8::Debug::SetLiveEditEnabled(false); | 7575 v8::Debug::SetLiveEditEnabled(false); |
| 7576 CompileRun("%LiveEditCompareStrings('', '')"); | 7576 CompileRun("%LiveEditCompareStrings('', '')"); |
| 7577 } | 7577 } |
| 7578 | 7578 |
| 7579 | 7579 |
| 7580 #endif // ENABLE_DEBUGGER_SUPPORT | 7580 #endif // ENABLE_DEBUGGER_SUPPORT |
| OLD | NEW |