ppsspp/Windows/Debugger/DebuggerShared.cpp
Henrik Rydgård ff8148dd92 Move native/util, native/data and native/i18 to Common/Data.
Also move colorutil.cpp/h

linking build fix experiment

Delete a bunch of unused CMakeLists.txt files

CMakeLists.txt linking fix

Don't include NativeApp.h from any headers.

Android.mk buildfix

Half of the UWP fix

Buildfix

Minor project file cleanup

Buildfixes

Guess what? More buildfixes!
2020-10-04 07:28:29 +02:00

33 lines
792 B
C++

#include "Common/Data/Encoding/Utf8.h"
#include "DebuggerShared.h"
#include "../InputBox.h"
bool parseExpression(const char* exp, DebugInterface* cpu, u32& dest)
{
PostfixExpression postfix;
if (cpu->initExpression(exp,postfix) == false) return false;
return cpu->parseExpression(postfix,dest);
}
void displayExpressionError(HWND hwnd)
{
MessageBox(hwnd,ConvertUTF8ToWString(getExpressionError()).c_str(),L"Invalid expression",MB_OK);
}
bool executeExpressionWindow(HWND hwnd, DebugInterface* cpu, u32& dest)
{
std::string expression;
if (InputBox_GetString(GetModuleHandle(NULL), hwnd, L"Expression", "",expression) == false)
{
return false;
}
if (parseExpression(expression.c_str(), cpu, dest) == false)
{
displayExpressionError(hwnd);
return false;
}
return true;
}