Some changes to the debugger, added a DSP HLE debugging window. I moved the initialization of DLLdebugger from Core.cpp to the debugging window. (I hope this doesn't break the LLE debugger in any way, or does it have to be started right after LoadPlugin?). Also added a ShowOnStart saved setting to the debugger. And a MainWindow saved setting that set the position and size of the main window when it's started. I may have broken things in the debugger by allowing disabling of for example the Jit window. Please accept my apologies if that is the case.

There's an annoying problem with the DSP HLE wx window that blocks some input and places it in a queue. For example if you have loaded the window and press X on the main window, that action is blocked an placed in some kind of queue and not executed until you have closed the debugging window. This is also why the main Dolphin-Debugger window does not show up until you close the sound window. If someone find a fix to this I guess it could be convenient. There is another way to show the window, m_frame->Show() that is normally supposed to remove this kind of on-focus lock, but in a dll it seemingly breaks because it makes Dllmain call DLL_PROCESS_DETACH immediately after DLL_PROCESS_ATTACH so the window has to be killed or we crash.

Also, otherwise unnecessarily I had to disable the new DSP HLE debug window in Release mode because I could not access the SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin.c_str() string that I need to start it (if I tried it crashed). Very annoying and strange. I could not access m_strDSPPlugin or m_strVideoPlugin either, but all other values in m_LocalCoreStartupParameter seemed to work fine. I'll have to leave it to someone else to figure out why.

TODO: Later I'll add function to the debugging buttons, currently only update have a function. I'll add some option to show a custom console window (that actually worked better that the wx window to show the current parameters status, it had less flicker on frequent updates). I'll also add some custom log file saving option.

Also, the reason I placed Logging.cpp in its own dir is because I plan to add more files to it. There were problems with some build modes, win32 with debugging crashed on booting a game, I don't know if it's my fault. And I could not build Debug win64 because of some wx linking problem.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@722 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
John Peterson
2008-09-29 03:19:23 +00:00
parent 6a54676914
commit f2a5fd1973
21 changed files with 1325 additions and 186 deletions

View File

@ -24,6 +24,8 @@ DynamicLibrary CPlugin::m_hInstLib;
void(__cdecl * CPlugin::m_GetDllInfo) (PLUGIN_INFO * _PluginInfo) = 0;
void(__cdecl * CPlugin::m_DllAbout) (HWND _hParent) = 0;
void(__cdecl * CPlugin::m_DllConfig) (HWND _hParent) = 0;
void(__cdecl * CPlugin::m_DllDebugger) (HWND _hParent) = 0; // phew, is this the last one? how many
// of these can you have?
void
CPlugin::Release(void)
@ -31,6 +33,7 @@ CPlugin::Release(void)
m_GetDllInfo = 0;
m_DllAbout = 0;
m_DllConfig = 0;
m_DllDebugger = 0;
m_hInstLib.Unload();
}
@ -43,6 +46,7 @@ CPlugin::Load(const char* _szName)
m_GetDllInfo = (void (__cdecl*)(PLUGIN_INFO*))m_hInstLib.Get("GetDllInfo");
m_DllAbout = (void (__cdecl*)(HWND))m_hInstLib.Get("DllAbout");
m_DllConfig = (void (__cdecl*)(HWND))m_hInstLib.Get("DllConfig");
m_DllDebugger = (void (__cdecl*)(HWND))m_hInstLib.Get("DllDebugger");
return(true);
}
@ -77,4 +81,12 @@ void CPlugin::About(HWND _hwnd)
m_DllAbout(_hwnd);
}
}
void CPlugin::Debug(HWND _hwnd)
{
if (m_DllDebugger != 0)
{
m_DllDebugger(_hwnd);
}
}
} // end of namespace Common

View File

@ -35,6 +35,7 @@ class CPlugin
static void Config(HWND _hwnd);
static void About(HWND _hwnd);
static void Debug(HWND _hwnd);
private:
@ -44,6 +45,7 @@ class CPlugin
static void (__cdecl * m_GetDllInfo)(PLUGIN_INFO* _PluginInfo);
static void (__cdecl * m_DllAbout)(HWND _hParent);
static void (__cdecl * m_DllConfig)(HWND _hParent);
static void (__cdecl * m_DllDebugger)(HWND _hParent);
};
} // end of namespace Common

