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

Method HandleAddBreakpoint

neo/tools/debugger/DebuggerServer.cpp:306–339  ·  view source on GitHub ↗

================ rvDebuggerServer::HandleAddBreakpoint Handle the DBMSG_ADDBREAKPOINT message being sent by the debugger client. This message is handled by first checking if it is valid and is added as a new breakpoint to the breakpoint list with the data supplied in the message. ================ */

Source from the content-addressed store, hash-verified

304================
305*/
306void rvDebuggerServer::HandleAddBreakpoint ( idBitMsg* msg )
307{
308 bool onceOnly = false;
309 long lineNumber;
310 long id;
311 char filename[2048]; // DG: randomly chose this size
312
313 // Read the breakpoint info
314 onceOnly = msg->ReadBits( 1 ) ? true : false;
315 lineNumber = msg->ReadInt ( );
316 id = msg->ReadInt ( );
317
318 msg->ReadString ( filename, sizeof(filename) );
319
320 //check for statement on requested breakpoint location
321 if (!((idGameEditExt*) gameEdit)->IsLineCode(filename, lineNumber))
322 {
323 idBitMsg msgOut;
324 byte buffer[MAX_MSGLEN];
325
326 msgOut.Init(buffer, sizeof(buffer));
327 msgOut.BeginWriting();
328 msgOut.WriteShort((short)DBMSG_REMOVEBREAKPOINT);
329 msgOut.WriteInt(lineNumber);
330 msgOut.WriteString(filename);
331 SendPacket(msgOut.GetData(), msgOut.GetSize());
332 return;
333 }
334
335
336 SDL_LockMutex( mCriticalSection );
337 mBreakpoints.Append ( new rvDebuggerBreakpoint ( filename, lineNumber, id, onceOnly ) );
338 SDL_UnlockMutex( mCriticalSection );
339}
340
341/*
342================

Callers

nothing calls this directly

Calls 12

BeginWritingMethod · 0.80
ReadBitsMethod · 0.45
ReadIntMethod · 0.45
ReadStringMethod · 0.45
IsLineCodeMethod · 0.45
InitMethod · 0.45
WriteShortMethod · 0.45
WriteIntMethod · 0.45
WriteStringMethod · 0.45
GetDataMethod · 0.45
GetSizeMethod · 0.45
AppendMethod · 0.45

Tested by

no test coverage detected