| 308 | } |
| 309 | |
| 310 | u32 DisassemblyManager::getNthNextAddress(u32 address, int n) |
| 311 | { |
| 312 | if (!cpu->isAlive()) |
| 313 | return address + n * 4; |
| 314 | |
| 315 | while (cpu->isValidAddress(address)) |
| 316 | { |
| 317 | auto it = findDisassemblyEntry(entries,address,false); |
| 318 | |
| 319 | while (it != entries.end()) |
| 320 | { |
| 321 | DisassemblyEntry* entry = it->second; |
| 322 | int oldLineNum = entry->getLineNum(address,true); |
| 323 | int oldNumLines = entry->getNumLines(); |
| 324 | if (oldLineNum+n < oldNumLines) |
| 325 | { |
| 326 | return entry->getLineAddress(oldLineNum+n); |
| 327 | } |
| 328 | |
| 329 | address = entry->getLineAddress(0)+entry->getTotalSize(); |
| 330 | n -= (oldNumLines-oldLineNum); |
| 331 | it = findDisassemblyEntry(entries,address,false); |
| 332 | } |
| 333 | |
| 334 | if ((address + 0x400) < address) // Check for unsigned overflow, we are analysing too high! |
| 335 | break; |
| 336 | |
| 337 | analyze(address); |
| 338 | } |
| 339 | |
| 340 | return address+n*4; |
| 341 | } |
| 342 | |
| 343 | void DisassemblyManager::clear() |
| 344 | { |
no test coverage detected