Exemplo n.º 1
0
BOOLEAN
NTAPI
KeDisconnectInterrupt(IN PKINTERRUPT Interrupt)
{
    UNIMPLEMENTED;
    __debugbreak();
    return FALSE;
}
Exemplo n.º 2
0
static void FAIL( char const* funcname, int rc)
{
	fprintf( stderr, "%s() failed! (%d)\n", funcname, rc );
#ifdef _MSC_VER
    __debugbreak(); // give a chance to the debugger!
#endif // _MSC_VER
    abort();
}
Exemplo n.º 3
0
void Sys_Breakpoint (void)
{
#if defined(_MSC_VER)
	__debugbreak();
#elif (defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)))
	__asm__ __volatile__ ( "int $3\n\t" );
#endif
}
Exemplo n.º 4
0
void my_parameter_handler(const wchar_t * expression, const wchar_t * function,
                          const wchar_t * file, unsigned int line,
                          uintptr_t pReserved)
{
  DBUG_PRINT("my",("Expression: %s  function: %s  file: %s, line: %d",
		   expression, function, file, line));
  __debugbreak();
}
Exemplo n.º 5
0
void GameMain_PassClient(SOCKET s, TABULACRYPT2 *tbc2)
{
	clientGamemain_t *cgm = ClientMgr_AddToGameMain(s);
	if( cgm == 0 )
		__debugbreak(); //No more free slot

	memcpy((void*)&cgm->tbc2, (void*)tbc2, sizeof(TABULACRYPT2));
}
Exemplo n.º 6
0
sGlobalEnvironment::~sGlobalEnvironment( )
{
    if( !m_pNetManager->IsEmpty( ) )
    {
        OutputDebugString( L"[WSocket] you need to shutdown all networks before closing!" );
        __debugbreak( );
    }
}
Exemplo n.º 7
0
T VerifyNot(T actual, U error) {
  if (actual != error)
    return actual;

  volatile ULONG err = ::GetLastError();
  __debugbreak();
  __assume(0);
}
Exemplo n.º 8
0
void debugBreak()
{
#ifdef _WIN32
    __debugbreak();
#else
    __builtin_trap();
#endif
}
Exemplo n.º 9
0
//----------------------------------------------------------------------------------------------
extern "C" _CRTIMP void * __cdecl _expand(
    void * pUserData,
    size_t nNewSize
)
{
    __debugbreak(); // who is calling this? Implement when needed
    return NULL;
}
/**
 * RTMpPokeCpu worker that uses the Vista and earlier version of HalRequestIpip
 * to get the job done.
 *
 * @returns VINF_SUCCESS
 * @param   idCpu           The CPU identifier.
 */
