MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / contextStubFunction

Method contextStubFunction

pcsx2-qt/Debugger/DisassemblyView.cpp:328–349  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

326}
327
328void 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
351void DisassemblyView::contextRestoreFunction()
352{

Callers

nothing calls this directly

Calls 5

VMUpdateClass · 0.85
validMethod · 0.45
Read32Method · 0.45
Write32Method · 0.45

Tested by

no test coverage detected