MCPcopy Create free account
hub / github.com/carbonengine/trinity / PyBreakInDebugger

Function PyBreakInDebugger

trinity/trinity.cpp:340–366  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

338#endif
339
340static PyObject* PyBreakInDebugger( PyObject* module, PyObject* args )
341{
342#ifdef _WIN32
343
344 if( PyTuple_GET_SIZE( args ) == 1 )
345 {
346 PyObject* o = PyTuple_GetItem( args, 0 );
347 if( PyVerCompat::IsPyString( o ) )
348 {
349 auto context = FromPython<std::string>( o );
350 OutputDebugString( "Python Triggered Breakpoint: " );
351 OutputDebugString( context.c_str() );
352 OutputDebugString( "\n" );
353 }
354 }
355 DoDebugBreak();
356#else
357 struct sigaction action, oldAction;
358 memset( &action, 0, sizeof( action ) );
359 action.sa_handler = &emptySignalHandler;
360 sigaction( SIGTRAP, &action, &oldAction );
361 raise( SIGTRAP );
362 sigaction( SIGTRAP, &oldAction, &action );
363#endif
364
365 Py_RETURN_NONE;
366}
367MAP_FUNCTION(
368 "BreakInDebugger",
369 PyBreakInDebugger,

Callers

nothing calls this directly

Calls 3

IsPyStringFunction · 0.85
DoDebugBreakFunction · 0.85
sigactionClass · 0.70

Tested by

no test coverage detected