Bug 837379 - Log main thread stack for off-main-thread exceptions; r=cpeterson

This commit is contained in:
Jim Chen 2013-06-24 16:10:03 -04:00
parent bf09512675
commit d7a68d8aaa

View File

@ -195,6 +195,14 @@ public class GeckoAppShell
Log.e(LOGTAG, ">>> REPORTING UNCAUGHT EXCEPTION FROM THREAD " Log.e(LOGTAG, ">>> REPORTING UNCAUGHT EXCEPTION FROM THREAD "
+ thread.getId() + " (\"" + thread.getName() + "\")", e); + thread.getId() + " (\"" + thread.getName() + "\")", e);
Thread mainThread = ThreadUtils.getUiThread();
if (mainThread != null && thread != mainThread) {
Log.e(LOGTAG, "Main thread stack:");
for (StackTraceElement ste : mainThread.getStackTrace()) {
Log.e(LOGTAG, ste.toString());
}
}
if (e instanceof OutOfMemoryError) { if (e instanceof OutOfMemoryError) {
SharedPreferences prefs = SharedPreferences prefs =
getContext().getSharedPreferences(GeckoApp.PREFS_NAME, 0); getContext().getSharedPreferences(GeckoApp.PREFS_NAME, 0);