Add some reporting in filesystem related code.

This commit is contained in:
Unknown W. Brackets 2013-05-26 20:23:09 -07:00
parent f397f83b4f
commit ee414830f6
2 changed files with 12 additions and 10 deletions

View File

@ -16,8 +16,9 @@
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#include "Globals.h"
#include "Common.h"
#include "ISOFileSystem.h"
#include "Common/Common.h"
#include "Core/FileSystems/ISOFileSystem.h"
#include "Core/Reporting.h"
#include <cstring>
#include <cstdio>
#include <ctype.h>
@ -36,20 +37,20 @@ static bool parseLBN(std::string filename, u32 *sectorStart, u32 *readSize)
int offset = 0;
if (sscanf(filename_c + pos, "%x%n", sectorStart, &offset) != 1)
WARN_LOG(FILESYS, "Invalid LBN reference: %s", filename_c);
WARN_LOG_REPORT(FILESYS, "Invalid LBN reference: %s", filename_c);
pos += offset;
if (filename.compare(pos, sizeof("_size") - 1, "_size") != 0)
WARN_LOG(FILESYS, "Invalid LBN reference: %s", filename_c);
WARN_LOG_REPORT(FILESYS, "Invalid LBN reference: %s", filename_c);
pos += sizeof("_size") - 1;
offset = 0;
if (sscanf(filename_c + pos, "%x%n", readSize, &offset) != 1)
WARN_LOG(FILESYS, "Invalid LBN reference: %s", filename_c);
WARN_LOG_REPORT(FILESYS, "Invalid LBN reference: %s", filename_c);
pos += offset;
if (filename.size() > pos)
WARN_LOG(FILESYS, "Incomplete LBN reference: %s", filename_c);
WARN_LOG_REPORT(FILESYS, "Incomplete LBN reference: %s", filename_c);
return true;
}

View File

@ -17,8 +17,9 @@
#include <set>
#include "Common/StringUtils.h"
#include "../HLE/sceKernelThread.h"
#include "MetaFileSystem.h"
#include "Core/FileSystems/MetaFileSystem.h"
#include "Core/HLE/sceKernelThread.h"
#include "Core/Reporting.h"
static bool ApplyPathStringToComponentsVector(std::vector<std::string> &vector, const std::string &pathString)
{
@ -190,7 +191,7 @@ bool MetaFileSystem::MapFilePath(const std::string &_inpath, std::string &outpat
{
//TODO: emulate PSP's error 8002032C: "no current working directory" if relative... may break things requiring fixes elsewhere
if (inpath.find(':') == std::string::npos /* means path is relative */)
WARN_LOG(HLE, "Path is relative, but current directory not set for thread %i. Should give error, instead falling back to %s", currentThread, startingDirectory.c_str());
WARN_LOG_REPORT(HLE, "Path is relative, but current directory not set for thread %i. Should give error, instead falling back to %s", currentThread, startingDirectory.c_str());
}
else
{
@ -336,7 +337,7 @@ int MetaFileSystem::ChDir(const std::string &dir)
}
}
WARN_LOG(HLE, "ChDir failed to map device for \"%s\", failing", dir.c_str());
WARN_LOG_REPORT(HLE, "ChDir failed to map device for \"%s\", failing", dir.c_str());
return SCE_KERNEL_ERROR_NODEV;
}
}