r=valeski, a=brendan
OS/2 bring up - Change DebugBreak code for OS/2 to make it a little easier
This commit is contained in:
mkaply%us.ibm.com 2000-06-20 13:59:17 +00:00
Родитель 51496f5882
Коммит aec080d457
2 изменённых файлов: 24 добавлений и 14 удалений

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

@ -25,6 +25,8 @@
* *
* Date Modified by Description of modification * Date Modified by Description of modification
* 04/10/2000 IBM Corp. Added DebugBreak() definitions for OS/2 * 04/10/2000 IBM Corp. Added DebugBreak() definitions for OS/2
* 06/19/2000 IBM Corp. Fix DebugBreak() messagebox defaults for OS/2
* 06/19/2000 Henry Sobotka Fix DebugBreak() for OS/2 on retail build.
*/ */
#include "nsDebug.h" #include "nsDebug.h"
@ -48,7 +50,7 @@
#include <stdlib.h> #include <stdlib.h>
#endif #endif
#if defined(XP_OS2) && defined(DEBUG) #if defined(XP_OS2)
/* Added definitions for DebugBreak() for 2 different OS/2 compilers. Doing /* 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 * 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 * instruction if so desired. Not always possible if trapping due to exception
@ -57,6 +59,7 @@
#define INCL_WINDIALOGS // need for WinMessageBox #define INCL_WINDIALOGS // need for WinMessageBox
#include <os2.h> #include <os2.h>
#if defined(DEBUG)
#if defined(XP_OS2_VACPP) #if defined(XP_OS2_VACPP)
#include <builtin.h> #include <builtin.h>
#define DebugBreak() { _interrupt(3); } #define DebugBreak() { _interrupt(3); }
@ -67,9 +70,10 @@
#define DebugBreak() #define DebugBreak()
#endif #endif
#elif defined(XP_OS2) #else
#define DebugBreak() #define DebugBreak()
#endif /* XP_OS2 && DEBUG */ #endif /* DEBUG */
#endif /* XP_OS2 */
#if defined(_WIN32) #if defined(_WIN32)
#include <windows.h> #include <windows.h>
@ -221,18 +225,18 @@ NS_COM void nsDebug::Assertion(const char* aStr, const char* aExpr,
#if defined(XP_OS2) #if defined(XP_OS2)
char msg[1200]; char msg[1200];
PR_snprintf(msg, sizeof(msg), PR_snprintf(msg, sizeof(msg),
"%s\n\nClick Retry to Debug Application.\n" "%s\n\nClick Cancel to Debug Application.\n"
"Click Cancel to continue running the Application.", buf); "Click Enter to continue running the Application.", buf);
ULONG code = WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, msg, ULONG code = WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, msg,
"nsDebug::Assertion", 0, "nsDebug::Assertion", 0,
MB_ERROR | MB_RETRYCANCEL); MB_ERROR | MB_ENTERCANCEL);
/* It is possible that we are executing on a thread that doesn't have a /* It is possible that we are executing on a thread that doesn't have a
* message queue. In that case, the message won't appear, and code will * message queue. In that case, the message won't appear, and code will
* be 0xFFFF. We'll give the user a chance to debug it by calling * be 0xFFFF. We'll give the user a chance to debug it by calling
* Break() * Break()
*/ */
if( code == MBID_CANCEL ) if( code == MBID_ENTER )
{ {
return; return;
// If Retry, Fall Through // If Retry, Fall Through
@ -319,6 +323,7 @@ NS_COM void nsDebug::Abort(const char* aFile, PRIntn aLine)
PR_Abort(); PR_Abort();
#elif defined(XP_OS2) #elif defined(XP_OS2)
DebugBreak(); DebugBreak();
return;
#elif defined(XP_BEOS) #elif defined(XP_BEOS)
{ {
#ifndef DEBUG_cls #ifndef DEBUG_cls

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

@ -25,6 +25,8 @@
* *
* Date Modified by Description of modification * Date Modified by Description of modification
* 04/10/2000 IBM Corp. Added DebugBreak() definitions for OS/2 * 04/10/2000 IBM Corp. Added DebugBreak() definitions for OS/2
* 06/19/2000 IBM Corp. Fix DebugBreak() messagebox defaults for OS/2
* 06/19/2000 Henry Sobotka Fix DebugBreak() for OS/2 on retail build.
*/ */
#include "nsDebug.h" #include "nsDebug.h"
@ -48,7 +50,7 @@
#include <stdlib.h> #include <stdlib.h>
#endif #endif
#if defined(XP_OS2) && defined(DEBUG) #if defined(XP_OS2)
/* Added definitions for DebugBreak() for 2 different OS/2 compilers. Doing /* 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 * 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 * instruction if so desired. Not always possible if trapping due to exception
@ -57,6 +59,7 @@
#define INCL_WINDIALOGS // need for WinMessageBox #define INCL_WINDIALOGS // need for WinMessageBox
#include <os2.h> #include <os2.h>
#if defined(DEBUG)
#if defined(XP_OS2_VACPP) #if defined(XP_OS2_VACPP)
#include <builtin.h> #include <builtin.h>
#define DebugBreak() { _interrupt(3); } #define DebugBreak() { _interrupt(3); }
@ -67,9 +70,10 @@
#define DebugBreak() #define DebugBreak()
#endif #endif
#elif defined(XP_OS2) #else
#define DebugBreak() #define DebugBreak()
#endif /* XP_OS2 && DEBUG */ #endif /* DEBUG */
#endif /* XP_OS2 */
#if defined(_WIN32) #if defined(_WIN32)
#include <windows.h> #include <windows.h>
@ -221,18 +225,18 @@ NS_COM void nsDebug::Assertion(const char* aStr, const char* aExpr,
#if defined(XP_OS2) #if defined(XP_OS2)
char msg[1200]; char msg[1200];
PR_snprintf(msg, sizeof(msg), PR_snprintf(msg, sizeof(msg),
"%s\n\nClick Retry to Debug Application.\n" "%s\n\nClick Cancel to Debug Application.\n"
"Click Cancel to continue running the Application.", buf); "Click Enter to continue running the Application.", buf);
ULONG code = WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, msg, ULONG code = WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, msg,
"nsDebug::Assertion", 0, "nsDebug::Assertion", 0,
MB_ERROR | MB_RETRYCANCEL); MB_ERROR | MB_ENTERCANCEL);
/* It is possible that we are executing on a thread that doesn't have a /* It is possible that we are executing on a thread that doesn't have a
* message queue. In that case, the message won't appear, and code will * message queue. In that case, the message won't appear, and code will
* be 0xFFFF. We'll give the user a chance to debug it by calling * be 0xFFFF. We'll give the user a chance to debug it by calling
* Break() * Break()
*/ */
if( code == MBID_CANCEL ) if( code == MBID_ENTER )
{ {
return; return;
// If Retry, Fall Through // If Retry, Fall Through
@ -319,6 +323,7 @@ NS_COM void nsDebug::Abort(const char* aFile, PRIntn aLine)
PR_Abort(); PR_Abort();
#elif defined(XP_OS2) #elif defined(XP_OS2)
DebugBreak(); DebugBreak();
return;
#elif defined(XP_BEOS) #elif defined(XP_BEOS)
{ {
#ifndef DEBUG_cls #ifndef DEBUG_cls