diff options
author | Gabriele Svelto <gsvelto@mozilla.com> | 2014-09-05 15:08:16 -0700 |
---|---|---|
committer | Gabriele Svelto <gsvelto@mozilla.com> | 2014-09-05 15:08:16 -0700 |
commit | 505267fbc9545ce8c023fed45ae2787e56e5a0e2 (patch) | |
tree | ada4592402743c87e6a05598a1248b52301fe45b | |
parent | 64382a2c58531370a92bbf782de16c14508cd670 (diff) | |
download | nspr-hg-505267fbc9545ce8c023fed45ae2787e56e5a0e2.tar.gz |
Bug 1060292: Make PR_Assert() and PR_Abort() output visible in the
logcat on Android. r=wtc.
-rw-r--r-- | pr/src/io/prlog.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/pr/src/io/prlog.c b/pr/src/io/prlog.c index eec95e8a..dae80282 100644 --- a/pr/src/io/prlog.c +++ b/pr/src/io/prlog.c @@ -537,6 +537,9 @@ PR_IMPLEMENT(void) PR_LogFlush(void) PR_IMPLEMENT(void) PR_Abort(void) { PR_LogPrint("Aborting"); +#ifdef ANDROID + __android_log_write(ANDROID_LOG_ERROR, "PRLog", "Aborting"); +#endif abort(); } @@ -547,9 +550,11 @@ PR_IMPLEMENT(void) PR_Assert(const char *s, const char *file, PRIntn ln) fflush(stderr); #ifdef WIN32 DebugBreak(); -#endif -#ifdef XP_OS2 +#elif defined(XP_OS2) asm("int $3"); +#elif defined(ANDROID) + __android_log_assert(NULL, "PRLog", "Assertion failure: %s, at %s:%d\n", + s, file, ln); #endif abort(); } |