From d5ac952adc2508c8569cea2f01f8ee7d8e5312e4 Mon Sep 17 00:00:00 2001 From: "akkana%netscape.com" Date: Fri, 7 May 1999 19:20:12 +0000 Subject: [PATCH] Make NS_ASSERTION and DebugBreak not crash on Unix git-svn-id: svn://10.0.0.236/trunk@30693 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpcom/base/nsDebug.cpp | 6 ++++++ mozilla/xpcom/glue/nsDebug.cpp | 6 ++++++ mozilla/xpcom/src/nsDebug.cpp | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/mozilla/xpcom/base/nsDebug.cpp b/mozilla/xpcom/base/nsDebug.cpp index e219e49f27e..bb170280bd1 100644 --- a/mozilla/xpcom/base/nsDebug.cpp +++ b/mozilla/xpcom/base/nsDebug.cpp @@ -104,6 +104,8 @@ NS_COM void nsDebug::Break(const char* aFile, PRIntn aLine) //XXX this works on win32 only for now. For all the other platforms call Abort #if defined(_WIN32) ::DebugBreak(); +#elif defined(XP_UNIX) + fprintf(stderr, "\07"); fflush(stderr); #else Abort(aFile, aLine); #endif @@ -137,6 +139,10 @@ NS_COM void nsDebug::Assertion(const char* aStr, const char* aExpr, PR_LOG(gDebugLog, PR_LOG_ERROR, ("Assertion: \"%s\" (%s) at file %s, line %d", aStr, aExpr, aFile, aLine)); +#if defined(XP_UNIX) + fprintf(stderr, "Assertion: \"%s\" (%s) at file %s, line %d\n", aStr, aExpr, + aFile, aLine); +#endif Break(aFile, aLine); } diff --git a/mozilla/xpcom/glue/nsDebug.cpp b/mozilla/xpcom/glue/nsDebug.cpp index e219e49f27e..bb170280bd1 100644 --- a/mozilla/xpcom/glue/nsDebug.cpp +++ b/mozilla/xpcom/glue/nsDebug.cpp @@ -104,6 +104,8 @@ NS_COM void nsDebug::Break(const char* aFile, PRIntn aLine) //XXX this works on win32 only for now. For all the other platforms call Abort #if defined(_WIN32) ::DebugBreak(); +#elif defined(XP_UNIX) + fprintf(stderr, "\07"); fflush(stderr); #else Abort(aFile, aLine); #endif @@ -137,6 +139,10 @@ NS_COM void nsDebug::Assertion(const char* aStr, const char* aExpr, PR_LOG(gDebugLog, PR_LOG_ERROR, ("Assertion: \"%s\" (%s) at file %s, line %d", aStr, aExpr, aFile, aLine)); +#if defined(XP_UNIX) + fprintf(stderr, "Assertion: \"%s\" (%s) at file %s, line %d\n", aStr, aExpr, + aFile, aLine); +#endif Break(aFile, aLine); } diff --git a/mozilla/xpcom/src/nsDebug.cpp b/mozilla/xpcom/src/nsDebug.cpp index e219e49f27e..bb170280bd1 100644 --- a/mozilla/xpcom/src/nsDebug.cpp +++ b/mozilla/xpcom/src/nsDebug.cpp @@ -104,6 +104,8 @@ NS_COM void nsDebug::Break(const char* aFile, PRIntn aLine) //XXX this works on win32 only for now. For all the other platforms call Abort #if defined(_WIN32) ::DebugBreak(); +#elif defined(XP_UNIX) + fprintf(stderr, "\07"); fflush(stderr); #else Abort(aFile, aLine); #endif @@ -137,6 +139,10 @@ NS_COM void nsDebug::Assertion(const char* aStr, const char* aExpr, PR_LOG(gDebugLog, PR_LOG_ERROR, ("Assertion: \"%s\" (%s) at file %s, line %d", aStr, aExpr, aFile, aLine)); +#if defined(XP_UNIX) + fprintf(stderr, "Assertion: \"%s\" (%s) at file %s, line %d\n", aStr, aExpr, + aFile, aLine); +#endif Break(aFile, aLine); }