mirror of
https://github.com/pocoproject/poco.git
synced 2025-05-25 06:27:41 +02:00
trunk/branch integration: VxWorks & Wince
This commit is contained in:
parent
9b0ba3971f
commit
52e8c4f75b
@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Debugger.cpp
|
// Debugger.cpp
|
||||||
//
|
//
|
||||||
// $Id: //poco/svn/Foundation/src/Debugger.cpp#3 $
|
// $Id: //poco/1.4/Foundation/src/Debugger.cpp#3 $
|
||||||
//
|
//
|
||||||
// Library: Foundation
|
// Library: Foundation
|
||||||
// Package: Core
|
// Package: Core
|
||||||
@ -39,10 +39,10 @@
|
|||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#if defined(POCO_OS_FAMILY_WINDOWS)
|
#if defined(POCO_OS_FAMILY_WINDOWS)
|
||||||
#include "Poco/UnWindows.h"
|
#include "Poco/UnWindows.h"
|
||||||
#elif defined(POCO_OS_FAMILY_UNIX)
|
#elif defined(POCO_OS_FAMILY_UNIX) && !defined(POCO_VXWORKS)
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#elif defined(POCO_OS_FAMILY_VMS)
|
#elif defined(POCO_OS_FAMILY_VMS)
|
||||||
#include <lib$routines.h>
|
#include <lib$routines.h>
|
||||||
#include <ssdef.h>
|
#include <ssdef.h>
|
||||||
@ -63,11 +63,26 @@ namespace Poco {
|
|||||||
bool Debugger::isAvailable()
|
bool Debugger::isAvailable()
|
||||||
{
|
{
|
||||||
#if defined(_DEBUG)
|
#if defined(_DEBUG)
|
||||||
#if defined(POCO_OS_FAMILY_WINDOWS)
|
#if defined(POCO_OS_FAMILY_WINDOWS)
|
||||||
return IsDebuggerPresent() ? true : false;
|
#if defined(_WIN32_WCE)
|
||||||
#elif defined(POCO_OS_FAMILY_UNIX)
|
#if (_WIN32_WCE >= 0x600)
|
||||||
return std::getenv("POCO_ENABLE_DEBUGGER") ? true : false;
|
BOOL isDebuggerPresent;
|
||||||
#elif defined(POCO_OS_FAMILY_VMS)
|
if (CheckRemoteDebuggerPresent(GetCurrentProcess(), &isDebuggerPresent))
|
||||||
|
{
|
||||||
|
return isDebuggerPresent ? true : false;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
return IsDebuggerPresent() ? true : false;
|
||||||
|
#endif
|
||||||
|
#elif defined(POCO_VXWORKS)
|
||||||
|
return false;
|
||||||
|
#elif defined(POCO_OS_FAMILY_UNIX)
|
||||||
|
return std::getenv("POCO_ENABLE_DEBUGGER") ? true : false;
|
||||||
|
#elif defined(POCO_OS_FAMILY_VMS)
|
||||||
return true;
|
return true;
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
@ -80,13 +95,13 @@ void Debugger::message(const std::string& msg)
|
|||||||
{
|
{
|
||||||
#if defined(_DEBUG)
|
#if defined(_DEBUG)
|
||||||
std::fputs("\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n", stderr);
|
std::fputs("\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n", stderr);
|
||||||
std::fputs(msg.c_str(), stderr);
|
std::fputs(msg.c_str(), stderr);
|
||||||
std::fputs("\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n", stderr);
|
std::fputs("\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n", stderr);
|
||||||
#if defined(POCO_OS_FAMILY_WINDOWS)
|
#if defined(POCO_OS_FAMILY_WINDOWS)
|
||||||
if (IsDebuggerPresent())
|
if (isAvailable())
|
||||||
{
|
{
|
||||||
#if defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING)
|
#if defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING)
|
||||||
std::wstring umsg;
|
std::wstring umsg;
|
||||||
UnicodeConverter::toUTF16(msg, umsg);
|
UnicodeConverter::toUTF16(msg, umsg);
|
||||||
umsg += '\n';
|
umsg += '\n';
|
||||||
OutputDebugStringW(umsg.c_str());
|
OutputDebugStringW(umsg.c_str());
|
||||||
@ -115,14 +130,18 @@ void Debugger::message(const std::string& msg, const char* file, int line)
|
|||||||
void Debugger::enter()
|
void Debugger::enter()
|
||||||
{
|
{
|
||||||
#if defined(_DEBUG)
|
#if defined(_DEBUG)
|
||||||
#if defined(POCO_OS_FAMILY_WINDOWS)
|
#if defined(POCO_OS_FAMILY_WINDOWS)
|
||||||
if (IsDebuggerPresent())
|
if (isAvailable())
|
||||||
{
|
{
|
||||||
DebugBreak();
|
DebugBreak();
|
||||||
}
|
}
|
||||||
#elif defined(POCO_OS_FAMILY_UNIX)
|
#elif defined(POCO_VXWORKS)
|
||||||
if (isAvailable())
|
{
|
||||||
{
|
// not supported
|
||||||
|
}
|
||||||
|
#elif defined(POCO_OS_FAMILY_UNIX)
|
||||||
|
if (isAvailable())
|
||||||
|
{
|
||||||
kill(getpid(), SIGINT);
|
kill(getpid(), SIGINT);
|
||||||
}
|
}
|
||||||
#elif defined(POCO_OS_FAMILY_VMS)
|
#elif defined(POCO_OS_FAMILY_VMS)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user