================ 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. ================ */
| 304 | ================ |
| 305 | */ |
| 306 | void 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 | ================ |
nothing calls this directly
no test coverage detected