| 471 | |
| 472 | |
| 473 | DebugStopReason DebuggerController::StepOverIL(BNFunctionGraphType il) |
| 474 | { |
| 475 | switch (il) |
| 476 | { |
| 477 | case NormalFunctionGraph: |
| 478 | { |
| 479 | return StepOverAndWaitInternal(); |
| 480 | } |
| 481 | case LowLevelILFunctionGraph: |
| 482 | { |
| 483 | // TODO: This might cause infinite loop |
| 484 | while (true) |
| 485 | { |
| 486 | DebugStopReason reason = StepOverAndWaitInternal(); |
| 487 | if (!ExpectSingleStep(reason)) |
| 488 | return reason; |
| 489 | |
| 490 | uint64_t newRemoteRip = m_state->IP(); |
| 491 | std::vector<FunctionRef> functions = m_liveView->GetAnalysisFunctionsContainingAddress(newRemoteRip); |
| 492 | if (functions.empty()) |
| 493 | return SingleStep; |
| 494 | |
| 495 | for (FunctionRef& func : functions) |
| 496 | { |
| 497 | LowLevelILFunctionRef llil = func->GetLowLevelIL(); |
| 498 | size_t start = llil->GetInstructionStart(m_liveView->GetDefaultArchitecture(), newRemoteRip); |
| 499 | if (start < llil->GetInstructionCount()) |
| 500 | { |
| 501 | if (llil->GetInstruction(start).address == newRemoteRip) |
| 502 | return SingleStep; |
| 503 | } |
| 504 | } |
| 505 | } |
| 506 | break; |
| 507 | } |
| 508 | case MediumLevelILFunctionGraph: |
| 509 | { |
| 510 | // TODO: This might cause infinite loop |
| 511 | while (true) |
| 512 | { |
| 513 | DebugStopReason reason = StepOverAndWaitInternal(); |
| 514 | if (!ExpectSingleStep(reason)) |
| 515 | return reason; |
| 516 | uint64_t newRemoteRip = m_state->IP(); |
| 517 | std::vector<FunctionRef> functions = m_liveView->GetAnalysisFunctionsContainingAddress(newRemoteRip); |
| 518 | if (functions.empty()) |
| 519 | return SingleStep; |
| 520 | |
| 521 | for (FunctionRef& func : functions) |
| 522 | { |
| 523 | MediumLevelILFunctionRef mlil = func->GetMediumLevelIL(); |
| 524 | size_t start = mlil->GetInstructionStart(m_liveView->GetDefaultArchitecture(), newRemoteRip); |
| 525 | if (start < mlil->GetInstructionCount()) |
| 526 | { |
| 527 | if (mlil->GetInstruction(start).address == newRemoteRip) |
| 528 | return SingleStep; |
| 529 | } |
| 530 | } |