Add option to dump the contents of RAM to a file

This commit is contained in:
Connor McLaughlin
2020-08-16 23:20:36 +10:00
parent 0aefdf4753
commit 4e62b32d60
8 changed files with 68 additions and 2 deletions

View File

@ -1026,6 +1026,24 @@ void QtHostInterface::stopDumpingAudio()
StopDumpingAudio();
}
void QtHostInterface::dumpRAM(const QString& filename)
{
if (!isOnWorkerThread())
{
QMetaObject::invokeMethod(this, "dumpRAM", Q_ARG(const QString&, filename));
return;
}
if (System::IsShutdown())
return;
const std::string filename_str = filename.toStdString();
if (System::DumpRAM(filename_str.c_str()))
ReportFormattedMessage("RAM dumped to '%s'", filename_str.c_str());
else
ReportFormattedMessage("Failed to dump RAM to '%s'", filename_str.c_str());
}
void QtHostInterface::saveScreenshot()
{
if (!isOnWorkerThread())