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

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

Issue 171107: X64: Implement debugger hooks. (Closed)
Patch Set: Created 11 years, 4 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
OLDNEW
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 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 // Check that the debug break function is as expected. 480 // Check that the debug break function is as expected.
481 Handle<v8::internal::SharedFunctionInfo> shared(fun->shared()); 481 Handle<v8::internal::SharedFunctionInfo> shared(fun->shared());
482 CHECK(Debug::HasDebugInfo(shared)); 482 CHECK(Debug::HasDebugInfo(shared));
483 TestBreakLocationIterator it1(Debug::GetDebugInfo(shared)); 483 TestBreakLocationIterator it1(Debug::GetDebugInfo(shared));
484 it1.FindBreakLocationFromPosition(position); 484 it1.FindBreakLocationFromPosition(position);
485 CHECK_EQ(mode, it1.it()->rinfo()->rmode()); 485 CHECK_EQ(mode, it1.it()->rinfo()->rmode());
486 if (mode != v8::internal::RelocInfo::JS_RETURN) { 486 if (mode != v8::internal::RelocInfo::JS_RETURN) {
487 CHECK_EQ(debug_break, 487 CHECK_EQ(debug_break,
488 Code::GetCodeFromTargetAddress(it1.it()->rinfo()->target_address())); 488 Code::GetCodeFromTargetAddress(it1.it()->rinfo()->target_address()));
489 } else { 489 } else {
490 // TODO(1240753): Make the test architecture independent or split 490 CHECK(Debug::IsDebugBreakAtReturn(it1.it()->rinfo()));
491 // parts of the debugger into architecture dependent files.
492 CHECK_EQ(0xE8, *(it1.rinfo()->pc()));
493 } 491 }
494 492
495 // Clear the break point and check that the debug break function is no longer 493 // Clear the break point and check that the debug break function is no longer
496 // there 494 // there
497 ClearBreakPoint(bp); 495 ClearBreakPoint(bp);
498 CHECK(!Debug::HasDebugInfo(shared)); 496 CHECK(!Debug::HasDebugInfo(shared));
499 CHECK(Debug::EnsureDebugInfo(shared)); 497 CHECK(Debug::EnsureDebugInfo(shared));
500 TestBreakLocationIterator it2(Debug::GetDebugInfo(shared)); 498 TestBreakLocationIterator it2(Debug::GetDebugInfo(shared));
501 it2.FindBreakLocationFromPosition(position); 499 it2.FindBreakLocationFromPosition(position);
502 CHECK_EQ(mode, it2.it()->rinfo()->rmode()); 500 CHECK_EQ(mode, it2.it()->rinfo()->rmode());
503 if (mode == v8::internal::RelocInfo::JS_RETURN) { 501 if (mode == v8::internal::RelocInfo::JS_RETURN) {
504 // TODO(1240753): Make the test architecture independent or split 502 CHECK(!Debug::IsDebugBreakAtReturn(it2.it()->rinfo()));
505 // parts of the debugger into architecture dependent files.
506 CHECK_NE(0xE8, *(it2.rinfo()->pc()));
507 } 503 }
508 } 504 }
509 505
510 506
511 // --- D e b u g E v e n t H a n d l e r s 507 // --- D e b u g E v e n t H a n d l e r s
512 // --- 508 // ---
513 // --- The different tests uses a number of debug event handlers. 509 // --- The different tests uses a number of debug event handlers.
514 // --- 510 // ---
515 511
516 512
(...skipping 4850 matching lines...) Expand 10 before | Expand all | Expand 10 after
5367 v8::Script::New( 5363 v8::Script::New(
5368 v8::String::New( 5364 v8::String::New(
5369 "function runTest(mirror) {" 5365 "function runTest(mirror) {"
5370 " return mirror.isString() && (mirror.length() == 5);" 5366 " return mirror.isString() && (mirror.length() == 5);"
5371 "}" 5367 "}"
5372 "" 5368 ""
5373 "runTest;"))->Run()); 5369 "runTest;"))->Run());
5374 v8::Handle<v8::Value> result = run_test->Call(env->Global(), 1, &obj); 5370 v8::Handle<v8::Value> result = run_test->Call(env->Global(), 1, &obj);
5375 CHECK(result->IsTrue()); 5371 CHECK(result->IsTrue());
5376 } 5372 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698