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

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

Issue 1500933002: [debugger] fix debug-evaluate wrt shadowed context var. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: add TODO Created 5 years 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 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 5404 matching lines...) Expand 10 before | Expand all | Expand 10 after
5415 int source_line = GetSourceLineFromBreakEventMessage(print_buffer); 5415 int source_line = GetSourceLineFromBreakEventMessage(print_buffer);
5416 CHECK(8 <= source_line && source_line <= 13); 5416 CHECK(8 <= source_line && source_line <= 13);
5417 threaded_debugging_barriers.barrier_2.Wait(); 5417 threaded_debugging_barriers.barrier_2.Wait();
5418 } 5418 }
5419 } 5419 }
5420 5420
5421 5421
5422 void V8Thread::Run() { 5422 void V8Thread::Run() {
5423 const char* source = 5423 const char* source =
5424 "flag = true;\n" 5424 "flag = true;\n"
5425 "function bar( new_value ) {\n"
5426 " flag = new_value;\n"
5427 " return \"Return from bar(\" + new_value + \")\";\n"
5428 "}\n"
5429 "\n" 5425 "\n"
5430 "function foo() {\n" 5426 "function foo() {\n"
5431 " var x = 1;\n" 5427 " var x = 1;\n"
5432 " while ( flag == true ) {\n" 5428 " while ( flag == true ) {\n"
5433 " if ( x == 1 ) {\n" 5429 " if ( x == 1 ) {\n"
5434 " ThreadedAtBarrier1();\n" 5430 " ThreadedAtBarrier1();\n"
5435 " }\n" 5431 " }\n"
5436 " x = x + 1;\n" 5432 " x = x + 1;\n"
5437 " }\n" 5433 " }\n"
5438 "}\n" 5434 "}\n"
(...skipping 22 matching lines...) Expand all
5461 } 5457 }
5462 threaded_debugging_barriers.barrier_4.Wait(); 5458 threaded_debugging_barriers.barrier_4.Wait();
5463 isolate_->Dispose(); 5459 isolate_->Dispose();
5464 } 5460 }
5465 5461
5466 5462
5467 void DebuggerThread::Run() { 5463 void DebuggerThread::Run() {
5468 const int kBufSize = 1000; 5464 const int kBufSize = 1000;
5469 uint16_t buffer[kBufSize]; 5465 uint16_t buffer[kBufSize];
5470 5466
5471 const char* command_1 = "{\"seq\":102," 5467 const char* command_1 =
5468 "{\"seq\":102,"
5472 "\"type\":\"request\"," 5469 "\"type\":\"request\","
5473 "\"command\":\"evaluate\"," 5470 "\"command\":\"evaluate\","
5474 "\"arguments\":{\"expression\":\"bar(false)\"}}"; 5471 "\"arguments\":{\"expression\":\"flag = false\"}}";
5475 const char* command_2 = "{\"seq\":103," 5472 const char* command_2 = "{\"seq\":103,"
5476 "\"type\":\"request\"," 5473 "\"type\":\"request\","
5477 "\"command\":\"continue\"}"; 5474 "\"command\":\"continue\"}";
5478 5475
5479 threaded_debugging_barriers.barrier_1.Wait(); 5476 threaded_debugging_barriers.barrier_1.Wait();
5480 v8::Debug::DebugBreak(isolate_); 5477 v8::Debug::DebugBreak(isolate_);
5481 threaded_debugging_barriers.barrier_2.Wait(); 5478 threaded_debugging_barriers.barrier_2.Wait();
5482 v8::Debug::SendCommand(isolate_, buffer, AsciiToUtf16(command_1, buffer)); 5479 v8::Debug::SendCommand(isolate_, buffer, AsciiToUtf16(command_1, buffer));
5483 v8::Debug::SendCommand(isolate_, buffer, AsciiToUtf16(command_2, buffer)); 5480 v8::Debug::SendCommand(isolate_, buffer, AsciiToUtf16(command_2, buffer));
5484 threaded_debugging_barriers.barrier_4.Wait(); 5481 threaded_debugging_barriers.barrier_4.Wait();
(...skipping 2567 matching lines...) Expand 10 before | Expand all | Expand 10 after
8052 CompileRun("function foo() {}; foo();"); 8049 CompileRun("function foo() {}; foo();");
8053 --after_compile_handler_depth; 8050 --after_compile_handler_depth;
8054 } 8051 }
8055 8052
8056 8053
8057 TEST(NoInterruptsInDebugListener) { 8054 TEST(NoInterruptsInDebugListener) {
8058 DebugLocalContext env; 8055 DebugLocalContext env;
8059 v8::Debug::SetDebugEventListener(env->GetIsolate(), NoInterruptsOnDebugEvent); 8056 v8::Debug::SetDebugEventListener(env->GetIsolate(), NoInterruptsOnDebugEvent);
8060 CompileRun("void(0);"); 8057 CompileRun("void(0);");
8061 } 8058 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698