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

Unified Diff: test/cctest/test-debug.cc

Issue 256113003: Fix assertion when collecting stack trace from debug break. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix for the test Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/frames.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-debug.cc
diff --git a/test/cctest/test-debug.cc b/test/cctest/test-debug.cc
index a11c0303034b545d36ab9ca0ec8da69989c2636a..85e4512ea5a368ba54fce64c44aa143e0287915e 100644
--- a/test/cctest/test-debug.cc
+++ b/test/cctest/test-debug.cc
@@ -7659,3 +7659,34 @@ TEST(PrecompiledFunction) {
v8::Debug::SetDebugEventListener2(NULL);
CheckDebuggerUnloaded();
}
+
+
+static void DebugBreakStackTraceListener(
+ const v8::Debug::EventDetails& event_details) {
+ v8::StackTrace::CurrentStackTrace(CcTest::isolate(), 10);
+}
+
+
+static void AddDebugBreak(const v8::FunctionCallbackInfo<v8::Value>& args) {
+ v8::Debug::DebugBreak(args.GetIsolate());
+}
+
+
+TEST(DebugBreakStackTrace) {
+ DebugLocalContext env;
+ v8::HandleScope scope(env->GetIsolate());
+ v8::Debug::SetDebugEventListener2(DebugBreakStackTraceListener);
+ v8::Handle<v8::FunctionTemplate> add_debug_break_template =
+ v8::FunctionTemplate::New(env->GetIsolate(), AddDebugBreak);
+ v8::Handle<v8::Function> add_debug_break =
+ add_debug_break_template->GetFunction();
+ env->Global()->Set(v8_str("add_debug_break"), add_debug_break);
+
+ CompileRun("(function loop() {"
+ " for (var j = 0; j < 1000; j++) {"
+ " for (var i = 0; i < 1000; i++) {"
+ " if (i == 999) add_debug_break();"
+ " }"
+ " }"
+ "})()");
+}
« no previous file with comments | « src/frames.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698