From 20a627183f48c779a978cbb5e195598853d516da Mon Sep 17 00:00:00 2001 From: "yangguo@chromium.org" Date: Wed, 14 May 2014 08:07:21 +0000 Subject: [PATCH] Rename debug API methods. R=yurys@chromium.org Review URL: https://codereview.chromium.org/281733002 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21295 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- include/v8-debug.h | 25 ++- src/api.cc | 8 +- src/d8.cc | 2 +- src/debug.cc | 2 +- src/debug.h | 4 +- test/cctest/test-debug.cc | 390 +++++++++++++++++++++++----------------------- 6 files changed, 224 insertions(+), 207 deletions(-) diff --git a/include/v8-debug.h b/include/v8-debug.h index 48b9657..980d4b9 100644 --- a/include/v8-debug.h +++ b/include/v8-debug.h @@ -137,7 +137,10 @@ class V8_EXPORT Debug { * A EventCallback2 does not take possession of the event data, * and must not rely on the data persisting after the handler returns. */ - typedef void (*EventCallback2)(const EventDetails& event_details); + typedef void (*EventCallback)(const EventDetails& event_details); + + // TODO(yangguo) Deprecate this. + typedef EventCallback EventCallback2; /** * Debug message callback function. @@ -147,15 +150,24 @@ class V8_EXPORT Debug { * A MessageHandler2 does not take possession of the message data, * and must not rely on the data persisting after the handler returns. */ - typedef void (*MessageHandler2)(const Message& message); + typedef void (*MessageHandler)(const Message& message); + + // TODO(yangguo) Deprecate this. + typedef MessageHandler MessageHandler2; /** * Callback function for the host to ensure debug messages are processed. */ typedef void (*DebugMessageDispatchHandler)(); + static bool SetDebugEventListener(EventCallback that, + Handle data = Handle()); + + // TODO(yangguo) Deprecate this. static bool SetDebugEventListener2(EventCallback2 that, - Handle data = Handle()); + Handle data = Handle()) { + return SetDebugEventListener(that, data); + } // Schedule a debugger break to happen when JavaScript code is run // in the given isolate. @@ -178,7 +190,12 @@ class V8_EXPORT Debug { } // Message based interface. The message protocol is JSON. - static void SetMessageHandler2(MessageHandler2 handler); + static void SetMessageHandler(MessageHandler handler); + + // TODO(yangguo) Deprecate this. + static void SetMessageHandler2(MessageHandler2 handler) { + SetMessageHandler(handler); + } static void SendCommand(Isolate* isolate, const uint16_t* command, int length, diff --git a/src/api.cc b/src/api.cc index 7f1276d..68d80d8 100644 --- a/src/api.cc +++ b/src/api.cc @@ -6778,10 +6778,10 @@ Local Exception::Error(v8::Handle raw_message) { // --- D e b u g S u p p o r t --- -bool Debug::SetDebugEventListener2(EventCallback2 that, Handle data) { +bool Debug::SetDebugEventListener(EventCallback that, Handle data) { i::Isolate* isolate = i::Isolate::Current(); - EnsureInitializedForIsolate(isolate, "v8::Debug::SetDebugEventListener2()"); - ON_BAILOUT(isolate, "v8::Debug::SetDebugEventListener2()", return false); + EnsureInitializedForIsolate(isolate, "v8::Debug::SetDebugEventListener()"); + ON_BAILOUT(isolate, "v8::Debug::SetDebugEventListener()", return false); ENTER_V8(isolate); i::HandleScope scope(isolate); i::Handle foreign = isolate->factory()->undefined_value(); @@ -6811,7 +6811,7 @@ void Debug::DebugBreakForCommand(Isolate* isolate, ClientData* data) { } -void Debug::SetMessageHandler2(v8::Debug::MessageHandler2 handler) { +void Debug::SetMessageHandler(v8::Debug::MessageHandler handler) { i::Isolate* isolate = i::Isolate::Current(); EnsureInitializedForIsolate(isolate, "v8::Debug::SetMessageHandler"); ENTER_V8(isolate); diff --git a/src/d8.cc b/src/d8.cc index d19247a..bbc121e 100644 --- a/src/d8.cc +++ b/src/d8.cc @@ -797,7 +797,7 @@ void Shell::InstallUtilityScript(Isolate* isolate) { // Start the in-process debugger if requested. if (i::FLAG_debugger && !i::FLAG_debugger_agent) { - v8::Debug::SetDebugEventListener2(HandleDebugEvent); + v8::Debug::SetDebugEventListener(HandleDebugEvent); } } #endif // !V8_SHARED diff --git a/src/debug.cc b/src/debug.cc index 6adb38a..c112b4d 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -3180,7 +3180,7 @@ void Debugger::SetEventListener(Handle callback, } -void Debugger::SetMessageHandler(v8::Debug::MessageHandler2 handler) { +void Debugger::SetMessageHandler(v8::Debug::MessageHandler handler) { LockGuard with(&debugger_access_); message_handler_ = handler; diff --git a/src/debug.h b/src/debug.h index 54e285e..7277323 100644 --- a/src/debug.h +++ b/src/debug.h @@ -782,7 +782,7 @@ class Debugger { Handle event_data, bool auto_continue); void SetEventListener(Handle callback, Handle data); - void SetMessageHandler(v8::Debug::MessageHandler2 handler); + void SetMessageHandler(v8::Debug::MessageHandler handler); void SetDebugMessageDispatchHandler( v8::Debug::DebugMessageDispatchHandler handler, bool provide_locker); @@ -889,7 +889,7 @@ class Debugger { bool ignore_debugger_; // Are we temporarily ignoring the debugger? bool live_edit_enabled_; // Enable LiveEdit. bool never_unload_debugger_; // Can we unload the debugger? - v8::Debug::MessageHandler2 message_handler_; + v8::Debug::MessageHandler message_handler_; bool debugger_unload_pending_; // Was message handler cleared? Mutex dispatch_handler_access_; // Mutex guarding dispatch handler. diff --git a/test/cctest/test-debug.cc b/test/cctest/test-debug.cc index a9ee931..e080ebe 100644 --- a/test/cctest/test-debug.cc +++ b/test/cctest/test-debug.cc @@ -1094,7 +1094,7 @@ TEST(BreakPointICStore) { DebugLocalContext env; v8::HandleScope scope(env->GetIsolate()); - v8::Debug::SetDebugEventListener2(DebugEventBreakPointHitCount); + v8::Debug::SetDebugEventListener(DebugEventBreakPointHitCount); v8::Script::Compile(v8::String::NewFromUtf8(env->GetIsolate(), "function foo(){bar=0;}"))->Run(); v8::Local foo = v8::Local::Cast( @@ -1116,7 +1116,7 @@ TEST(BreakPointICStore) { foo->Call(env->Global(), 0, NULL); CHECK_EQ(2, break_point_hit_count); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -1126,7 +1126,7 @@ TEST(BreakPointICLoad) { break_point_hit_count = 0; DebugLocalContext env; v8::HandleScope scope(env->GetIsolate()); - v8::Debug::SetDebugEventListener2(DebugEventBreakPointHitCount); + v8::Debug::SetDebugEventListener(DebugEventBreakPointHitCount); v8::Script::Compile(v8::String::NewFromUtf8(env->GetIsolate(), "bar=1")) ->Run(); v8::Script::Compile( @@ -1151,7 +1151,7 @@ TEST(BreakPointICLoad) { foo->Call(env->Global(), 0, NULL); CHECK_EQ(2, break_point_hit_count); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -1161,7 +1161,7 @@ TEST(BreakPointICCall) { break_point_hit_count = 0; DebugLocalContext env; v8::HandleScope scope(env->GetIsolate()); - v8::Debug::SetDebugEventListener2(DebugEventBreakPointHitCount); + v8::Debug::SetDebugEventListener(DebugEventBreakPointHitCount); v8::Script::Compile( v8::String::NewFromUtf8(env->GetIsolate(), "function bar(){}"))->Run(); v8::Script::Compile(v8::String::NewFromUtf8(env->GetIsolate(), @@ -1185,7 +1185,7 @@ TEST(BreakPointICCall) { foo->Call(env->Global(), 0, NULL); CHECK_EQ(2, break_point_hit_count); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -1195,7 +1195,7 @@ TEST(BreakPointICCallWithGC) { break_point_hit_count = 0; DebugLocalContext env; v8::HandleScope scope(env->GetIsolate()); - v8::Debug::SetDebugEventListener2(DebugEventBreakPointCollectGarbage); + v8::Debug::SetDebugEventListener(DebugEventBreakPointCollectGarbage); v8::Script::Compile( v8::String::NewFromUtf8(env->GetIsolate(), "function bar(){return 1;}")) ->Run(); @@ -1221,7 +1221,7 @@ TEST(BreakPointICCallWithGC) { foo->Call(env->Global(), 0, NULL); CHECK_EQ(2, break_point_hit_count); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -1231,7 +1231,7 @@ TEST(BreakPointConstructCallWithGC) { break_point_hit_count = 0; DebugLocalContext env; v8::HandleScope scope(env->GetIsolate()); - v8::Debug::SetDebugEventListener2(DebugEventBreakPointCollectGarbage); + v8::Debug::SetDebugEventListener(DebugEventBreakPointCollectGarbage); v8::Script::Compile(v8::String::NewFromUtf8(env->GetIsolate(), "function bar(){ this.x = 1;}")) ->Run(); @@ -1257,7 +1257,7 @@ TEST(BreakPointConstructCallWithGC) { foo->Call(env->Global(), 0, NULL); CHECK_EQ(2, break_point_hit_count); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -1278,7 +1278,7 @@ TEST(BreakPointReturn) { "frame_source_column"); - v8::Debug::SetDebugEventListener2(DebugEventBreakPointHitCount); + v8::Debug::SetDebugEventListener(DebugEventBreakPointHitCount); v8::Script::Compile( v8::String::NewFromUtf8(env->GetIsolate(), "function foo(){}"))->Run(); v8::Local foo = v8::Local::Cast( @@ -1304,7 +1304,7 @@ TEST(BreakPointReturn) { foo->Call(env->Global(), 0, NULL); CHECK_EQ(2, break_point_hit_count); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -1327,7 +1327,7 @@ TEST(GCDuringBreakPointProcessing) { DebugLocalContext env; v8::HandleScope scope(env->GetIsolate()); - v8::Debug::SetDebugEventListener2(DebugEventBreakPointCollectGarbage); + v8::Debug::SetDebugEventListener(DebugEventBreakPointCollectGarbage); v8::Local foo; // Test IC store break point with garbage collection. @@ -1355,7 +1355,7 @@ TEST(GCDuringBreakPointProcessing) { SetBreakPoint(foo, 0); CallWithBreakPoints(env->Global(), foo, 1, 25); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -1390,7 +1390,7 @@ TEST(BreakPointSurviveGC) { DebugLocalContext env; v8::HandleScope scope(env->GetIsolate()); - v8::Debug::SetDebugEventListener2(DebugEventBreakPointHitCount); + v8::Debug::SetDebugEventListener(DebugEventBreakPointHitCount); v8::Local foo; // Test IC store break point with garbage collection. @@ -1436,7 +1436,7 @@ TEST(BreakPointSurviveGC) { CallAndGC(env->Global(), foo); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -1448,7 +1448,7 @@ TEST(BreakPointThroughJavaScript) { v8::HandleScope scope(env->GetIsolate()); env.ExposeDebug(); - v8::Debug::SetDebugEventListener2(DebugEventBreakPointHitCount); + v8::Debug::SetDebugEventListener(DebugEventBreakPointHitCount); v8::Script::Compile( v8::String::NewFromUtf8(env->GetIsolate(), "function bar(){}"))->Run(); v8::Script::Compile(v8::String::NewFromUtf8(env->GetIsolate(), @@ -1490,7 +1490,7 @@ TEST(BreakPointThroughJavaScript) { foo->Run(); CHECK_EQ(8, break_point_hit_count); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); // Make sure that the break point numbers are consecutive. @@ -1507,7 +1507,7 @@ TEST(ScriptBreakPointByNameThroughJavaScript) { v8::HandleScope scope(env->GetIsolate()); env.ExposeDebug(); - v8::Debug::SetDebugEventListener2(DebugEventBreakPointHitCount); + v8::Debug::SetDebugEventListener(DebugEventBreakPointHitCount); v8::Local script = v8::String::NewFromUtf8( env->GetIsolate(), @@ -1592,7 +1592,7 @@ TEST(ScriptBreakPointByNameThroughJavaScript) { g->Call(env->Global(), 0, NULL); CHECK_EQ(0, break_point_hit_count); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); // Make sure that the break point numbers are consecutive. @@ -1611,7 +1611,7 @@ TEST(ScriptBreakPointByIdThroughJavaScript) { v8::HandleScope scope(env->GetIsolate()); env.ExposeDebug(); - v8::Debug::SetDebugEventListener2(DebugEventBreakPointHitCount); + v8::Debug::SetDebugEventListener(DebugEventBreakPointHitCount); v8::Local source = v8::String::NewFromUtf8( env->GetIsolate(), @@ -1700,7 +1700,7 @@ TEST(ScriptBreakPointByIdThroughJavaScript) { g->Call(env->Global(), 0, NULL); CHECK_EQ(0, break_point_hit_count); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); // Make sure that the break point numbers are consecutive. @@ -1720,7 +1720,7 @@ TEST(EnableDisableScriptBreakPoint) { v8::HandleScope scope(env->GetIsolate()); env.ExposeDebug(); - v8::Debug::SetDebugEventListener2(DebugEventBreakPointHitCount); + v8::Debug::SetDebugEventListener(DebugEventBreakPointHitCount); v8::Local script = v8::String::NewFromUtf8( env->GetIsolate(), @@ -1766,7 +1766,7 @@ TEST(EnableDisableScriptBreakPoint) { f->Call(env->Global(), 0, NULL); CHECK_EQ(3, break_point_hit_count); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -1778,7 +1778,7 @@ TEST(ConditionalScriptBreakPoint) { v8::HandleScope scope(env->GetIsolate()); env.ExposeDebug(); - v8::Debug::SetDebugEventListener2(DebugEventBreakPointHitCount); + v8::Debug::SetDebugEventListener(DebugEventBreakPointHitCount); v8::Local script = v8::String::NewFromUtf8( env->GetIsolate(), @@ -1829,7 +1829,7 @@ TEST(ConditionalScriptBreakPoint) { } CHECK_EQ(5, break_point_hit_count); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -1841,7 +1841,7 @@ TEST(ScriptBreakPointIgnoreCount) { v8::HandleScope scope(env->GetIsolate()); env.ExposeDebug(); - v8::Debug::SetDebugEventListener2(DebugEventBreakPointHitCount); + v8::Debug::SetDebugEventListener(DebugEventBreakPointHitCount); v8::Local script = v8::String::NewFromUtf8( env->GetIsolate(), @@ -1885,7 +1885,7 @@ TEST(ScriptBreakPointIgnoreCount) { } CHECK_EQ(5, break_point_hit_count); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -1897,7 +1897,7 @@ TEST(ScriptBreakPointReload) { v8::HandleScope scope(env->GetIsolate()); env.ExposeDebug(); - v8::Debug::SetDebugEventListener2(DebugEventBreakPointHitCount); + v8::Debug::SetDebugEventListener(DebugEventBreakPointHitCount); v8::Local f; v8::Local script = v8::String::NewFromUtf8( @@ -1949,7 +1949,7 @@ TEST(ScriptBreakPointReload) { f->Call(env->Global(), 0, NULL); CHECK_EQ(1, break_point_hit_count); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -1961,7 +1961,7 @@ TEST(ScriptBreakPointMultiple) { v8::HandleScope scope(env->GetIsolate()); env.ExposeDebug(); - v8::Debug::SetDebugEventListener2(DebugEventBreakPointHitCount); + v8::Debug::SetDebugEventListener(DebugEventBreakPointHitCount); v8::Local f; v8::Local script_f = @@ -2018,7 +2018,7 @@ TEST(ScriptBreakPointMultiple) { g->Call(env->Global(), 0, NULL); CHECK_EQ(2, break_point_hit_count); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -2030,7 +2030,7 @@ TEST(ScriptBreakPointLineOffset) { v8::HandleScope scope(env->GetIsolate()); env.ExposeDebug(); - v8::Debug::SetDebugEventListener2(DebugEventBreakPointHitCount); + v8::Debug::SetDebugEventListener(DebugEventBreakPointHitCount); v8::Local f; v8::Local script = v8::String::NewFromUtf8( @@ -2078,7 +2078,7 @@ TEST(ScriptBreakPointLineOffset) { f->Call(env->Global(), 0, NULL); CHECK_EQ(1, break_point_hit_count); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -2094,7 +2094,7 @@ TEST(ScriptBreakPointLine) { frame_function_name_source, "frame_function_name"); - v8::Debug::SetDebugEventListener2(DebugEventBreakPointHitCount); + v8::Debug::SetDebugEventListener(DebugEventBreakPointHitCount); v8::Local f; v8::Local g; @@ -2194,7 +2194,7 @@ TEST(ScriptBreakPointLine) { v8::Script::Compile(script, &origin)->Run(); CHECK_EQ(0, break_point_hit_count); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -2205,7 +2205,7 @@ TEST(ScriptBreakPointLineTopLevel) { v8::HandleScope scope(env->GetIsolate()); env.ExposeDebug(); - v8::Debug::SetDebugEventListener2(DebugEventBreakPointHitCount); + v8::Debug::SetDebugEventListener(DebugEventBreakPointHitCount); v8::Local script = v8::String::NewFromUtf8(env->GetIsolate(), @@ -2241,7 +2241,7 @@ TEST(ScriptBreakPointLineTopLevel) { env->Global()->Get(v8::String::NewFromUtf8(env->GetIsolate(), "f"))); CHECK_EQ(0, break_point_hit_count); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -2253,7 +2253,7 @@ TEST(ScriptBreakPointTopLevelCrash) { v8::HandleScope scope(env->GetIsolate()); env.ExposeDebug(); - v8::Debug::SetDebugEventListener2(DebugEventBreakPointHitCount); + v8::Debug::SetDebugEventListener(DebugEventBreakPointHitCount); v8::Local script_source = v8::String::NewFromUtf8(env->GetIsolate(), @@ -2276,7 +2276,7 @@ TEST(ScriptBreakPointTopLevelCrash) { ClearBreakPointFromJS(env->GetIsolate(), sbp1); ClearBreakPointFromJS(env->GetIsolate(), sbp2); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -2292,7 +2292,7 @@ TEST(RemoveBreakPointInBreak) { debug_event_remove_break_point = SetBreakPoint(foo, 0); // Register the debug event listener pasing the function - v8::Debug::SetDebugEventListener2(DebugEventRemoveBreakPoint, foo); + v8::Debug::SetDebugEventListener(DebugEventRemoveBreakPoint, foo); break_point_hit_count = 0; foo->Call(env->Global(), 0, NULL); @@ -2302,7 +2302,7 @@ TEST(RemoveBreakPointInBreak) { foo->Call(env->Global(), 0, NULL); CHECK_EQ(0, break_point_hit_count); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -2312,7 +2312,7 @@ TEST(DebuggerStatement) { break_point_hit_count = 0; DebugLocalContext env; v8::HandleScope scope(env->GetIsolate()); - v8::Debug::SetDebugEventListener2(DebugEventBreakPointHitCount); + v8::Debug::SetDebugEventListener(DebugEventBreakPointHitCount); v8::Script::Compile( v8::String::NewFromUtf8(env->GetIsolate(), "function bar(){debugger}")) ->Run(); @@ -2332,7 +2332,7 @@ TEST(DebuggerStatement) { foo->Call(env->Global(), 0, NULL); CHECK_EQ(3, break_point_hit_count); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -2342,7 +2342,7 @@ TEST(DebuggerStatementBreakpoint) { break_point_hit_count = 0; DebugLocalContext env; v8::HandleScope scope(env->GetIsolate()); - v8::Debug::SetDebugEventListener2(DebugEventBreakPointHitCount); + v8::Debug::SetDebugEventListener(DebugEventBreakPointHitCount); v8::Script::Compile( v8::String::NewFromUtf8(env->GetIsolate(), "function foo(){debugger;}")) ->Run(); @@ -2360,7 +2360,7 @@ TEST(DebuggerStatementBreakpoint) { CHECK_EQ(2, break_point_hit_count); ClearBreakPoint(bp); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -2378,7 +2378,7 @@ TEST(DebugEvaluate) { evaluate_check_source, "evaluate_check"); // Register the debug event listener - v8::Debug::SetDebugEventListener2(DebugEventEvaluate); + v8::Debug::SetDebugEventListener(DebugEventEvaluate); // Different expected vaules of x and a when in a break point (u = undefined, // d = Hello, world!). @@ -2479,7 +2479,7 @@ TEST(DebugEvaluate) { }; bar->Call(env->Global(), 2, argv_bar_3); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -2497,7 +2497,7 @@ TEST(ConditionalBreakpointWithCodeGenerationDisallowed) { v8::HandleScope scope(env->GetIsolate()); env.ExposeDebug(); - v8::Debug::SetDebugEventListener2(CheckDebugEvent); + v8::Debug::SetDebugEventListener(CheckDebugEvent); v8::Local foo = CompileFunction(&env, "function foo(x) {\n" @@ -2514,7 +2514,7 @@ TEST(ConditionalBreakpointWithCodeGenerationDisallowed) { foo->Call(env->Global(), 0, NULL); CHECK_EQ(1, debugEventCount); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -2544,7 +2544,7 @@ TEST(DebugEvaluateWithCodeGenerationDisallowed) { v8::HandleScope scope(env->GetIsolate()); env.ExposeDebug(); - v8::Debug::SetDebugEventListener2(CheckDebugEval); + v8::Debug::SetDebugEventListener(CheckDebugEval); v8::Local foo = CompileFunction(&env, "var global = 'Global';\n" @@ -2572,7 +2572,7 @@ TEST(DebugEvaluateWithCodeGenerationDisallowed) { checkGlobalEvalFunction.Clear(); checkFrameEvalFunction.Clear(); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -2677,7 +2677,7 @@ static void DebugProcessDebugMessagesHandler( // Test that the evaluation of expressions works even from ProcessDebugMessages // i.e. with empty stack. TEST(DebugEvaluateWithoutStack) { - v8::Debug::SetMessageHandler2(DebugProcessDebugMessagesHandler); + v8::Debug::SetMessageHandler(DebugProcessDebugMessagesHandler); DebugLocalContext env; v8::HandleScope scope(env->GetIsolate()); @@ -2733,8 +2733,8 @@ TEST(DebugEvaluateWithoutStack) { 0); CHECK_EQ(strcmp("805", process_debug_messages_data.results[2].buffer), 0); - v8::Debug::SetMessageHandler2(NULL); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetMessageHandler(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -2755,7 +2755,7 @@ TEST(DebugStepLinear) { SetBreakPoint(foo, 3); // Register a debug event listener which steps and counts. - v8::Debug::SetDebugEventListener2(DebugEventStep); + v8::Debug::SetDebugEventListener(DebugEventStep); step_action = StepIn; break_point_hit_count = 0; @@ -2764,11 +2764,11 @@ TEST(DebugStepLinear) { // With stepping all break locations are hit. CHECK_EQ(4, break_point_hit_count); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); // Register a debug event listener which just counts. - v8::Debug::SetDebugEventListener2(DebugEventBreakPointHitCount); + v8::Debug::SetDebugEventListener(DebugEventBreakPointHitCount); SetBreakPoint(foo, 3); break_point_hit_count = 0; @@ -2777,7 +2777,7 @@ TEST(DebugStepLinear) { // Without stepping only active break points are hit. CHECK_EQ(1, break_point_hit_count); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -2788,7 +2788,7 @@ TEST(DebugStepKeyedLoadLoop) { v8::HandleScope scope(env->GetIsolate()); // Register a debug event listener which steps and counts. - v8::Debug::SetDebugEventListener2(DebugEventStep); + v8::Debug::SetDebugEventListener(DebugEventStep); // Create a function for testing stepping of keyed load. The statement 'y=1' // is there to have more than one breakable statement in the loop, TODO(315). @@ -2826,7 +2826,7 @@ TEST(DebugStepKeyedLoadLoop) { // With stepping all break locations are hit. CHECK_EQ(35, break_point_hit_count); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -2837,7 +2837,7 @@ TEST(DebugStepKeyedStoreLoop) { v8::HandleScope scope(env->GetIsolate()); // Register a debug event listener which steps and counts. - v8::Debug::SetDebugEventListener2(DebugEventStep); + v8::Debug::SetDebugEventListener(DebugEventStep); // Create a function for testing stepping of keyed store. The statement 'y=1' // is there to have more than one breakable statement in the loop, TODO(315). @@ -2874,7 +2874,7 @@ TEST(DebugStepKeyedStoreLoop) { // With stepping all break locations are hit. CHECK_EQ(34, break_point_hit_count); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -2885,7 +2885,7 @@ TEST(DebugStepNamedLoadLoop) { v8::HandleScope scope(env->GetIsolate()); // Register a debug event listener which steps and counts. - v8::Debug::SetDebugEventListener2(DebugEventStep); + v8::Debug::SetDebugEventListener(DebugEventStep); // Create a function for testing stepping of named load. v8::Local foo = CompileFunction( @@ -2918,7 +2918,7 @@ TEST(DebugStepNamedLoadLoop) { // With stepping all break locations are hit. CHECK_EQ(55, break_point_hit_count); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -2928,7 +2928,7 @@ static void DoDebugStepNamedStoreLoop(int expected) { v8::HandleScope scope(env->GetIsolate()); // Register a debug event listener which steps and counts. - v8::Debug::SetDebugEventListener2(DebugEventStep); + v8::Debug::SetDebugEventListener(DebugEventStep); // Create a function for testing stepping of named store. v8::Local foo = CompileFunction( @@ -2953,7 +2953,7 @@ static void DoDebugStepNamedStoreLoop(int expected) { // With stepping all expected break locations are hit. CHECK_EQ(expected, break_point_hit_count); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -2970,7 +2970,7 @@ TEST(DebugStepLinearMixedICs) { v8::HandleScope scope(env->GetIsolate()); // Register a debug event listener which steps and counts. - v8::Debug::SetDebugEventListener2(DebugEventStep); + v8::Debug::SetDebugEventListener(DebugEventStep); // Create a function for testing stepping. v8::Local foo = CompileFunction(&env, @@ -2993,11 +2993,11 @@ TEST(DebugStepLinearMixedICs) { // With stepping all break locations are hit. CHECK_EQ(11, break_point_hit_count); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); // Register a debug event listener which just counts. - v8::Debug::SetDebugEventListener2(DebugEventBreakPointHitCount); + v8::Debug::SetDebugEventListener(DebugEventBreakPointHitCount); SetBreakPoint(foo, 0); break_point_hit_count = 0; @@ -3006,7 +3006,7 @@ TEST(DebugStepLinearMixedICs) { // Without stepping only active break points are hit. CHECK_EQ(1, break_point_hit_count); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -3016,7 +3016,7 @@ TEST(DebugStepDeclarations) { v8::HandleScope scope(env->GetIsolate()); // Register a debug event listener which steps and counts. - v8::Debug::SetDebugEventListener2(DebugEventStep); + v8::Debug::SetDebugEventListener(DebugEventStep); // Create a function for testing stepping. Run it to allow it to get // optimized. @@ -3039,7 +3039,7 @@ TEST(DebugStepDeclarations) { CHECK_EQ(6, break_point_hit_count); // Get rid of the debug event listener. - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -3049,7 +3049,7 @@ TEST(DebugStepLocals) { v8::HandleScope scope(env->GetIsolate()); // Register a debug event listener which steps and counts. - v8::Debug::SetDebugEventListener2(DebugEventStep); + v8::Debug::SetDebugEventListener(DebugEventStep); // Create a function for testing stepping. Run it to allow it to get // optimized. @@ -3072,7 +3072,7 @@ TEST(DebugStepLocals) { CHECK_EQ(6, break_point_hit_count); // Get rid of the debug event listener. - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -3083,7 +3083,7 @@ TEST(DebugStepIf) { v8::HandleScope scope(isolate); // Register a debug event listener which steps and counts. - v8::Debug::SetDebugEventListener2(DebugEventStep); + v8::Debug::SetDebugEventListener(DebugEventStep); // Create a function for testing stepping. Run it to allow it to get // optimized. @@ -3116,7 +3116,7 @@ TEST(DebugStepIf) { CHECK_EQ(5, break_point_hit_count); // Get rid of the debug event listener. - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -3127,7 +3127,7 @@ TEST(DebugStepSwitch) { v8::HandleScope scope(isolate); // Register a debug event listener which steps and counts. - v8::Debug::SetDebugEventListener2(DebugEventStep); + v8::Debug::SetDebugEventListener(DebugEventStep); // Create a function for testing stepping. Run it to allow it to get // optimized. @@ -3173,7 +3173,7 @@ TEST(DebugStepSwitch) { CHECK_EQ(7, break_point_hit_count); // Get rid of the debug event listener. - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -3184,7 +3184,7 @@ TEST(DebugStepWhile) { v8::HandleScope scope(isolate); // Register a debug event listener which steps and counts. - v8::Debug::SetDebugEventListener2(DebugEventStep); + v8::Debug::SetDebugEventListener(DebugEventStep); // Create a function for testing stepping. Run it to allow it to get // optimized. @@ -3214,7 +3214,7 @@ TEST(DebugStepWhile) { CHECK_EQ(202, break_point_hit_count); // Get rid of the debug event listener. - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -3225,7 +3225,7 @@ TEST(DebugStepDoWhile) { v8::HandleScope scope(isolate); // Register a debug event listener which steps and counts. - v8::Debug::SetDebugEventListener2(DebugEventStep); + v8::Debug::SetDebugEventListener(DebugEventStep); // Create a function for testing stepping. Run it to allow it to get // optimized. @@ -3255,7 +3255,7 @@ TEST(DebugStepDoWhile) { CHECK_EQ(202, break_point_hit_count); // Get rid of the debug event listener. - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -3266,7 +3266,7 @@ TEST(DebugStepFor) { v8::HandleScope scope(isolate); // Register a debug event listener which steps and counts. - v8::Debug::SetDebugEventListener2(DebugEventStep); + v8::Debug::SetDebugEventListener(DebugEventStep); // Create a function for testing stepping. Run it to allow it to get // optimized. @@ -3297,7 +3297,7 @@ TEST(DebugStepFor) { CHECK_EQ(203, break_point_hit_count); // Get rid of the debug event listener. - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -3308,7 +3308,7 @@ TEST(DebugStepForContinue) { v8::HandleScope scope(isolate); // Register a debug event listener which steps and counts. - v8::Debug::SetDebugEventListener2(DebugEventStep); + v8::Debug::SetDebugEventListener(DebugEventStep); // Create a function for testing stepping. Run it to allow it to get // optimized. @@ -3349,7 +3349,7 @@ TEST(DebugStepForContinue) { CHECK_EQ(457, break_point_hit_count); // Get rid of the debug event listener. - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -3360,7 +3360,7 @@ TEST(DebugStepForBreak) { v8::HandleScope scope(isolate); // Register a debug event listener which steps and counts. - v8::Debug::SetDebugEventListener2(DebugEventStep); + v8::Debug::SetDebugEventListener(DebugEventStep); // Create a function for testing stepping. Run it to allow it to get // optimized. @@ -3402,7 +3402,7 @@ TEST(DebugStepForBreak) { CHECK_EQ(505, break_point_hit_count); // Get rid of the debug event listener. - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -3412,7 +3412,7 @@ TEST(DebugStepForIn) { v8::HandleScope scope(env->GetIsolate()); // Register a debug event listener which steps and counts. - v8::Debug::SetDebugEventListener2(DebugEventStep); + v8::Debug::SetDebugEventListener(DebugEventStep); // Create a function for testing stepping. Run it to allow it to get // optimized. @@ -3450,7 +3450,7 @@ TEST(DebugStepForIn) { CHECK_EQ(8, break_point_hit_count); // Get rid of the debug event listener. - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -3460,7 +3460,7 @@ TEST(DebugStepWith) { v8::HandleScope scope(env->GetIsolate()); // Register a debug event listener which steps and counts. - v8::Debug::SetDebugEventListener2(DebugEventStep); + v8::Debug::SetDebugEventListener(DebugEventStep); // Create a function for testing stepping. Run it to allow it to get // optimized. @@ -3482,7 +3482,7 @@ TEST(DebugStepWith) { CHECK_EQ(4, break_point_hit_count); // Get rid of the debug event listener. - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -3493,7 +3493,7 @@ TEST(DebugConditional) { v8::HandleScope scope(isolate); // Register a debug event listener which steps and counts. - v8::Debug::SetDebugEventListener2(DebugEventStep); + v8::Debug::SetDebugEventListener(DebugEventStep); // Create a function for testing stepping. Run it to allow it to get // optimized. @@ -3519,7 +3519,7 @@ TEST(DebugConditional) { CHECK_EQ(5, break_point_hit_count); // Get rid of the debug event listener. - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -3534,7 +3534,7 @@ TEST(StepInOutSimple) { "frame_function_name"); // Register a debug event listener which steps and counts. - v8::Debug::SetDebugEventListener2(DebugEventStepSequence); + v8::Debug::SetDebugEventListener(DebugEventStepSequence); // Create a function for testing stepping. Run it to allow it to get // optimized. @@ -3570,7 +3570,7 @@ TEST(StepInOutSimple) { break_point_hit_count); // Get rid of the debug event listener. - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -3585,7 +3585,7 @@ TEST(StepInOutTree) { "frame_function_name"); // Register a debug event listener which steps and counts. - v8::Debug::SetDebugEventListener2(DebugEventStepSequence); + v8::Debug::SetDebugEventListener(DebugEventStepSequence); // Create a function for testing stepping. Run it to allow it to get // optimized. @@ -3622,7 +3622,7 @@ TEST(StepInOutTree) { break_point_hit_count); // Get rid of the debug event listener. - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(true); } @@ -3637,7 +3637,7 @@ TEST(StepInOutBranch) { "frame_function_name"); // Register a debug event listener which steps and counts. - v8::Debug::SetDebugEventListener2(DebugEventStepSequence); + v8::Debug::SetDebugEventListener(DebugEventStepSequence); // Create a function for testing stepping. Run it to allow it to get // optimized. @@ -3657,7 +3657,7 @@ TEST(StepInOutBranch) { break_point_hit_count); // Get rid of the debug event listener. - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -3674,7 +3674,7 @@ TEST(DebugStepNatives) { "foo"); // Register a debug event listener which steps and counts. - v8::Debug::SetDebugEventListener2(DebugEventStep); + v8::Debug::SetDebugEventListener(DebugEventStep); step_action = StepIn; break_point_hit_count = 0; @@ -3683,11 +3683,11 @@ TEST(DebugStepNatives) { // With stepping all break locations are hit. CHECK_EQ(3, break_point_hit_count); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); // Register a debug event listener which just counts. - v8::Debug::SetDebugEventListener2(DebugEventBreakPointHitCount); + v8::Debug::SetDebugEventListener(DebugEventBreakPointHitCount); break_point_hit_count = 0; foo->Call(env->Global(), 0, NULL); @@ -3695,7 +3695,7 @@ TEST(DebugStepNatives) { // Without stepping only active break points are hit. CHECK_EQ(1, break_point_hit_count); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -3713,7 +3713,7 @@ TEST(DebugStepFunctionApply) { "foo"); // Register a debug event listener which steps and counts. - v8::Debug::SetDebugEventListener2(DebugEventStep); + v8::Debug::SetDebugEventListener(DebugEventStep); step_action = StepIn; break_point_hit_count = 0; @@ -3722,11 +3722,11 @@ TEST(DebugStepFunctionApply) { // With stepping all break locations are hit. CHECK_EQ(7, break_point_hit_count); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); // Register a debug event listener which just counts. - v8::Debug::SetDebugEventListener2(DebugEventBreakPointHitCount); + v8::Debug::SetDebugEventListener(DebugEventBreakPointHitCount); break_point_hit_count = 0; foo->Call(env->Global(), 0, NULL); @@ -3734,7 +3734,7 @@ TEST(DebugStepFunctionApply) { // Without stepping only the debugger statement is hit. CHECK_EQ(1, break_point_hit_count); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -3759,7 +3759,7 @@ TEST(DebugStepFunctionCall) { "foo"); // Register a debug event listener which steps and counts. - v8::Debug::SetDebugEventListener2(DebugEventStep); + v8::Debug::SetDebugEventListener(DebugEventStep); step_action = StepIn; // Check stepping where the if condition in bar is false. @@ -3774,11 +3774,11 @@ TEST(DebugStepFunctionCall) { foo->Call(env->Global(), argc, argv); CHECK_EQ(8, break_point_hit_count); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); // Register a debug event listener which just counts. - v8::Debug::SetDebugEventListener2(DebugEventBreakPointHitCount); + v8::Debug::SetDebugEventListener(DebugEventBreakPointHitCount); break_point_hit_count = 0; foo->Call(env->Global(), 0, NULL); @@ -3786,7 +3786,7 @@ TEST(DebugStepFunctionCall) { // Without stepping only the debugger statement is hit. CHECK_EQ(1, break_point_hit_count); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -3798,7 +3798,7 @@ TEST(PauseInScript) { env.ExposeDebug(); // Register a debug event listener which counts. - v8::Debug::SetDebugEventListener2(DebugEventCounter); + v8::Debug::SetDebugEventListener(DebugEventCounter); // Create a script that returns a function. const char* src = "(function (evt) {})"; @@ -3819,7 +3819,7 @@ TEST(PauseInScript) { CHECK_EQ(1, break_point_hit_count); // Get rid of the debug event listener. - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -3845,7 +3845,7 @@ TEST(BreakOnException) { CompileFunction(&env, "function notCaught(){throws();}", "notCaught"); v8::V8::AddMessageListener(MessageCallbackCount); - v8::Debug::SetDebugEventListener2(DebugEventCounter); + v8::Debug::SetDebugEventListener(DebugEventCounter); // Initial state should be no break on exceptions. DebugEventCounterClear(); @@ -3963,7 +3963,7 @@ TEST(BreakOnException) { CHECK_EQ(1, uncaught_exception_hit_count); CHECK_EQ(1, message_callback_count); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); v8::V8::RemoveMessageListeners(MessageCallbackCount); } @@ -3983,7 +3983,7 @@ TEST(BreakOnCompileException) { frame_count = CompileFunction(&env, frame_count_source, "frame_count"); v8::V8::AddMessageListener(MessageCallbackCount); - v8::Debug::SetDebugEventListener2(DebugEventCounter); + v8::Debug::SetDebugEventListener(DebugEventCounter); DebugEventCounterClear(); MessageCallbackCountClear(); @@ -4039,7 +4039,7 @@ TEST(StepWithException) { "frame_function_name"); // Register a debug event listener which steps and counts. - v8::Debug::SetDebugEventListener2(DebugEventStepSequence); + v8::Debug::SetDebugEventListener(DebugEventStepSequence); // Create functions for testing stepping. const char* src = "function a() { n(); }; " @@ -4111,7 +4111,7 @@ TEST(StepWithException) { break_point_hit_count); // Get rid of the debug event listener. - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -4126,7 +4126,7 @@ TEST(DebugBreak) { v8::HandleScope scope(isolate); // Register a debug event listener which sets the break flag and counts. - v8::Debug::SetDebugEventListener2(DebugEventBreak); + v8::Debug::SetDebugEventListener(DebugEventBreak); // Create a function for testing stepping. const char* src = "function f0() {}" @@ -4166,7 +4166,7 @@ TEST(DebugBreak) { CHECK_EQ(4 * ARRAY_SIZE(argv), break_point_hit_count); // Get rid of the debug event listener. - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -4178,7 +4178,7 @@ TEST(DisableBreak) { v8::HandleScope scope(env->GetIsolate()); // Register a debug event listener which sets the break flag and counts. - v8::Debug::SetDebugEventListener2(DebugEventCounter); + v8::Debug::SetDebugEventListener(DebugEventCounter); // Create a function for testing stepping. const char* src = "function f() {g()};function g(){i=0; while(i<10){i++}}"; @@ -4204,7 +4204,7 @@ TEST(DisableBreak) { CHECK_EQ(2, break_point_hit_count); // Get rid of the debug event listener. - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -4220,7 +4220,7 @@ TEST(NoBreakWhenBootstrapping) { v8::HandleScope scope(isolate); // Register a debug event listener which sets the break flag and counts. - v8::Debug::SetDebugEventListener2(DebugEventCounter); + v8::Debug::SetDebugEventListener(DebugEventCounter); // Set the debug break flag. v8::Debug::DebugBreak(isolate); @@ -4239,7 +4239,7 @@ TEST(NoBreakWhenBootstrapping) { CHECK_EQ(0, break_point_hit_count); // Get rid of the debug event listener. - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -4961,7 +4961,7 @@ TEST(MessageQueues) { // Create a V8 environment DebugLocalContext env; v8::HandleScope scope(env->GetIsolate()); - v8::Debug::SetMessageHandler2(MessageHandler); + v8::Debug::SetMessageHandler(MessageHandler); message_queue_debugger_thread.Start(); const char* source_1 = "a = 3; b = 4; c = new Object(); c.d = 5;"; @@ -5055,7 +5055,7 @@ TEST(SendClientDataToHandler) { v8::HandleScope scope(isolate); TestClientData::ResetCounters(); handled_client_data_instances_count = 0; - v8::Debug::SetMessageHandler2(MessageHandlerCountingClientData); + v8::Debug::SetMessageHandler(MessageHandlerCountingClientData); const char* source_1 = "a = 3; b = 4; c = new Object(); c.d = 5;"; const int kBufferSize = 1000; uint16_t buffer[kBufferSize]; @@ -5162,7 +5162,7 @@ void V8Thread::Run() { v8::Isolate::Scope isolate_scope(isolate); DebugLocalContext env; v8::HandleScope scope(env->GetIsolate()); - v8::Debug::SetMessageHandler2(&ThreadedMessageHandler); + v8::Debug::SetMessageHandler(&ThreadedMessageHandler); v8::Handle global_template = v8::ObjectTemplate::New(env->GetIsolate()); global_template->Set( @@ -5281,7 +5281,7 @@ void BreakpointsV8Thread::Run() { v8::Isolate::Scope isolate_scope(isolate); DebugLocalContext env; v8::HandleScope scope(isolate); - v8::Debug::SetMessageHandler2(&BreakpointsMessageHandler); + v8::Debug::SetMessageHandler(&BreakpointsMessageHandler); CompileRun(source_1); breakpoints_barriers->barrier_1.Wait(); @@ -5438,7 +5438,7 @@ static void DummyDebugEventListener( TEST(SetDebugEventListenerOnUninitializedVM) { - v8::Debug::SetDebugEventListener2(DummyDebugEventListener); + v8::Debug::SetDebugEventListener(DummyDebugEventListener); } @@ -5447,7 +5447,7 @@ static void DummyMessageHandler(const v8::Debug::Message& message) { TEST(SetMessageHandlerOnUninitializedVM) { - v8::Debug::SetMessageHandler2(DummyMessageHandler); + v8::Debug::SetMessageHandler(DummyMessageHandler); } @@ -5639,7 +5639,7 @@ TEST(DebuggerUnload) { // Set a debug event listener. break_point_hit_count = 0; - v8::Debug::SetDebugEventListener2(DebugEventBreakPointHitCount); + v8::Debug::SetDebugEventListener(DebugEventBreakPointHitCount); { v8::HandleScope scope(env->GetIsolate()); // Create a couple of functions for the test. @@ -5664,12 +5664,12 @@ TEST(DebuggerUnload) { // Remove the debug event listener without clearing breakpoints. Do this // outside a handle scope. - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(true); // Now set a debug message handler. break_point_hit_count = 0; - v8::Debug::SetMessageHandler2(MessageHandlerBreakPointHitCount); + v8::Debug::SetMessageHandler(MessageHandlerBreakPointHitCount); { v8::HandleScope scope(env->GetIsolate()); @@ -5689,7 +5689,7 @@ TEST(DebuggerUnload) { // Remove the debug message handler without clearing breakpoints. Do this // outside a handle scope. - v8::Debug::SetMessageHandler2(NULL); + v8::Debug::SetMessageHandler(NULL); CheckDebuggerUnloaded(true); } @@ -5732,7 +5732,7 @@ TEST(DebuggerClearMessageHandler) { CheckDebuggerUnloaded(); // Set a debug message handler. - v8::Debug::SetMessageHandler2(MessageHandlerHitCount); + v8::Debug::SetMessageHandler(MessageHandlerHitCount); // Run code to throw a unhandled exception. This should end up in the message // handler. @@ -5743,7 +5743,7 @@ TEST(DebuggerClearMessageHandler) { // Clear debug message handler. message_handler_hit_count = 0; - v8::Debug::SetMessageHandler2(NULL); + v8::Debug::SetMessageHandler(NULL); // Run code to throw a unhandled exception. This should end up in the message // handler. @@ -5762,7 +5762,7 @@ static void MessageHandlerClearingMessageHandler( message_handler_hit_count++; // Clear debug message handler. - v8::Debug::SetMessageHandler2(NULL); + v8::Debug::SetMessageHandler(NULL); } @@ -5775,7 +5775,7 @@ TEST(DebuggerClearMessageHandlerWhileActive) { CheckDebuggerUnloaded(); // Set a debug message handler. - v8::Debug::SetMessageHandler2(MessageHandlerClearingMessageHandler); + v8::Debug::SetMessageHandler(MessageHandlerClearingMessageHandler); // Run code to throw a unhandled exception. This should end up in the message // handler. @@ -6087,7 +6087,7 @@ TEST(ScriptNameAndData) { frame_script_name_source, "frame_script_name"); - v8::Debug::SetDebugEventListener2(DebugEventBreakPointHitCount); + v8::Debug::SetDebugEventListener(DebugEventBreakPointHitCount); // Test function source. v8::Local script = v8::String::NewFromUtf8(env->GetIsolate(), @@ -6180,7 +6180,7 @@ TEST(ContextData) { context_1 = v8::Context::New(isolate, NULL, global_template, global_object); context_2 = v8::Context::New(isolate, NULL, global_template, global_object); - v8::Debug::SetMessageHandler2(ContextCheckMessageHandler); + v8::Debug::SetMessageHandler(ContextCheckMessageHandler); // Default data value is undefined. CHECK(context_1->GetEmbedderData(0)->IsUndefined()); @@ -6219,7 +6219,7 @@ TEST(ContextData) { // Two times compile event and two times break event. CHECK_GT(message_handler_hit_count, 4); - v8::Debug::SetMessageHandler2(NULL); + v8::Debug::SetMessageHandler(NULL); CheckDebuggerUnloaded(); } @@ -6248,7 +6248,7 @@ TEST(DebugBreakInMessageHandler) { DebugLocalContext env; v8::HandleScope scope(env->GetIsolate()); - v8::Debug::SetMessageHandler2(DebugBreakMessageHandler); + v8::Debug::SetMessageHandler(DebugBreakMessageHandler); // Test functions. const char* script = "function f() { debugger; g(); } function g() { }"; @@ -6328,7 +6328,7 @@ TEST(RegExpDebugBreak) { v8::Local result = f->Call(env->Global(), argc, argv); CHECK_EQ(12, result->Int32Value()); - v8::Debug::SetDebugEventListener2(DebugEventDebugBreak); + v8::Debug::SetDebugEventListener(DebugEventDebugBreak); v8::Debug::DebugBreak(env->GetIsolate()); result = f->Call(env->Global(), argc, argv); @@ -6342,7 +6342,7 @@ TEST(RegExpDebugBreak) { // Common part of EvalContextData and NestedBreakEventContextData tests. static void ExecuteScriptForContextCheck( - v8::Debug::MessageHandler2 message_handler) { + v8::Debug::MessageHandler message_handler) { // Create a context. v8::Handle context_1; v8::Handle global_template = @@ -6350,7 +6350,7 @@ static void ExecuteScriptForContextCheck( context_1 = v8::Context::New(CcTest::isolate(), NULL, global_template); - v8::Debug::SetMessageHandler2(message_handler); + v8::Debug::SetMessageHandler(message_handler); // Default data value is undefined. CHECK(context_1->GetEmbedderData(0)->IsUndefined()); @@ -6373,7 +6373,7 @@ static void ExecuteScriptForContextCheck( f->Call(context_1->Global(), 0, NULL); } - v8::Debug::SetMessageHandler2(NULL); + v8::Debug::SetMessageHandler(NULL); } @@ -6488,7 +6488,7 @@ TEST(ScriptCollectedEvent) { CcTest::heap()->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask); script_collected_count = 0; - v8::Debug::SetDebugEventListener2(DebugEventScriptCollectedEvent); + v8::Debug::SetDebugEventListener(DebugEventScriptCollectedEvent); { v8::Script::Compile( v8::String::NewFromUtf8(env->GetIsolate(), "eval('a=1')"))->Run(); @@ -6502,7 +6502,7 @@ TEST(ScriptCollectedEvent) { CHECK_EQ(2, script_collected_count); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -6551,7 +6551,7 @@ TEST(ScriptCollectedEventContext) { // collected afterwards. CcTest::heap()->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask); - v8::Debug::SetMessageHandler2(ScriptCollectedMessageHandler); + v8::Debug::SetMessageHandler(ScriptCollectedMessageHandler); v8::Script::Compile(v8::String::NewFromUtf8(isolate, "eval('a=1')"))->Run(); v8::Script::Compile(v8::String::NewFromUtf8(isolate, "eval('a=2')"))->Run(); @@ -6570,7 +6570,7 @@ TEST(ScriptCollectedEventContext) { CHECK_EQ(2, script_collected_message_count); - v8::Debug::SetMessageHandler2(NULL); + v8::Debug::SetMessageHandler(NULL); } @@ -6596,18 +6596,18 @@ TEST(AfterCompileMessageWhenMessageHandlerIsReset) { after_compile_message_count = 0; const char* script = "var a=1"; - v8::Debug::SetMessageHandler2(AfterCompileMessageHandler); + v8::Debug::SetMessageHandler(AfterCompileMessageHandler); v8::Script::Compile(v8::String::NewFromUtf8(env->GetIsolate(), script)) ->Run(); - v8::Debug::SetMessageHandler2(NULL); + v8::Debug::SetMessageHandler(NULL); - v8::Debug::SetMessageHandler2(AfterCompileMessageHandler); + v8::Debug::SetMessageHandler(AfterCompileMessageHandler); v8::Debug::DebugBreak(env->GetIsolate()); v8::Script::Compile(v8::String::NewFromUtf8(env->GetIsolate(), script)) ->Run(); // Setting listener to NULL should cause debugger unload. - v8::Debug::SetMessageHandler2(NULL); + v8::Debug::SetMessageHandler(NULL); CheckDebuggerUnloaded(); // Compilation cache should be disabled when debugger is active. @@ -6622,19 +6622,19 @@ TEST(BreakMessageWhenMessageHandlerIsReset) { after_compile_message_count = 0; const char* script = "function f() {};"; - v8::Debug::SetMessageHandler2(AfterCompileMessageHandler); + v8::Debug::SetMessageHandler(AfterCompileMessageHandler); v8::Script::Compile(v8::String::NewFromUtf8(env->GetIsolate(), script)) ->Run(); - v8::Debug::SetMessageHandler2(NULL); + v8::Debug::SetMessageHandler(NULL); - v8::Debug::SetMessageHandler2(AfterCompileMessageHandler); + v8::Debug::SetMessageHandler(AfterCompileMessageHandler); v8::Debug::DebugBreak(env->GetIsolate()); v8::Local f = v8::Local::Cast( env->Global()->Get(v8::String::NewFromUtf8(env->GetIsolate(), "f"))); f->Call(env->Global(), 0, NULL); // Setting message handler to NULL should cause debugger unload. - v8::Debug::SetMessageHandler2(NULL); + v8::Debug::SetMessageHandler(NULL); CheckDebuggerUnloaded(); // Compilation cache should be disabled when debugger is active. @@ -6662,18 +6662,18 @@ TEST(ExceptionMessageWhenMessageHandlerIsReset) { exception_event_count = 0; const char* script = "function f() {throw new Error()};"; - v8::Debug::SetMessageHandler2(AfterCompileMessageHandler); + v8::Debug::SetMessageHandler(AfterCompileMessageHandler); v8::Script::Compile(v8::String::NewFromUtf8(env->GetIsolate(), script)) ->Run(); - v8::Debug::SetMessageHandler2(NULL); + v8::Debug::SetMessageHandler(NULL); - v8::Debug::SetMessageHandler2(ExceptionMessageHandler); + v8::Debug::SetMessageHandler(ExceptionMessageHandler); v8::Local f = v8::Local::Cast( env->Global()->Get(v8::String::NewFromUtf8(env->GetIsolate(), "f"))); f->Call(env->Global(), 0, NULL); // Setting message handler to NULL should cause debugger unload. - v8::Debug::SetMessageHandler2(NULL); + v8::Debug::SetMessageHandler(NULL); CheckDebuggerUnloaded(); CHECK_EQ(1, exception_event_count); @@ -6697,7 +6697,7 @@ TEST(ProvisionalBreakpointOnLineOutOfRange) { SetScriptBreakPointByNameFromJS(env->GetIsolate(), resource_name, 5, 5); after_compile_message_count = 0; - v8::Debug::SetMessageHandler2(AfterCompileMessageHandler); + v8::Debug::SetMessageHandler(AfterCompileMessageHandler); v8::ScriptOrigin origin( v8::String::NewFromUtf8(env->GetIsolate(), resource_name), @@ -6715,7 +6715,7 @@ TEST(ProvisionalBreakpointOnLineOutOfRange) { ClearBreakPointFromJS(env->GetIsolate(), sbp1); ClearBreakPointFromJS(env->GetIsolate(), sbp2); - v8::Debug::SetMessageHandler2(NULL); + v8::Debug::SetMessageHandler(NULL); } @@ -6756,7 +6756,7 @@ TEST(NoDebugBreakInAfterCompileMessageHandler) { v8::HandleScope scope(env->GetIsolate()); // Register a debug event listener which sets the break flag and counts. - v8::Debug::SetMessageHandler2(BreakMessageHandler); + v8::Debug::SetMessageHandler(BreakMessageHandler); // Set the debug break flag. v8::Debug::DebugBreak(env->GetIsolate()); @@ -6775,7 +6775,7 @@ TEST(NoDebugBreakInAfterCompileMessageHandler) { CHECK_EQ(2, break_point_hit_count); // Get rid of the debug message handler. - v8::Debug::SetMessageHandler2(NULL); + v8::Debug::SetMessageHandler(NULL); CheckDebuggerUnloaded(); } @@ -6795,7 +6795,7 @@ TEST(ProcessDebugMessages) { counting_message_handler_counter = 0; - v8::Debug::SetMessageHandler2(CountingMessageHandler); + v8::Debug::SetMessageHandler(CountingMessageHandler); const int kBufferSize = 1000; uint16_t buffer[kBufferSize]; @@ -6825,7 +6825,7 @@ TEST(ProcessDebugMessages) { CHECK_GE(counting_message_handler_counter, 2); // Get rid of the debug message handler. - v8::Debug::SetMessageHandler2(NULL); + v8::Debug::SetMessageHandler(NULL); CheckDebuggerUnloaded(); } @@ -6853,7 +6853,7 @@ TEST(Backtrace) { v8::Isolate* isolate = env->GetIsolate(); v8::HandleScope scope(isolate); - v8::Debug::SetMessageHandler2(BacktraceData::MessageHandler); + v8::Debug::SetMessageHandler(BacktraceData::MessageHandler); const int kBufferSize = 1000; uint16_t buffer[kBufferSize]; @@ -6887,7 +6887,7 @@ TEST(Backtrace) { CHECK_EQ(BacktraceData::frame_counter, 1); // Get rid of the debug message handler. - v8::Debug::SetMessageHandler2(NULL); + v8::Debug::SetMessageHandler(NULL); CheckDebuggerUnloaded(); } @@ -6927,7 +6927,7 @@ TEST(DebugBreakFunctionApply) { "foo"); // Register a debug event listener which steps and counts. - v8::Debug::SetDebugEventListener2(DebugEventBreakMax); + v8::Debug::SetDebugEventListener(DebugEventBreakMax); // Set the debug break flag before calling the code using function.apply. v8::Debug::DebugBreak(env->GetIsolate()); @@ -6941,7 +6941,7 @@ TEST(DebugBreakFunctionApply) { // When keeping the debug break several break will happen. CHECK_GT(break_point_hit_count, 1); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -7010,7 +7010,7 @@ TEST(CallingContextIsNotDebugContext) { named->NewInstance()); // Register the debug event listener - v8::Debug::SetDebugEventListener2(DebugEventGetAtgumentPropertyValue); + v8::Debug::SetDebugEventListener(DebugEventGetAtgumentPropertyValue); // Create a function that invokes debugger. v8::Local foo = CompileFunction( @@ -7023,7 +7023,7 @@ TEST(CallingContextIsNotDebugContext) { foo->Call(env->Global(), 0, NULL); CHECK_EQ(1, break_point_hit_count); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); debugee_context = v8::Handle(); debugger_context = v8::Handle(); CheckDebuggerUnloaded(); @@ -7051,13 +7051,13 @@ TEST(DebugEventContext) { v8::HandleScope scope(isolate); expected_context = v8::Context::New(isolate); expected_callback_data = v8::Int32::New(isolate, 2010); - v8::Debug::SetDebugEventListener2(DebugEventContextChecker, + v8::Debug::SetDebugEventListener(DebugEventContextChecker, expected_callback_data); v8::Context::Scope context_scope(expected_context); v8::Script::Compile( v8::String::NewFromUtf8(isolate, "(function(){debugger;})();"))->Run(); expected_context.Clear(); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); expected_context_data = v8::Handle(); CheckDebuggerUnloaded(); } @@ -7081,7 +7081,7 @@ TEST(DebugEventBreakData) { DebugLocalContext env; v8::Isolate* isolate = env->GetIsolate(); v8::HandleScope scope(isolate); - v8::Debug::SetDebugEventListener2(DebugEventBreakDataChecker); + v8::Debug::SetDebugEventListener(DebugEventBreakDataChecker); TestClientData::constructor_call_counter = 0; TestClientData::destructor_call_counter = 0; @@ -7133,7 +7133,7 @@ TEST(DebugEventBreakData) { CHECK_EQ(TestClientData::constructor_call_counter, TestClientData::destructor_call_counter); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -7187,7 +7187,7 @@ TEST(DeoptimizeDuringDebugBreak) { // This tests lazy deoptimization bailout for the stack check, as the first // time in function bar when using debug break and no break points will be at // the initial stack check. - v8::Debug::SetDebugEventListener2(DebugEventBreakDeoptimize); + v8::Debug::SetDebugEventListener(DebugEventBreakDeoptimize); // Compile and run function bar which will optimize it for some flag settings. v8::Script::Compile(v8::String::NewFromUtf8( @@ -7200,7 +7200,7 @@ TEST(DeoptimizeDuringDebugBreak) { CHECK(debug_event_break_deoptimize_done); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); } @@ -7255,7 +7255,7 @@ static void DebugEventBreakWithOptimizedStack( static void ScheduleBreak(const v8::FunctionCallbackInfo& args) { - v8::Debug::SetDebugEventListener2(DebugEventBreakWithOptimizedStack); + v8::Debug::SetDebugEventListener(DebugEventBreakWithOptimizedStack); v8::Debug::DebugBreak(args.GetIsolate()); } @@ -7338,7 +7338,7 @@ TEST(DebugBreakLoop) { v8::HandleScope scope(env->GetIsolate()); // Register a debug event listener which sets the break flag and counts. - v8::Debug::SetDebugEventListener2(DebugEventBreakMax); + v8::Debug::SetDebugEventListener(DebugEventBreakMax); // Create a function for getting the frame count when hitting the break. frame_count = CompileFunction(&env, frame_count_source, "frame_count"); @@ -7372,7 +7372,7 @@ TEST(DebugBreakLoop) { TestDebugBreakInLoop("for (;a == 1;) {", loop_bodies, "}"); // Get rid of the debug event listener. - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -7408,7 +7408,7 @@ static void DebugBreakInlineListener( CHECK_EQ(expected_line_number[i], i::Script::GetLineNumber(source_script, result->Int32Value())); } - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); v8::V8::TerminateExecution(CcTest::isolate()); } @@ -7431,7 +7431,7 @@ TEST(DebugBreakInline) { "g(false); \n" "%OptimizeFunctionOnNextCall(g); \n" "g(true);"; - v8::Debug::SetDebugEventListener2(DebugBreakInlineListener); + v8::Debug::SetDebugEventListener(DebugBreakInlineListener); inline_script = v8::Script::Compile(v8::String::NewFromUtf8(env->GetIsolate(), source)); inline_script->Run(); @@ -7465,7 +7465,7 @@ TEST(Regress131642) { // on the stack. DebugLocalContext env; v8::HandleScope scope(env->GetIsolate()); - v8::Debug::SetDebugEventListener2(DebugEventStepNext); + v8::Debug::SetDebugEventListener(DebugEventStepNext); // We step through the first script. It exits through an exception. We run // this inside a new frame to record a different FP than the second script @@ -7477,7 +7477,7 @@ TEST(Regress131642) { const char* script_2 = "[0].forEach(function() { });"; CompileRun(script_2); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); } @@ -7494,15 +7494,15 @@ TEST(DebuggerCreatesContextIffActive) { v8::HandleScope scope(env->GetIsolate()); CHECK_EQ(1, CountNativeContexts()); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CompileRun("debugger;"); CHECK_EQ(1, CountNativeContexts()); - v8::Debug::SetDebugEventListener2(NopListener); + v8::Debug::SetDebugEventListener(NopListener); CompileRun("debugger;"); CHECK_EQ(2, CountNativeContexts()); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); } @@ -7532,7 +7532,7 @@ TEST(PrecompiledFunction) { DebugLocalContext env; v8::HandleScope scope(env->GetIsolate()); env.ExposeDebug(); - v8::Debug::SetDebugEventListener2(DebugBreakInlineListener); + v8::Debug::SetDebugEventListener(DebugBreakInlineListener); v8::Local break_here = CompileFunction(&env, "function break_here(){}", "break_here"); @@ -7554,7 +7554,7 @@ TEST(PrecompiledFunction) { v8::String::Utf8Value utf8(result); CHECK_EQ("bar", *utf8); - v8::Debug::SetDebugEventListener2(NULL); + v8::Debug::SetDebugEventListener(NULL); CheckDebuggerUnloaded(); } @@ -7573,7 +7573,7 @@ static void AddDebugBreak(const v8::FunctionCallbackInfo& args) { TEST(DebugBreakStackTrace) { DebugLocalContext env; v8::HandleScope scope(env->GetIsolate()); - v8::Debug::SetDebugEventListener2(DebugBreakStackTraceListener); + v8::Debug::SetDebugEventListener(DebugBreakStackTraceListener); v8::Handle add_debug_break_template = v8::FunctionTemplate::New(env->GetIsolate(), AddDebugBreak); v8::Handle add_debug_break = -- 2.7.4