BOOLEAN NTAPI KeDisconnectInterrupt(IN PKINTERRUPT Interrupt) { UNIMPLEMENTED; __debugbreak(); return FALSE; }
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(); }
void Sys_Breakpoint (void) { #if defined(_MSC_VER) __debugbreak(); #elif (defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))) __asm__ __volatile__ ( "int $3\n\t" ); #endif }
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(); }
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)); }
sGlobalEnvironment::~sGlobalEnvironment( ) { if( !m_pNetManager->IsEmpty( ) ) { OutputDebugString( L"[WSocket] you need to shutdown all networks before closing!" ); __debugbreak( ); } }
T VerifyNot(T actual, U error) { if (actual != error) return actual; volatile ULONG err = ::GetLastError(); __debugbreak(); __assume(0); }
void debugBreak() { #ifdef _WIN32 __debugbreak(); #else __builtin_trap(); #endif }
//---------------------------------------------------------------------------------------------- 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; }
void abort_handler(int sig) { gpr_log(GPR_DEBUG, "Abort handler called."); if (IsDebuggerPresent()) { __debugbreak(); } else { _exit(1); } }
static void abort_handler(int sig) { fprintf(stderr, "Abort handler called.\n"); print_current_stack(NULL); if (IsDebuggerPresent()) { __debugbreak(); } else { _exit(1); } }
//----------------------------------------------------------------------------------------------- __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 ); }
/* 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 }
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; }
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(); }
// 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; }
u8 MbcRomOnly::LoadRam(u16 addr) { if (_rom.HasRam) { __debugbreak(); return 0; } return 0; }
void ce_die(char* reason) { if (reason) log("C.E. pass : die [%s]\n",reason); else log("C.E. pass : die\n"); __debugbreak(); }
void cleanup_proc() { augs::window::disable_cursor_clipping(); global_log::save_complete_log("logs/ensure_failed_debug_log.txt"); #ifdef PLATFORM_WINDOWS __debugbreak(); #endif }
void DebugUtil::BreakDebugger() { if(suppress_dialogs_) { _exit(1); } __debugbreak(); }
void CheckGLError() { GLenum error = glGetError(); if (error != 0) { SDL_Log("GL Error: %d %s", error, glewGetErrorString(error)); __debugbreak(); } }
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); }
int main() { myExample<myImpl> test; test.myMethod(); test.myFriendMethod(); __debugbreak(); return 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); }
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; }
void triggerBreakpoint() { #ifdef _MSC_VER __debugbreak(); #elif defined(__GNUC__) && ((__i386__) || (__x86_64__)) __asm__ __volatile__ ( "int $3\n\t" ); #else raise(SIGTRAP); #endif }
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 }
// 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; }
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(); }