diff options
author | wtc%netscape.com <devnull@localhost> | 2000-05-02 01:43:45 +0000 |
---|---|---|
committer | wtc%netscape.com <devnull@localhost> | 2000-05-02 01:43:45 +0000 |
commit | 5706b19cfb6844f0bd7e08fe971cc9aa2c24f844 (patch) | |
tree | e00ea147cff56fada8d8214bcbe2ba3d65305abf | |
parent | 8ad1d2bdcd25e06fdd872804597a051e07e2a3e2 (diff) | |
download | nspr-hg-5706b19cfb6844f0bd7e08fe971cc9aa2c24f844.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_CLIENT_BRANCH)
-rw-r--r-- | pr/src/io/prlog.c | 31 |
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 |