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.
This commit is contained in:
wtc%netscape.com 2000-04-28 00:01:57 +00:00
Родитель 018282fcd5
Коммит 3326b39cd9
1 изменённых файлов: 30 добавлений и 1 удалений

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

@ -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