Add AllocStackTrace(). Move InternalStackTrace to managed heap.
Replaces trace.method and trace.pc with IntArray and ObjectArray<Method>.
Exception_tests pass.
Change-Id: I54431bbf8031b186fdd360ec27a31b11c8eff052
diff --git a/src/exception_test.cc b/src/exception_test.cc
index 4337d7a..a1a101d 100644
--- a/src/exception_test.cc
+++ b/src/exception_test.cc
@@ -148,18 +148,18 @@
Thread* thread = Thread::Current();
thread->SetTopOfStack(fake_stack);
- Thread::InternalStackTrace* traces = thread->GetStackTrace(2);
- ObjectArray<StackTraceElement>* trace_array = thread->GetStackTraceElement(2, traces);
- delete[] traces;
+ ObjectArray<StackTraceElement>* trace_array = thread->AllocStackTrace(2);
ASSERT_TRUE(trace_array->Get(0) != NULL);
- EXPECT_STREQ("java.lang.MyClass", trace_array->Get(0)->GetDeclaringClass()->ToModifiedUtf8().c_str());
+ EXPECT_STREQ("java.lang.MyClass",
+ trace_array->Get(0)->GetDeclaringClass()->ToModifiedUtf8().c_str());
EXPECT_STREQ("MyClass.java", trace_array->Get(0)->GetFileName()->ToModifiedUtf8().c_str());
EXPECT_STREQ("g", trace_array->Get(0)->GetMethodName()->ToModifiedUtf8().c_str());
EXPECT_EQ(22u, trace_array->Get(0)->GetLineNumber());
ASSERT_TRUE(trace_array->Get(1) != NULL);
- EXPECT_STREQ("java.lang.MyClass", trace_array->Get(1)->GetDeclaringClass()->ToModifiedUtf8().c_str());
+ EXPECT_STREQ("java.lang.MyClass",
+ trace_array->Get(1)->GetDeclaringClass()->ToModifiedUtf8().c_str());
EXPECT_STREQ("MyClass.java", trace_array->Get(1)->GetFileName()->ToModifiedUtf8().c_str());
EXPECT_STREQ("f", trace_array->Get(1)->GetMethodName()->ToModifiedUtf8().c_str());
EXPECT_EQ(7u, trace_array->Get(1)->GetLineNumber());