Commit 5832ab85 authored by yangguo@chromium.org's avatar yangguo@chromium.org

Expose function CheckDebugBreak in the debugger api

API=v8::Debug::CheckDebugBreak
LOG=Y
R=aandrey@chromium.org, vsevik@chromium.org, yurys@chromium.org

Review URL: https://codereview.chromium.org/473913002

Patch from Sergei Vasilinetc <sergeyv@chromium.org>.

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23227 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 26d72d50
......@@ -167,6 +167,9 @@ class V8_EXPORT Debug {
// happened yet.
static void CancelDebugBreak(Isolate* isolate);
// Check if a debugger break is scheduled in the given isolate.
static bool CheckDebugBreak(Isolate* isolate);
// Break execution of JavaScript in the given isolate (this method
// can be invoked from a non-VM thread) for further client command
// execution on a VM thread. Client data is then passed in
......
......@@ -6911,6 +6911,12 @@ void Debug::CancelDebugBreak(Isolate* isolate) {
}
bool Debug::CheckDebugBreak(Isolate* isolate) {
i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate);
return internal_isolate->stack_guard()->CheckDebugBreak();
}
void Debug::DebugBreakForCommand(Isolate* isolate, ClientData* data) {
i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate);
internal_isolate->debug()->EnqueueDebugCommand(data);
......
......@@ -4151,6 +4151,7 @@ TEST(DebugBreak) {
// Set the debug break flag.
v8::Debug::DebugBreak(env->GetIsolate());
CHECK(v8::Debug::CheckDebugBreak(env->GetIsolate()));
// Call all functions with different argument count.
break_point_hit_count = 0;
......@@ -4183,6 +4184,12 @@ TEST(DisableBreak) {
const char* src = "function f() {g()};function g(){i=0; while(i<10){i++}}";
v8::Local<v8::Function> f = CompileFunction(&env, src, "f");
// Set, test and cancel debug break.
v8::Debug::DebugBreak(env->GetIsolate());
CHECK(v8::Debug::CheckDebugBreak(env->GetIsolate()));
v8::Debug::CancelDebugBreak(env->GetIsolate());
CHECK(!v8::Debug::CheckDebugBreak(env->GetIsolate()));
// Set the debug break flag.
v8::Debug::DebugBreak(env->GetIsolate());
......
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