Revision: 23227
Author: [email protected]
Date: Wed Aug 20 11:04:05 2014 UTC
Log: Expose function CheckDebugBreak in the debugger api
API=v8::Debug::CheckDebugBreak
LOG=Y
[email protected], [email protected], [email protected]
Review URL: https://codereview.chromium.org/473913002
Patch from Sergei Vasilinetc <[email protected]>.
http://code.google.com/p/v8/source/detail?r=23227
Modified:
/branches/bleeding_edge/include/v8-debug.h
/branches/bleeding_edge/src/api.cc
/branches/bleeding_edge/test/cctest/test-debug.cc
=======================================
--- /branches/bleeding_edge/include/v8-debug.h Thu Jul 3 15:56:01 2014 UTC
+++ /branches/bleeding_edge/include/v8-debug.h Wed Aug 20 11:04:05 2014 UTC
@@ -167,6 +167,9 @@
// 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
=======================================
--- /branches/bleeding_edge/src/api.cc Tue Aug 19 16:07:05 2014 UTC
+++ /branches/bleeding_edge/src/api.cc Wed Aug 20 11:04:05 2014 UTC
@@ -6909,6 +6909,12 @@
i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate);
internal_isolate->stack_guard()->ClearDebugBreak();
}
+
+
+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) {
=======================================
--- /branches/bleeding_edge/test/cctest/test-debug.cc Tue Aug 12 13:33:35
2014 UTC
+++ /branches/bleeding_edge/test/cctest/test-debug.cc Wed Aug 20 11:04:05
2014 UTC
@@ -4151,6 +4151,7 @@
// 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 @@
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());
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.