| 350 | |
| 351 | |
| 352 | DebugStopReason DebuggerController::StepIntoIL(BNFunctionGraphType il) |
| 353 | { |
| 354 | switch (il) |
| 355 | { |
| 356 | case NormalFunctionGraph: |
| 357 | { |
| 358 | return StepIntoAndWaitInternal(); |
| 359 | } |
| 360 | case LowLevelILFunctionGraph: |
| 361 | { |
| 362 | // TODO: This might cause infinite loop |
| 363 | while (true) |
| 364 | { |
| 365 | DebugStopReason reason = StepIntoAndWaitInternal(); |
| 366 | if (!ExpectSingleStep(reason)) |
| 367 | return reason; |
| 368 | |
| 369 | uint64_t newRemoteRip = m_state->IP(); |
| 370 | std::vector<FunctionRef> functions = m_liveView->GetAnalysisFunctionsContainingAddress(newRemoteRip); |
| 371 | if (functions.empty()) |
| 372 | return SingleStep; |
| 373 | |
| 374 | for (FunctionRef& func : functions) |
| 375 | { |
| 376 | LowLevelILFunctionRef llil = func->GetLowLevelIL(); |
| 377 | size_t start = llil->GetInstructionStart(m_liveView->GetDefaultArchitecture(), newRemoteRip); |
| 378 | if (start < llil->GetInstructionCount()) |
| 379 | { |
| 380 | if (llil->GetInstruction(start).address == newRemoteRip) |
| 381 | return SingleStep; |
| 382 | } |
| 383 | } |
| 384 | } |
| 385 | break; |
| 386 | } |
| 387 | case MediumLevelILFunctionGraph: |
| 388 | { |
| 389 | // TODO: This might cause infinite loop |
| 390 | while (true) |
| 391 | { |
| 392 | DebugStopReason reason = StepIntoAndWaitInternal(); |
| 393 | if (!ExpectSingleStep(reason)) |
| 394 | return reason; |
| 395 | |
| 396 | uint64_t newRemoteRip = m_state->IP(); |
| 397 | std::vector<FunctionRef> functions = m_liveView->GetAnalysisFunctionsContainingAddress(newRemoteRip); |
| 398 | if (functions.empty()) |
| 399 | return SingleStep; |
| 400 | |
| 401 | for (FunctionRef& func : functions) |
| 402 | { |
| 403 | MediumLevelILFunctionRef mlil = func->GetMediumLevelIL(); |
| 404 | size_t start = mlil->GetInstructionStart(m_liveView->GetDefaultArchitecture(), newRemoteRip); |
| 405 | if (start < mlil->GetInstructionCount()) |
| 406 | { |
| 407 | if (mlil->GetInstruction(start).address == newRemoteRip) |
| 408 | return SingleStep; |
| 409 | } |