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

Function findDisassemblyEntry

pcsx2/DebugTools/DisassemblyManager.cpp:93–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91}
92
93std::map<u32,DisassemblyEntry*>::iterator findDisassemblyEntry(std::map<u32,DisassemblyEntry*>& entries, u32 address, bool exact)
94{
95 if (exact)
96 return entries.find(address);
97
98 if (entries.empty())
99 return entries.end();
100
101 // find first elem that's >= address
102 auto it = entries.lower_bound(address);
103 if (it != entries.end())
104 {
105 // it may be an exact match
106 if (isInInterval(it->second->getLineAddress(0),it->second->getTotalSize(),address))
107 return it;
108
109 // otherwise it may point to the next
110 if (it != entries.begin())
111 {
112 it--;
113 if (isInInterval(it->second->getLineAddress(0),it->second->getTotalSize(),address))
114 return it;
115 }
116 }
117
118 // check last entry manually
119 auto rit = entries.rbegin();
120 if (isInInterval(rit->second->getLineAddress(0),rit->second->getTotalSize(),address))
121 {
122 return (++rit).base();
123 }
124
125 // no match otherwise
126 return entries.end();
127}
128
129void DisassemblyManager::analyze(u32 address, u32 size = 1024)
130{

Callers 7

analyzeMethod · 0.85
getBranchLinesMethod · 0.85
getLineMethod · 0.85
getStartAddressMethod · 0.85
getNthPreviousAddressMethod · 0.85
getNthNextAddressMethod · 0.85
disassembleMethod · 0.85

Calls 8

isInIntervalFunction · 0.85
findMethod · 0.45
emptyMethod · 0.45
endMethod · 0.45
getLineAddressMethod · 0.45
getTotalSizeMethod · 0.45
beginMethod · 0.45
rbeginMethod · 0.45

Tested by

no test coverage detected