Commit 20a62718 authored by yangguo@chromium.org's avatar yangguo@chromium.org

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