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

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

Issue 16093040: Debug: support breakpoints set in the middle of statement (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: follow code review 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 7030 matching lines...) Expand 10 before | Expand all | Expand 10 after
7572 TEST(LiveEditDisabled) { 7572 TEST(LiveEditDisabled) {
7573 v8::internal::FLAG_allow_natives_syntax = true; 7573 v8::internal::FLAG_allow_natives_syntax = true;
7574 LocalContext env; 7574 LocalContext env;
7575 v8::HandleScope scope(env->GetIsolate()); 7575 v8::HandleScope scope(env->GetIsolate());
7576 v8::Debug::SetLiveEditEnabled(false); 7576 v8::Debug::SetLiveEditEnabled(false);
7577 CompileRun("%LiveEditCompareStrings('', '')"); 7577 CompileRun("%LiveEditCompareStrings('', '')");
7578 } 7578 }
7579 7579
7580 7580
7581 #endif // ENABLE_DEBUGGER_SUPPORT 7581 #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