int rtMpPokeCpuUsingHalReqestIpiPreW7(RTCPUID idCpu)
{
    __debugbreak(); /** @todo this code needs testing!!  */
    KAFFINITY Target = 1;
    Target <<= idCpu;
    g_pfnrtHalRequestIpiPreW7(Target);
    return VINF_SUCCESS;
}
Exemplo n.º 11
0
void abort_handler(int sig) {
  gpr_log(GPR_DEBUG, "Abort handler called.");
  if (IsDebuggerPresent()) {
    __debugbreak();
  } else {
    _exit(1);
  }
}
Exemplo n.º 12
0
static void abort_handler(int sig) {
  fprintf(stderr, "Abort handler called.\n");
  print_current_stack(NULL);
  if (IsDebuggerPresent()) {
    __debugbreak();
  } else {
    _exit(1);
  }
}
Exemplo n.º 13
0
//-----------------------------------------------------------------------------------------------
__declspec( noreturn ) void FatalError( const char* filePath, const char* functionName, int lineNum, const std::string& reasonForError, const char* conditionText )
{
	std::string errorMessage = reasonForError;
	if( reasonForError.empty() )
	{
		if( conditionText )
			errorMessage = Stringf( "ERROR: \"%s\" is false!", conditionText );
		else
			errorMessage = "Unspecified fatal error";
	}

	const char* fileName = FindStartOfFileNameWithinFilePath( filePath );
//	std::string appName = theApplication ? theApplication->GetApplicationName() : "Unnamed Application";
	std::string appName = "Unnamed Application";
	std::string fullMessageTitle = appName + " :: Error";
	std::string fullMessageText = errorMessage;
	fullMessageText += "\n\nThe application will now close.\n";
	bool isDebuggerPresent = (IsDebuggerPresent() == TRUE);
	if( isDebuggerPresent )
	{
		fullMessageText += "\nDEBUGGER DETECTED!\nWould you like to break and debug?\n  (Yes=debug, No=quit)\n";
	}

	fullMessageText += "\n---------- Debugging Details Follow ----------\n";
	if( conditionText )
	{
		fullMessageText += Stringf( "\nThis error was triggered by a run-time condition check:\n  %s\n  from %s(), line %i in %s\n",
			conditionText, functionName, lineNum, fileName );
	}
	else
	{
		fullMessageText += Stringf( "\nThis was an unconditional error triggered by reaching\n line %i of %s, in %s()\n",
			lineNum, fileName, functionName );
	}

	DebuggerPrintf( "\n==============================================================================\n" );
	DebuggerPrintf( "RUN-TIME FATAL ERROR on line %i of %s, in %s()\n", lineNum, fileName, functionName );
	DebuggerPrintf( "%s(%d): %s\n", filePath, lineNum, errorMessage.c_str() ); // Use this specific format so Visual Studio users can double-click to jump to file-and-line of error
	DebuggerPrintf( "==============================================================================\n\n" );

	if( isDebuggerPresent )
	{
		bool isAnswerYes = SystemDialogue_YesNo( fullMessageTitle, fullMessageText, SEVERITY_FATAL );
		ShowCursor( TRUE );
		if( isAnswerYes )
		{
			__debugbreak();
		}
	}
	else
	{
		SystemDialogue_Okay( fullMessageTitle, fullMessageText, SEVERITY_FATAL );
		ShowCursor( TRUE );
	}

	exit( 0 );
}
Exemplo n.º 14
0
/* Wrap memory allocation routines to make sure that they aren't being called from interrupt handler. */
static void breakOnHeapOpFromInterruptHandler(void)
{
    /* UNDONE: I don't enable the check for KL25Z since the USBDevice implementation currently makes allocations from
       its ISR to realize endpoint buffers. */
#if !defined(TARGET_KL25Z)
    if (__get_IPSR() != 0)
        __debugbreak();
#endif
}
Exemplo n.º 15
0
Arquivo: page.c Projeto: GYGit/reactos
BOOLEAN
NTAPI
MmIsDisabledPage(PEPROCESS Process, PVOID Address)
{
    MMPTE Pte;
    Pte.u.Long = MiGetPteValueForProcess(Process, Address);
    __debugbreak(); // FIXME
    return !Pte.u.Hard.Valid && !(Pte.u.Long & 0x800) && Pte.u.Hard.PageFrameNumber;
}
Exemplo n.º 16
0
void CALLBACK my_InternetStatusCallback(HINTERNET hRequest, DWORD_PTR dwContext, DWORD dwInternetStatus, LPVOID lpvStatusInformation, DWORD dwStatusInformationLength)
{
	LPINTERNET_ASYNC_RESULT	AsyncResult = (LPINTERNET_ASYNC_RESULT) lpvStatusInformation;
	INTERNET_STATUS_CALLBACK RealInetCallback;
	PHANDLE_CONTEXT Ctx;

	ENTER_HOOK();

	if (Ctx = FindHandle(hRequest))
	{
		switch (dwInternetStatus)
		{
		case INTERNET_STATUS_HANDLE_CLOSING:
			DelHandle(hRequest);
			break;
		case INTERNET_STATUS_REQUEST_COMPLETE:
			if (Ctx->Status == DOWNLOADING)
			{
				if (!AsyncResult->dwResult)
					Ctx->Status = ERROR_WHILE_LOADING;

				SetEvent(Ctx->AsyncEvent);

				ReleaseHandle(Ctx);
				LEAVE_HOOK();
				return;
			}	// if (Ctx->Status == DOWNLOADING)
			else
			{
				ULONG	HttpStatus, bSize = sizeof(ULONG);
				if (HttpQueryInfo(hRequest, HTTP_QUERY_STATUS_CODE, &HttpStatus, &bSize, &bSize))
				{
					if (HttpStatus == 1)
					{
						__debugbreak();
					}
					
				}
				else
					bSize = GetLastError();
			}
			break;
		default:
			break;
		}	// switch (dwInternetStatus)
		
		if (RealInetCallback = Ctx->Callback)
		{
			ASSERT((LONG_PTR)Ctx->Callback > 0);	// User-mode address
			(RealInetCallback) (hRequest, dwContext, dwInternetStatus, lpvStatusInformation, dwStatusInformationLength);
		}

		ReleaseHandle(Ctx);
	}	// if (Ctx = FindHandle(hInternet))

	LEAVE_HOOK();
}
Exemplo n.º 17
0
// all the 'aligned offset' variants, implement if someone actually uses them
//----------------------------------------------------------------------------------------------
extern "C" _CRTIMP void * __cdecl _aligned_offset_malloc(
    size_t size,
    size_t align,
    size_t offset
)
{
    __debugbreak(); // who is calling this? Implement when needed
    return NULL;
}
Exemplo n.º 18
0
u8 MbcRomOnly::LoadRam(u16 addr)
{
    if (_rom.HasRam)
    {
        __debugbreak();
        return 0;
    }
    return 0;
}
Exemplo n.º 19
0
void ce_die(char* reason)
{
	if (reason)
		log("C.E. pass : die [%s]\n",reason);
	else
		log("C.E. pass : die\n");

	__debugbreak();
}
Exemplo n.º 20
0
void cleanup_proc() {
	augs::window::disable_cursor_clipping();
	
	global_log::save_complete_log("logs/ensure_failed_debug_log.txt");

#ifdef PLATFORM_WINDOWS
  __debugbreak();
#endif
}
Exemplo n.º 21
0
    void DebugUtil::BreakDebugger()
    {
        if(suppress_dialogs_)
        {
            _exit(1);
        }

        __debugbreak();
    }
