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
Родитель bf09512675
Коммит d7a68d8aaa
1 изменённых файлов: 8 добавлений и 0 удалений

Просмотреть файл

@ -195,6 +195,14 @@ public class GeckoAppShell
Log.e(LOGTAG, ">>> REPORTING UNCAUGHT EXCEPTION FROM THREAD "
+ 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) {
SharedPreferences prefs =
getContext().getSharedPreferences(GeckoApp.PREFS_NAME, 0);