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

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

Issue 544143003: Store frame pointers (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.27
Patch Set: moved to v8 trunk, added a unittest, and fixed compile warning from mainline v8 build. Created 6 years, 3 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/runtime.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 6375a6c47fe308eae4c9fbe5fd3bc857e4b55d0f..8782bca29000627bc8baf66509db16ae80bf6eda 100644
--- a/test/cctest/test-debug.cc
+++ b/test/cctest/test-debug.cc
@@ -7189,6 +7189,8 @@ static void DebugBreakInlineListener(
int frame_count = result->Int32Value();
CHECK_EQ(expected_frame_count, frame_count);
+ uint32_t last_frame_pointer_high;
+ uint32_t last_frame_pointer_low;
for (int i = 0; i < frame_count; i++) {
// The 5. element in the returned array of GetFrameDetails contains the
// source position of that frame.
@@ -7196,6 +7198,24 @@ static void DebugBreakInlineListener(
v8::Local<v8::Value> result = CompileRun(script);
CHECK_EQ(expected_line_number[i],
i::Script::GetLineNumber(source_script, result->Int32Value()));
+
+ // The 8. element in the returned array of GetFrameDetails contains the
+ // high address of the frame pointer.
+ SNPrintF(script_vector, "%%GetFrameDetails(%d, %d)[8]", break_id, i);
+ uint32_t frame_pointer_high = CompileRun(script)->Uint32Value();
+
+ // The 9. element in the returned array of GetFrameDetails contains the
+ // low address of the frame pointer.
+ SNPrintF(script_vector, "%%GetFrameDetails(%d, %d)[9]", break_id, i);
+ uint32_t frame_pointer_low = CompileRun(script)->Uint32Value();
+
+ if (i > 0) {
+ // We expect the stack to grow from high to low addresses.
+ CHECK(last_frame_pointer_high < frame_pointer_high ||
+ last_frame_pointer_low <= frame_pointer_low);
+ }
+ last_frame_pointer_high = frame_pointer_high;
+ last_frame_pointer_low = frame_pointer_low;
}
v8::Debug::SetDebugEventListener(NULL);
v8::V8::TerminateExecution(CcTest::isolate());
« no previous file with comments | « src/runtime.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698