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

Method CheckBreakpoints

neo/tools/debugger/DebuggerServer.cpp:532–648  ·  view source on GitHub ↗

================ rvDebuggerServer::CheckBreakpoints Check to see if any breakpoints have been hit. This includes "break next", "step into", and "step over" break points ================ */

Source from the content-addressed store, hash-verified

530================
531*/
532void rvDebuggerServer::CheckBreakpoints ( idInterpreter* interpreter, idProgram* program, int instructionPointer )
533{
534 const char* filename;
535 int i;
536
537 if ( !mConnected ) {
538 return;
539 }
540
541
542 // Grab the current statement and the filename that it came from
543 filename = ((idGameEditExt*) gameEdit)->GetFilenameForStatement(program, instructionPointer);
544 int linenumber = ((idGameEditExt*) gameEdit)->GetLineNumberForStatement(program, instructionPointer);
545
546 // Operate on lines, not statements
547 if ( mLastStatementLine == linenumber && mLastStatementFile == filename)
548 {
549 return;
550 }
551
552 // Save the last visited line and file so we can prevent
553 // double breaks on lines with more than one statement
554 mLastStatementFile = idStr(filename);
555 mLastStatementLine = linenumber;
556
557 // Reset stepping when the last function on the callstack is returned from
558 if ( ((idGameEditExt*) gameEdit)->ReturnedFromFunction(program, interpreter,instructionPointer))
559 {
560 mBreakStepOver = false;
561 mBreakStepInto = false;
562 }
563
564 // See if we are supposed to break on the next script line
565 if ( mBreakNext )
566 {
567 HandleInspectScripts(NULL);
568 Break ( interpreter, program, instructionPointer );
569 return;
570 }
571
572 // Only break on the same callstack depth and thread as the break over
573 if ( mBreakStepOver )
574 {
575 //virtual bool CheckForBreakpointHit(interpreter,function1,function2,depth)
576 if (((idGameEditExt*) gameEdit)->CheckForBreakPointHit(interpreter, mBreakStepOverFunc1, mBreakStepOverFunc2, mBreakStepOverDepth))
577 {
578 Break ( interpreter, program, instructionPointer );
579 return;
580 }
581 }
582
583 // See if we are supposed to break on the next line
584 if ( mBreakStepInto )
585 {
586 HandleInspectScripts(NULL);
587 // Break
588 Break ( interpreter, program, instructionPointer );
589 return;

Callers 1

Calls 15

OSPathToRelativePathFunction · 0.85
GetLineNumberMethod · 0.80
GetOnceOnlyMethod · 0.80
BeginWritingMethod · 0.80
idStrClass · 0.50
ReturnedFromFunctionMethod · 0.45
CheckForBreakPointHitMethod · 0.45
NumMethod · 0.45
GetFilenameMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected