MCPcopy Create free account
hub / github.com/dhewm/dhewm3 / HandleInspectThreads

Method HandleInspectThreads

neo/tools/debugger/DebuggerServer.cpp:419–442  ·  view source on GitHub ↗

================ rvDebuggerServer::HandleInspectThreads Send the list of the current threads in the interpreter back to the debugger client ================ */

Source from the content-addressed store, hash-verified

417================
418*/
419void rvDebuggerServer::HandleInspectThreads ( idBitMsg* msg )
420{
421 idBitMsg msgOut;
422 byte buffer[MAX_MSGLEN];
423 int i;
424
425 // Initialize the message
426 msgOut.Init( buffer, sizeof( buffer ) );
427 msgOut.SetAllowOverflow(true);
428 msgOut.BeginWriting();
429 msgOut.WriteShort ( (short)DBMSG_INSPECTTHREADS );
430
431 // Write the number of threads to the message
432 msgOut.WriteShort ((short)((idGameEditExt*) gameEdit)->GetTotalScriptThreads() );
433
434 // Loop through all of the threads and write their name and number to the message
435 for ( i = 0; i < ((idGameEditExt*) gameEdit)->GetTotalScriptThreads(); i ++ )
436 {
437 ((idGameEditExt*) gameEdit)->MSG_WriteThreadInfo(&msgOut,((idGameEditExt*) gameEdit)->GetThreadByIndex(i), mBreakInterpreter);
438 }
439
440 // Send off the inspect threads packet to the debugger client
441 SendPacket (msgOut.GetData(), msgOut.GetSize() );
442}
443
444/*
445================

Callers

nothing calls this directly

Calls 9

SetAllowOverflowMethod · 0.80
BeginWritingMethod · 0.80
InitMethod · 0.45
WriteShortMethod · 0.45
GetTotalScriptThreadsMethod · 0.45
MSG_WriteThreadInfoMethod · 0.45
GetThreadByIndexMethod · 0.45
GetDataMethod · 0.45
GetSizeMethod · 0.45

Tested by

no test coverage detected