View File

@ -139,11 +139,6 @@ bool Init(const SCoreStartupParameter _CoreParameter)
return false;
}
#ifdef _WIN32
if (PluginDSP::DllDebugger)
PluginDSP::DllDebugger((HWND)_CoreParameter.hMainWindow);
#endif
emuThreadGoing.Init();
g_pThread = new Common::Thread(EmuThread, (void*)&g_CoreStartupParameter);

View File

@ -85,139 +85,6 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="2"
WholeProgramOptimization="0"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
WholeProgramOptimization="false"
AdditionalIncludeDirectories="..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\Core\Src;;..\Common\Src;..\..\..\Externals\Bochs_disasm"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;__WXMSW__"
RuntimeLibrary="0"
BufferSecurityCheck="false"
EnableEnhancedInstructionSet="2"
UsePrecompiledHeader="0"
WarningLevel="3"
WarnAsError="false"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
AdditionalDependencies="comctl32.lib rpcrt4.lib"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="DebugFast|Win32"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="2"
WholeProgramOptimization="0"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
WholeProgramOptimization="false"
AdditionalIncludeDirectories="..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\Core\Src;;..\Common\Src;..\..\..\Externals\Bochs_disasm"
PreprocessorDefinitions="WIN32;__WXMSW__;_WINDOWS;NOPCH;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS"
MinimalRebuild="true"
BasicRuntimeChecks="0"
RuntimeLibrary="0"
BufferSecurityCheck="false"
EnableEnhancedInstructionSet="2"
UsePrecompiledHeader="0"
WarningLevel="3"
WarnAsError="false"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
AdditionalDependencies="comctl32.lib rpcrt4.lib"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|x64"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
@ -246,7 +113,7 @@
Name="VCCLCompilerTool"
Optimization="0"
WholeProgramOptimization="false"
AdditionalIncludeDirectories="..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\Core\Src;;..\Common\Src;..\..\..\Externals\Bochs_disasm"
AdditionalIncludeDirectories="..\..\PluginSpecs;..\..\PluginSpecs;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\Core\Src;..\Common\Src;..\..\..\Externals\Bochs_disasm"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;__WXMSW__"
MinimalRebuild="true"
BasicRuntimeChecks="3"
@ -285,6 +152,71 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="2"
WholeProgramOptimization="0"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
WholeProgramOptimization="false"
AdditionalIncludeDirectories="..\..\PluginSpecs;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\Core\Src;;..\Common\Src;..\..\..\Externals\Bochs_disasm"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;__WXMSW__"
RuntimeLibrary="0"
BufferSecurityCheck="false"
EnableEnhancedInstructionSet="2"
UsePrecompiledHeader="0"
WarningLevel="3"
WarnAsError="false"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
AdditionalDependencies="comctl32.lib rpcrt4.lib"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|x64"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
@ -312,7 +244,7 @@
<Tool
Name="VCCLCompilerTool"
WholeProgramOptimization="false"
AdditionalIncludeDirectories="..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\Core\Src;;..\Common\Src;..\..\..\Externals\Bochs_disasm"
AdditionalIncludeDirectories="..\..\PluginSpecs;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\Core\Src;..\Common\Src;..\..\..\Externals\Bochs_disasm"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;__WXMSW__"
RuntimeLibrary="0"
BufferSecurityCheck="false"
@ -350,6 +282,74 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="DebugFast|Win32"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="2"
WholeProgramOptimization="0"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
WholeProgramOptimization="false"
AdditionalIncludeDirectories="..\..\PluginSpecs;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\Core\Src;;..\Common\Src;..\..\..\Externals\Bochs_disasm"
PreprocessorDefinitions="WIN32;__WXMSW__;_WINDOWS;NOPCH;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS"
MinimalRebuild="true"
BasicRuntimeChecks="0"
RuntimeLibrary="0"
BufferSecurityCheck="false"
EnableEnhancedInstructionSet="2"
UsePrecompiledHeader="0"
WarningLevel="3"
WarnAsError="false"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
AdditionalDependencies="comctl32.lib rpcrt4.lib"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="DebugFast|x64"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
@ -378,7 +378,7 @@
Name="VCCLCompilerTool"
Optimization="0"
WholeProgramOptimization="false"
AdditionalIncludeDirectories="..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\Core\Src;;..\Common\Src;..\..\..\Externals\Bochs_disasm"
AdditionalIncludeDirectories="..\..\PluginSpecs;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\Core\Src;..\Common\Src;..\..\..\Externals\Bochs_disasm"
PreprocessorDefinitions="WIN32;__WXMSW__;_WINDOWS;NOPCH;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
@ -508,14 +508,6 @@
Optimization="0"
/>
</FileConfiguration>
<FileConfiguration
Name="DebugFast|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
>
@ -532,6 +524,14 @@
Optimization="0"
/>
</FileConfiguration>
<FileConfiguration
Name="DebugFast|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
/>
</FileConfiguration>
<FileConfiguration
Name="DebugFast|x64"
>

