Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(158)

Side by Side Diff: test/cctest/test-debug.cc

Issue 18349004: Debug: support breakpoints set in the middle of statement (try #2 after rollback) (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/runtime.cc ('k') | test/mjsunit/debug-breakpoints.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 502
503 // Create function and set the break point. 503 // Create function and set the break point.
504 Handle<v8::internal::JSFunction> fun = v8::Utils::OpenHandle( 504 Handle<v8::internal::JSFunction> fun = v8::Utils::OpenHandle(
505 *CompileFunction(env, source, name)); 505 *CompileFunction(env, source, name));
506 int bp = SetBreakPoint(fun, position); 506 int bp = SetBreakPoint(fun, position);
507 507
508 // Check that the debug break function is as expected. 508 // Check that the debug break function is as expected.
509 Handle<v8::internal::SharedFunctionInfo> shared(fun->shared()); 509 Handle<v8::internal::SharedFunctionInfo> shared(fun->shared());
510 CHECK(Debug::HasDebugInfo(shared)); 510 CHECK(Debug::HasDebugInfo(shared));
511 TestBreakLocationIterator it1(Debug::GetDebugInfo(shared)); 511 TestBreakLocationIterator it1(Debug::GetDebugInfo(shared));
512 it1.FindBreakLocationFromPosition(position); 512 it1.FindBreakLocationFromPosition(position, v8::internal::STATEMENT_ALIGNED);
513 v8::internal::RelocInfo::Mode actual_mode = it1.it()->rinfo()->rmode(); 513 v8::internal::RelocInfo::Mode actual_mode = it1.it()->rinfo()->rmode();
514 if (actual_mode == v8::internal::RelocInfo::CODE_TARGET_WITH_ID) { 514 if (actual_mode == v8::internal::RelocInfo::CODE_TARGET_WITH_ID) {
515 actual_mode = v8::internal::RelocInfo::CODE_TARGET; 515 actual_mode = v8::internal::RelocInfo::CODE_TARGET;
516 } 516 }
517 CHECK_EQ(mode, actual_mode); 517 CHECK_EQ(mode, actual_mode);
518 if (mode != v8::internal::RelocInfo::JS_RETURN) { 518 if (mode != v8::internal::RelocInfo::JS_RETURN) {
519 CHECK_EQ(debug_break, 519 CHECK_EQ(debug_break,
520 Code::GetCodeFromTargetAddress(it1.it()->rinfo()->target_address())); 520 Code::GetCodeFromTargetAddress(it1.it()->rinfo()->target_address()));
521 } else { 521 } else {
522 CHECK(Debug::IsDebugBreakAtReturn(it1.it()->rinfo())); 522 CHECK(Debug::IsDebugBreakAtReturn(it1.it()->rinfo()));
523 } 523 }
524 524
525 // Clear the break point and check that the debug break function is no longer 525 // Clear the break point and check that the debug break function is no longer
526 // there 526 // there
527 ClearBreakPoint(bp); 527 ClearBreakPoint(bp);
528 CHECK(!debug->HasDebugInfo(shared)); 528 CHECK(!debug->HasDebugInfo(shared));
529 CHECK(debug->EnsureDebugInfo(shared, fun)); 529 CHECK(debug->EnsureDebugInfo(shared, fun));
530 TestBreakLocationIterator it2(Debug::GetDebugInfo(shared)); 530 TestBreakLocationIterator it2(Debug::GetDebugInfo(shared));
531 it2.FindBreakLocationFromPosition(position); 531 it2.FindBreakLocationFromPosition(position, v8::internal::STATEMENT_ALIGNED);
532 actual_mode = it2.it()->rinfo()->rmode(); 532 actual_mode = it2.it()->rinfo()->rmode();
533 if (actual_mode == v8::internal::RelocInfo::CODE_TARGET_WITH_ID) { 533 if (actual_mode == v8::internal::RelocInfo::CODE_TARGET_WITH_ID) {
534 actual_mode = v8::internal::RelocInfo::CODE_TARGET; 534 actual_mode = v8::internal::RelocInfo::CODE_TARGET;
535 } 535 }
536 CHECK_EQ(mode, actual_mode); 536 CHECK_EQ(mode, actual_mode);
537 if (mode == v8::internal::RelocInfo::JS_RETURN) { 537 if (mode == v8::internal::RelocInfo::JS_RETURN) {
538 CHECK(!Debug::IsDebugBreakAtReturn(it2.it()->rinfo())); 538 CHECK(!Debug::IsDebugBreakAtReturn(it2.it()->rinfo()));
539 } 539 }
540 } 540 }
541 541
(...skipping 7032 matching lines...) Expand 10 before | Expand all | Expand 10 after
7574 TEST(LiveEditDisabled) { 7574 TEST(LiveEditDisabled) {
7575 v8::internal::FLAG_allow_natives_syntax = true; 7575 v8::internal::FLAG_allow_natives_syntax = true;
7576 LocalContext env; 7576 LocalContext env;
7577 v8::HandleScope scope(env->GetIsolate()); 7577 v8::HandleScope scope(env->GetIsolate());
7578 v8::Debug::SetLiveEditEnabled(false); 7578 v8::Debug::SetLiveEditEnabled(false);
7579 CompileRun("%LiveEditCompareStrings('', '')"); 7579 CompileRun("%LiveEditCompareStrings('', '')");
7580 } 7580 }
7581 7581
7582 7582
7583 #endif // ENABLE_DEBUGGER_SUPPORT 7583 #endif // ENABLE_DEBUGGER_SUPPORT
OLDNEW
« no previous file with comments | « src/runtime.cc ('k') | test/mjsunit/debug-breakpoints.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698