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

Unified Diff: runtime/vm/exceptions.cc

Issue 12025038: Hide private corelib's method from stack trace in exceptions. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 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/vm/object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/exceptions.cc
===================================================================
--- runtime/vm/exceptions.cc (revision 17487)
+++ runtime/vm/exceptions.cc (working copy)
@@ -20,11 +20,20 @@
"Prints a stack trace everytime a throw occurs.");
DEFINE_FLAG(bool, heap_profile_out_of_memory, false,
"Writes a heap profile on unhandled out-of-memory exceptions.");
+DEFINE_FLAG(bool, verbose_stacktrace, false,
+ "Stack traces will include methods marked invisible.");
-
const char* Exceptions::kCastErrorDstName = "type cast";
+static bool ShouldShowFunction(const Function& function) {
+ if (FLAG_verbose_stacktrace) {
+ return true;
+ }
+ return function.is_visible();
+}
+
+
// Iterate through the stack frames and try to find a frame with an
// exception handler. Once found, set the pc, sp and fp so that execution
// can continue in that frame.
@@ -56,16 +65,20 @@
ASSERT(pc != 0);
code = func.unoptimized_code();
offset = Smi::New(pc - code.EntryPoint());
+ if (ShouldShowFunction(func)) {
+ func_list.Add(func);
+ code_list.Add(code);
+ pc_offset_list.Add(offset);
+ }
+ }
+ } else {
+ offset = Smi::New(frame->pc() - code.EntryPoint());
+ func = code.function();
+ if (ShouldShowFunction(func)) {
func_list.Add(func);
code_list.Add(code);
pc_offset_list.Add(offset);
}
- } else {
- offset = Smi::New(frame->pc() - code.EntryPoint());
- func = code.function();
- func_list.Add(func);
- code_list.Add(code);
- pc_offset_list.Add(offset);
}
if (frame->FindExceptionHandler(handler_pc)) {
*handler_sp = frame->sp();
« no previous file with comments | « no previous file | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698