Exemplo n.º 22
0
void CheckGLError()
{
	GLenum error = glGetError();
	if (error != 0)
	{
		SDL_Log("GL Error: %d %s", error, glewGetErrorString(error));
		__debugbreak();
	}
}
Exemplo n.º 23
0
void _PezFatalError(const char* pStr, va_list a)
{
    char msg[1024] = {0};
    _vsnprintf_s(msg, _countof(msg), _TRUNCATE, pStr, a);
    OutputDebugStringA(msg);
    OutputDebugStringA("\n");
    __debugbreak();
    exit(1);
}
Exemplo n.º 24
0
int main() 
{
	myExample<myImpl> test;
	test.myMethod();
	test.myFriendMethod();

	__debugbreak();
	return 0;
}
Exemplo n.º 25
0
/* CRT initialization code called from Reset_Handler after it calls SystemInit() */
extern "C" __attribute__ ((section(".mbed_init"))) void __main(void)
{
    unsigned long*  pulDest;
    unsigned long*  pulSrc;
    int             ExitCode;

    /* Copy the data segment initializers from flash to SRAM in ROM mode if needed */
    if (&_sidata != &_sdata)	// only if needed
    {
        pulSrc = &_sidata;
        for(pulDest = &_sdata; pulDest < &_edata; ) 
        {
            *(pulDest++) = *(pulSrc++);
        }
    }

    /* Copy the .fastcode code from ROM to SRAM if needed */
    if (&_sifastcode != &_sfastcode) 
    {
        pulSrc = &_sifastcode;
        for(pulDest = &_sfastcode; pulDest < &_efastcode; ) 
        {
            *(pulDest++) = *(pulSrc++);
        }
    }

    /* Zero fill the bss segment. */
    for(pulDest = &_sbss; pulDest < &_ebss; )
    {
        *(pulDest++) = 0;
    }

    /* Initialize stdin/stdout/stderr file handles. */
    if (!MRI_SEMIHOST_STDIO && !GCC4MBED_DELAYED_STDIO_INIT)
    {
        __GCC4MBEDOpenStandardHandles();
    }
    
    if (MRI_ENABLE)
    {
        __mriInit(MRI_INIT_PARAMETERS);
        if (MRI_BREAK_ON_INIT)
        {
            __debugbreak();
        }
    }

    /* Initialize static constructors. */
     __libc_init_array();

    /* Call the application's entry point. */
    ExitCode = main();
    
    /* Call exit */
    exit(ExitCode);
}
Exemplo n.º 26
0
Image GA::cross(const Image& mother, const Image& father, std::vector<Triangle>& used)
{
    Image child(mother.surface->w, mother.surface->h);
    child.triangles.reserve(trianglesCount);

    // get random line trought the image
    Vector2 p1 = rnd.getRandomCoordinate(mother.surface->w, mother.surface->h);
    Vector2 p2 = rnd.getRandomCoordinate(mother.surface->w, mother.surface->h);

    p2 = p1 == p2 ? Vector2(p1.y, p1.x) : p2;

    int count = 0; // count of triangles added int child

    for (auto & tr : father.triangles)
    {
        if (count >= trianglesCount) break;
        if (isOnRightTriangle(tr, p1, p2))
        {
            child.triangles.push_back(tr);
            used.push_back(tr);
            count++;
        }
    }

    for (auto & tr : mother.triangles)
    {
        if (count >= trianglesCount) break;
        if (!isOnRightTriangle(tr, p1, p2))
        {
            child.triangles.push_back(tr);
            used.push_back(tr);
            count++;
        }
    }

    if (count < trianglesCount)
    {
        for (int c = 0; c < trianglesCount; ++c)
        {
            if (count < trianglesCount) {
                if (isNotUsed(used, father.triangles[c]))
                {
                    child.triangles.push_back(father.triangles[c]);
                    count++;
                }
            }
        }
    }

    if (child.triangles.size() != trianglesCount) __debugbreak();

    //draw image pixels
    child.generatePixels();

    return child;
}
Exemplo n.º 27
0
void triggerBreakpoint()
{
#ifdef _MSC_VER
	__debugbreak();
#elif defined(__GNUC__) && ((__i386__) || (__x86_64__))
	__asm__ __volatile__ ( "int $3\n\t" );
#else
	raise(SIGTRAP);
#endif
}
Exemplo n.º 28
0
Arquivo: Gwen.cpp Projeto: darkf/gwen
		void AssertCheck( bool b, const char* strMsg )
		{
			if ( b ) { return; }

			Msg( "Assert: %s\n", strMsg );
#ifdef _WIN32
			MessageBoxA( NULL, strMsg, "Assert", MB_ICONEXCLAMATION | MB_OK );
			__debugbreak();
#endif
		}
Exemplo n.º 29
0
// all the 'aligned recalloc' variants, weird that they exist since there is no '_aligned_calloc'
//----------------------------------------------------------------------------------------------
extern "C" _CRTIMP void * __cdecl _aligned_recalloc(
    void * memblock,
    size_t count,
    size_t size,
    size_t align
)
{
    __debugbreak(); // who is calling this? Implement when needed
    return NULL;
}
Exemplo n.º 30
0
list<potential_field>::iterator GetPotentialField(float t)
{
	for (auto &it = g_potential_fields.begin(); it != g_potential_fields.end(); ++it)
	{
		if (t < it->alive.t1)
			return it;
	}
	__debugbreak();
	return g_potential_fields.end();
}