| 326 | } |
| 327 | |
| 328 | void DisassemblyView::contextStubFunction() |
| 329 | { |
| 330 | FunctionInfo function = cpu().GetSymbolGuardian().FunctionOverlappingAddress(m_selectedAddressStart); |
| 331 | u32 address = function.address.valid() ? function.address.value : m_selectedAddressStart; |
| 332 | |
| 333 | const QPointer<DisassemblyView> view(this); |
| 334 | Host::RunOnCPUThread([view, address, cpu = &cpu()] { |
| 335 | const u32 first_instruction = cpu->Read32(address); |
| 336 | const u32 second_instruction = cpu->Read32(address + 4); |
| 337 | |
| 338 | cpu->Write32(address, 0x03E00008); // jr ra |
| 339 | cpu->Write32(address + 4, 0x00000000); // nop |
| 340 | |
| 341 | QtHost::RunOnUIThread([view, address, first_instruction, second_instruction]() { |
| 342 | if (!view) |
| 343 | return; |
| 344 | |
| 345 | view->m_stubbedFunctions.emplace(address, std::make_tuple(first_instruction, second_instruction)); |
| 346 | DebuggerView::broadcastEvent(DebuggerEvents::VMUpdate()); |
| 347 | }); |
| 348 | }); |
| 349 | } |
| 350 | |
| 351 | void DisassemblyView::contextRestoreFunction() |
| 352 | { |
nothing calls this directly
no test coverage detected