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

Function startWorker

pcsx2-qt/Debugger/Memory/MemorySearchView.cpp:391–425  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

389}
390
391std::vector<SearchResult> startWorker(DebugInterface* cpu, const SearchType type, const SearchComparison comparison, std::vector<SearchResult> searchResults, u32 start, u32 end, QString value, int base)
392{
393 const bool isSigned = value.startsWith("-");
394 switch (type)
395 {
396 case SearchType::ByteType:
397 isSigned ? searchWorker<s8>(cpu, searchResults, type, comparison, start, end, value.toShort(nullptr, base)) : searchWorker<u8>(cpu, searchResults, type, comparison, start, end, value.toUShort(nullptr, base));
398 break;
399 case SearchType::Int16Type:
400 isSigned ? searchWorker<s16>(cpu, searchResults, type, comparison, start, end, value.toShort(nullptr, base)) : searchWorker<u16>(cpu, searchResults, type, comparison, start, end, value.toUShort(nullptr, base));
401 break;
402 case SearchType::Int32Type:
403 isSigned ? searchWorker<s32>(cpu, searchResults, type, comparison, start, end, value.toInt(nullptr, base)) : searchWorker<u32>(cpu, searchResults, type, comparison, start, end, value.toUInt(nullptr, base));
404 break;
405 case SearchType::Int64Type:
406 isSigned ? searchWorker<s64>(cpu, searchResults, type, comparison, start, end, value.toLongLong(nullptr, base)) : searchWorker<u64>(cpu, searchResults, type, comparison, start, end, value.toULongLong(nullptr, base));
407 break;
408 case SearchType::FloatType:
409 searchWorker<float>(cpu, searchResults, type, comparison, start, end, value.toFloat());
410 break;
411 case SearchType::DoubleType:
412 searchWorker<double>(cpu, searchResults, type, comparison, start, end, value.toDouble());
413 break;
414 case SearchType::StringType:
415 searchWorkerByteArray(cpu, type, comparison, searchResults, start, end, value.toUtf8());
416 break;
417 case SearchType::ArrayType:
418 searchWorkerByteArray(cpu, type, comparison, searchResults, start, end, QByteArray::fromHex(value.toUtf8()));
419 break;
420 default:
421 Console.Error("Debugger: Unknown type when doing memory search!");
422 return {};
423 };
424 return searchResults;
425}
426
427void MemorySearchView::onSearchButtonClicked()
428{

Callers

nothing calls this directly

Calls 2

searchWorkerByteArrayFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected