================ rvDebuggerServer::CheckBreakpoints Check to see if any breakpoints have been hit. This includes "break next", "step into", and "step over" break points ================ */
| 530 | ================ |
| 531 | */ |
| 532 | void 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; |
no test coverage detected