summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwtc%netscape.com <devnull@localhost>2000-04-28 00:06:16 +0000
committerwtc%netscape.com <devnull@localhost>2000-04-28 00:06:16 +0000
commitc9735a9ad8eba9802b16a74a26e1b9e2c47c49f9 (patch)
treeaf443ddd1876570aec5e0e06e40e61f44c829600
parent8d4c634f9ef97af3f0e00fc874d428dd76078688 (diff)
downloadnspr-hg-c9735a9ad8eba9802b16a74a26e1b9e2c47c49f9.tar.gz
Bugzilla bug #37240: define DebugBreak() for OS/2 for use by PR_Assert().
Thanks to snizinsk@us.ibm.com of IBM Corporation for contributing the patch. (NSPRPUB_RELEASE_4_0_BRANCH)
-rw-r--r--pr/src/io/prlog.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/pr/src/io/prlog.c b/pr/src/io/prlog.c
index 6c2b9072..5c5a896e 100644
--- a/pr/src/io/prlog.c
+++ b/pr/src/io/prlog.c
@@ -14,6 +14,17 @@
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
+ *
+ * Contributors:
+ *
+ * This Original Code has been modified by IBM Corporation.
+ * Modifications made by IBM described herein are
+ * Copyright (c) International Business Machines Corporation, 2000.
+ * Modifications to Mozilla code or documentation identified per
+ * MPL Section 3.3
+ *
+ * Date Modified by Description of modification
+ * 04/10/2000 IBM Corp. Added DebugBreak() definitions for OS/2
*/
#include "primpl.h"
@@ -432,6 +443,24 @@ PR_IMPLEMENT(void) PR_Abort(void)
}
#ifdef DEBUG
+#if defined(XP_OS2)
+/*
+ * Added definitions for DebugBreak() for 2 different OS/2 compilers.
+ * Doing the int3 on purpose for Visual Age so that a developer can
+ * step over the instruction if so desired. Not always possible if
+ * trapping due to exception handling IBM-AKR
+ */
+#if defined(XP_OS2_VACPP)
+#include <builtin.h>
+static void DebugBreak(void) { _interrupt(3); }
+#elif defined(XP_OS2_EMX)
+/* Force a trap */
+static void DebugBreak(void) { int *pTrap=NULL; *pTrap = 1; }
+#else
+static void DebugBreak(void) { }
+#endif
+#endif /* XP_OS2 */
+
PR_IMPLEMENT(void) PR_Assert(const char *s, const char *file, PRIntn ln)
{
PR_LogPrint("Assertion failure: %s, at %s:%d\n", s, file, ln);
@@ -441,7 +470,7 @@ PR_IMPLEMENT(void) PR_Assert(const char *s, const char *file, PRIntn ln)
#ifdef XP_MAC
dprintf("Assertion failure: %s, at %s:%d\n", s, file, ln);
#endif
-#ifdef WIN32
+#if defined(WIN32) || defined(XP_OS2)
DebugBreak();
#endif
#ifndef XP_MAC