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

Unified Diff: runtime/lib/stacktrace.cc

Issue 939773003: - Simplify collection of stack traces. If we determine that a stack (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 10 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 | « no previous file | runtime/lib/stacktrace.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/stacktrace.cc
===================================================================
--- runtime/lib/stacktrace.cc (revision 43827)
+++ runtime/lib/stacktrace.cc (working copy)
@@ -17,42 +17,18 @@
ASSERT(frame != NULL); // We expect to find a dart invocation frame.
Code& code = Code::Handle();
Smi& offset = Smi::Handle();
- intptr_t frames_to_skip = 2; // _setupFullStackTrace and the catch frame.
while (frame != NULL) {
if (frame->IsDartFrame()) {
code = frame->LookupDartCode();
offset = Smi::New(frame->pc() - code.EntryPoint());
- if (frames_to_skip > 0) {
- frames_to_skip--;
- } else {
- code_list.Add(code);
- pc_offset_list.Add(offset);
- }
+ code_list.Add(code);
+ pc_offset_list.Add(offset);
}
frame = frames.NextFrame();
}
}
-// Setup a full stack trace.
-// Arg0: stack trace object.
-// Return value: None.
-DEFINE_NATIVE_ENTRY(Stacktrace_setupFullStacktrace, 1) {
- const Stacktrace& trace =
- Stacktrace::CheckedHandle(arguments->NativeArgAt(0));
- const GrowableObjectArray& code_list =
- GrowableObjectArray::Handle(GrowableObjectArray::New());
- const GrowableObjectArray& pc_offset_list =
- GrowableObjectArray::Handle(GrowableObjectArray::New());
- IterateFrames(code_list, pc_offset_list);
- const Array& code_array = Array::Handle(Array::MakeArray(code_list));
- const Array& pc_offset_array =
- Array::Handle(Array::MakeArray(pc_offset_list));
- trace.SetCatchStacktrace(code_array, pc_offset_array);
- return Object::null();
-}
-
-
// An utility method for convenient printing of dart stack traces when
// inside 'gdb'. Note: This function will only work when there is a
// valid exit frame information. It will not work when a breakpoint is
@@ -69,7 +45,7 @@
Array::Handle(Array::MakeArray(pc_offset_list));
const Stacktrace& stacktrace = Stacktrace::Handle(
Stacktrace::New(code_array, pc_offset_array));
- OS::Print("%s\n", stacktrace.ToCString());
+ OS::PrintErr("=== Current Trace:\n%s\n===\n", stacktrace.ToCString());
}
} // namespace dart
« no previous file with comments | « no previous file | runtime/lib/stacktrace.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698