View File

@ -55,6 +55,14 @@
#include "PowerPC/Jit64/Jit.h"
#include "PowerPC/Jit64/JitCache.h"
#include "Plugins/Plugin_DSP.h" // new stuff, to let us open the DLLDebugger
#include "../../DolphinWX/src/PluginManager.h"
#include "../../DolphinWX/src/Config.h"
// and here are the classes
class CPluginInfo;
class CPluginManager;
extern "C" {
#include "../resources/toolbar_play.c"
#include "../resources/toolbar_pause.c"
@ -75,6 +83,8 @@ BEGIN_EVENT_TABLE(CCodeWindow, wxFrame)
EVT_MENU(IDM_REGISTERWINDOW, CCodeWindow::OnToggleRegisterWindow)
EVT_MENU(IDM_BREAKPOINTWINDOW, CCodeWindow::OnToggleBreakPointWindow)
EVT_MENU(IDM_MEMORYWINDOW, CCodeWindow::OnToggleMemoryWindow)
EVT_MENU(IDM_JITWINDOW, CCodeWindow::OnToggleJitWindow)
EVT_MENU(IDM_SOUNDWINDOW, CCodeWindow::OnToggleSoundWindow)
EVT_MENU(IDM_INTERPRETER, CCodeWindow::OnInterpreter)
@ -110,11 +120,18 @@ inline wxBitmap _wxGetBitmapFromMemory(const unsigned char* data, int length)
return(wxBitmap(wxImage(is, wxBITMAP_TYPE_ANY, -1), -1));
}
// =======================================================================================
// WARNING: If you create a new dialog window you must add m_dialog(NULL) below otherwise
// m_dialog = true and things will crash.
// ----------------
CCodeWindow::CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter, wxWindow* parent, wxWindowID id,
const wxString& title, const wxPoint& pos, const wxSize& size, long style)
: wxFrame(parent, id, title, pos, size, style)
, m_LogWindow(NULL)
, m_RegisterWindow(NULL)
, m_BreakpointWindow(NULL)
, m_MemoryWindow(NULL)
, m_JitWindow(NULL)
{
InitBitmaps();
@ -138,7 +155,9 @@ CCodeWindow::CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter
if (m_LogWindow) m_LogWindow->Load(file);
if (m_RegisterWindow) m_RegisterWindow->Load(file);
if (m_MemoryWindow) m_MemoryWindow->Load(file);
if (m_JitWindow) m_JitWindow->Load(file);
}
// ===============
CCodeWindow::~CCodeWindow()
@ -151,6 +170,7 @@ CCodeWindow::~CCodeWindow()
if (m_LogWindow) m_LogWindow->Save(file);
if (m_RegisterWindow) m_RegisterWindow->Save(file);
if (m_MemoryWindow) m_MemoryWindow->Save(file);
if (m_JitWindow) m_JitWindow->Save(file);
file.Save("Debugger.ini");
}
@ -175,11 +195,36 @@ void CCodeWindow::Save(IniFile &file) const
file.Set("Code", "h", GetSize().GetHeight());
}
// =======================================================================================
// I don't know when you're supposed to be able to use pRegister->Check(true) so I had
// to set these here. It kept crashing if I placed it after m_LogWindow->Show() below.
bool bLogWindow = true;
bool bRegisterWindow = true;
bool bBreakpointWindow = true;
bool bMemoryWindow = true;
bool bJitWindow = true;
bool bSoundWindow = false;
// -------------------
void CCodeWindow::CreateGUIControls(const SCoreStartupParameter& _LocalCoreStartupParameter)
{
// =======================================================================================
// Decide what windows to use
// --------------
IniFile ini;
ini.Load("Debugger.ini");
ini.Get("ShowOnStart", "LogWindow", &bLogWindow, true);
ini.Get("ShowOnStart", "RegisterWindow", &bRegisterWindow, true);
ini.Get("ShowOnStart", "BreakpointWindow", &bBreakpointWindow, true);
ini.Get("ShowOnStart", "MemoryWindow", &bMemoryWindow, true);
ini.Get("ShowOnStart", "JitWindow", &bJitWindow, true);
ini.Get("ShowOnStart", "SoundWindow", &bSoundWindow, false);
// ===============
CreateMenu(_LocalCoreStartupParameter);
// =======================================================================================
// Configure the code window
wxBoxSizer* sizerBig = new wxBoxSizer(wxHORIZONTAL);
wxBoxSizer* sizerLeft = new wxBoxSizer(wxVERTICAL);
@ -202,30 +247,59 @@ void CCodeWindow::CreateGUIControls(const SCoreStartupParameter& _LocalCoreStart
sizerBig->Fit(this);
sync_event.Init();
// =================
// additional dialogs
if (IsLoggingActivated())
if (IsLoggingActivated() && bLogWindow)
{
m_LogWindow = new CLogWindow(this);
m_LogWindow->Show(true);
}
m_RegisterWindow = new CRegisterWindow(this);
m_RegisterWindow->Show(true);
if (bRegisterWindow)
{
m_RegisterWindow = new CRegisterWindow(this);
m_RegisterWindow->Show(true);
}
m_BreakpointWindow = new CBreakPointWindow(this, this);
m_BreakpointWindow->Show(true);
if(bBreakpointWindow)
{
m_BreakpointWindow = new CBreakPointWindow(this, this);
m_BreakpointWindow->Show(true);
}
m_MemoryWindow = new CMemoryWindow(this);
m_MemoryWindow->Show(true);
if(bMemoryWindow)
{
m_MemoryWindow = new CMemoryWindow(this);
m_MemoryWindow->Show(true);
}
m_JitWindow = new CJitWindow(this);
m_JitWindow->Show(true);
if(bJitWindow)
{
m_JitWindow = new CJitWindow(this);
m_JitWindow->Show(true);
}
if(IsLoggingActivated() && bSoundWindow)
{
// no if() check here?
CPluginManager::GetInstance().OpenDebug(
GetHandle(),
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin.c_str()
);
}
}
void CCodeWindow::CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParameter)
{
// =======================================================================================
// Windowses
// ---------------
wxMenuBar* pMenuBar = new wxMenuBar(wxMB_DOCKABLE);
{
@ -245,19 +319,29 @@ void CCodeWindow::CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParam
if (IsLoggingActivated())
{
wxMenuItem* pLogWindow = pDebugDialogs->Append(IDM_LOGWINDOW, _T("&LogManager"), wxEmptyString, wxITEM_CHECK);
pLogWindow->Check(true);
pLogWindow->Check(bLogWindow);
}
wxMenuItem* pRegister = pDebugDialogs->Append(IDM_REGISTERWINDOW, _T("&Registers"), wxEmptyString, wxITEM_CHECK);
pRegister->Check(true);
pRegister->Check(bRegisterWindow);
wxMenuItem* pBreakPoints = pDebugDialogs->Append(IDM_BREAKPOINTWINDOW, _T("&BreakPoints"), wxEmptyString, wxITEM_CHECK);
pBreakPoints->Check(true);
pBreakPoints->Check(bBreakpointWindow);
wxMenuItem* pMemory = pDebugDialogs->Append(IDM_MEMORYWINDOW, _T("&Memory"), wxEmptyString, wxITEM_CHECK);
pMemory->Check(true);
pMemory->Check(bMemoryWindow);
wxMenuItem* pJit = pDebugDialogs->Append(IDM_JITWINDOW, _T("&Jit"), wxEmptyString, wxITEM_CHECK);
pJit->Check(bJitWindow);
if (IsLoggingActivated()) {
wxMenuItem* pSound = pDebugDialogs->Append(IDM_SOUNDWINDOW, _T("&Sound"), wxEmptyString, wxITEM_CHECK);
pSound->Check(bSoundWindow);}
pMenuBar->Append(pDebugDialogs, _T("&Views"));
}
// ===============
{
wxMenu *pSymbolsMenu = new wxMenu;
@ -665,10 +749,18 @@ void CCodeWindow::OnSymbolListContextMenu(wxContextMenuEvent& event)
void CCodeWindow::OnToggleLogWindow(wxCommandEvent& event)
{
if (IsLoggingActivated())
{
bool show = GetMenuBar()->IsChecked(event.GetId());
// this may be a little ugly to have these here - you're more than welcome to
// turn this into the same fancy class stuff like the load windows positions
IniFile ini;
ini.Load("Debugger.ini");
ini.Set("ShowOnStart", "LogWindow", show);
ini.Save("Debugger.ini");
if (show)
{
if (!m_LogWindow)
@ -699,6 +791,11 @@ void CCodeWindow::OnToggleRegisterWindow(wxCommandEvent& event)
{
bool show = GetMenuBar()->IsChecked(event.GetId());
IniFile ini;
ini.Load("Debugger.ini");
ini.Set("ShowOnStart", "RegisterWindow", show);
ini.Save("Debugger.ini");
if (show)
{
if (!m_RegisterWindow)
@ -723,10 +820,79 @@ void CCodeWindow::OnToggleRegisterWindow(wxCommandEvent& event)
}
}
// =======================================================================================
// Toggle Sound Debugging Window
// ------------
void CCodeWindow::OnToggleSoundWindow(wxCommandEvent& event)
{
bool show = GetMenuBar()->IsChecked(event.GetId());
IniFile ini;
ini.Load("Debugger.ini");
ini.Set("ShowOnStart", "SoundWindow", show);
ini.Save("Debugger.ini");
if (IsLoggingActivated() && show)
{
// TODO: add some kind of if?
CPluginManager::GetInstance().OpenDebug(
GetHandle(),
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin.c_str()
);
}
else // hide
{
// can we close the dll window from here?
}
}
// ===========
void CCodeWindow::OnToggleJitWindow(wxCommandEvent& event)
{
bool show = GetMenuBar()->IsChecked(event.GetId());
IniFile ini;
ini.Load("Debugger.ini");
ini.Set("ShowOnStart", "JitWindow", show);
ini.Save("Debugger.ini");
if (show)
{
if (!m_JitWindow)
{
m_JitWindow = new CJitWindow(this);
}
m_JitWindow->Show(true);
}
else // hide
{
// If m_dialog is NULL, then possibly the system
// didn't report the checked menu item status correctly.
// It should be true just after the menu item was selected,
// if there was no modeless dialog yet.
wxASSERT(m_JitWindow != NULL);
if (m_JitWindow)
{
m_JitWindow->Hide();
}
}
}
void CCodeWindow::OnToggleBreakPointWindow(wxCommandEvent& event)
{
bool show = GetMenuBar()->IsChecked(event.GetId());
IniFile ini;
ini.Load("Debugger.ini");
ini.Set("ShowOnStart", "BreakpointWindow", show);
ini.Save("Debugger.ini");
if (show)
{
if (!m_BreakpointWindow)
@ -754,6 +920,11 @@ void CCodeWindow::OnToggleBreakPointWindow(wxCommandEvent& event)
void CCodeWindow::OnToggleMemoryWindow(wxCommandEvent& event)
{
bool show = GetMenuBar()->IsChecked(event.GetId());
IniFile ini;
ini.Load("Debugger.ini");
ini.Set("ShowOnStart", "MemoryWindow", show);
ini.Save("Debugger.ini");
if (show)
{
@ -803,7 +974,6 @@ void CCodeWindow::OnHostMessage(wxCommandEvent& event)
{
m_RegisterWindow->NotifyUpdate();
}
break;
case IDM_UPDATEBREAKPOINTS:

View File

@ -15,6 +15,7 @@
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef CODEWINDOW_H_
#define CODEWINDOW_H_
@ -83,6 +84,8 @@ class CCodeWindow
IDM_REGISTERWINDOW,
IDM_BREAKPOINTWINDOW,
IDM_MEMORYWINDOW,
IDM_SOUNDWINDOW, // sound
IDM_JITWINDOW, // jit
IDM_SCANFUNCTIONS,
IDM_LOGINSTRUCTIONS,
IDM_LOADMAPFILE,
@ -143,6 +146,9 @@ class CCodeWindow
void OnToggleBreakPointWindow(wxCommandEvent& event);
void OnToggleLogWindow(wxCommandEvent& event);
void OnToggleMemoryWindow(wxCommandEvent& event);
void OnToggleJitWindow(wxCommandEvent& event);
void OnToggleSoundWindow(wxCommandEvent& event);
void OnHostMessage(wxCommandEvent& event);
void OnSymbolsMenu(wxCommandEvent& event);
void OnJitMenu(wxCommandEvent& event);

View File

@ -103,12 +103,15 @@ bool DolphinApp::OnInit()
}
#endif
// ============
// Check for debugger
bool UseDebugger = false;
#if wxUSE_CMDLINE_PARSER
wxCmdLineEntryDesc cmdLineDesc[] =
{
{wxCMD_LINE_SWITCH, _T("h"), _T("help"), _T("Show this help message"), wxCMD_LINE_VAL_NONE, wxCMD_LINE_OPTION_HELP},
{wxCMD_LINE_SWITCH, _T("h"), _T("help"), _T("Show this help message"), wxCMD_LINE_VAL_NONE,
wxCMD_LINE_OPTION_HELP},
{wxCMD_LINE_SWITCH, _T("d"), _T("debugger"), _T("Opens the debugger")},
{wxCMD_LINE_NONE}
};
@ -123,6 +126,7 @@ bool DolphinApp::OnInit()
}
UseDebugger = parser.Found(_T("debugger"));
// ============
#endif
SConfig::GetInstance().LoadSettings();
@ -141,8 +145,32 @@ bool DolphinApp::OnInit()
const char *title = "Dolphin SVN Linux";
#endif
#endif
main_frame = new CFrame((wxFrame*) NULL, wxID_ANY, wxString::FromAscii(title),
wxPoint(100, 100), wxSize(800, 600));
// ---------------------------------------------------------------------------------------
// If we are debugging let use save the main window position and size
// TODO: Save position and size on exit
// ---------
IniFile ini;
ini.Load("Debugger.ini");
int x, y, w, h;
ini.Get("MainWindow", "x", &x, 100);
ini.Get("MainWindow", "y", &y, 100);
ini.Get("MainWindow", "w", &w, 600);
ini.Get("MainWindow", "h", &h, 800);
// ---------
if(UseDebugger)
{
main_frame = new CFrame((wxFrame*) NULL, wxID_ANY, wxString::FromAscii(title),
wxPoint(x, y), wxSize(h, w));
}
else
{
main_frame = new CFrame((wxFrame*) NULL, wxID_ANY, wxString::FromAscii(title),
wxPoint(100, 100), wxSize(800, 600));
}
// ---------
// create debugger
if (UseDebugger)

View File

@ -118,6 +118,15 @@ void CPluginManager::OpenConfig(void* _Parent, const char *_rFilename)
}
}
void CPluginManager::OpenDebug(void* _Parent, const char *_rFilename)
{
if (Common::CPlugin::Load(_rFilename))
{
Common::CPlugin::Debug((HWND)_Parent);
Common::CPlugin::Release();
}
}
CPluginInfo::CPluginInfo(const char *_rFileName)
: m_FileName(_rFileName)
, m_Valid(false)

View File

@ -43,6 +43,7 @@ public:
void ScanForPlugins(wxWindow* _wxWindow);
void OpenAbout(void* _Parent, const char *_rFilename);
void OpenConfig(void* _Parent, const char *_rFilename);
void OpenDebug(void* _Parent, const char *_rFilename);
const CPluginInfos& GetPluginInfos() {return(m_PluginInfos);}
private: