2008-07-12 17:40:22 +00:00
|
|
|
// Copyright (C) 2003-2008 Dolphin Project.
|
|
|
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, version 2.0.
|
|
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License 2.0 for more details.
|
|
|
|
|
|
|
|
// A copy of the GPL 2.0 should have been included with the program.
|
|
|
|
// If not, see http://www.gnu.org/licenses/
|
|
|
|
|
|
|
|
// Official SVN repository and contact information can be found at
|
|
|
|
// http://code.google.com/p/dolphin-emu/
|
|
|
|
|
2008-08-26 23:32:54 +00:00
|
|
|
#include <wx/button.h>
|
|
|
|
#include <wx/textctrl.h>
|
|
|
|
#include <wx/textdlg.h>
|
|
|
|
#include <wx/listctrl.h>
|
|
|
|
#include <wx/thread.h>
|
|
|
|
#include <wx/mstream.h>
|
2008-08-23 03:48:40 +00:00
|
|
|
|
|
|
|
// ugly that this lib included code from the main
|
2008-09-07 20:29:31 +00:00
|
|
|
#include "../../DolphinWX/Src/Globals.h"
|
2008-08-23 03:48:40 +00:00
|
|
|
|
2008-08-21 17:22:55 +00:00
|
|
|
#include "IniFile.h"
|
|
|
|
#include "Host.h"
|
|
|
|
|
2008-07-12 17:40:22 +00:00
|
|
|
#include "Debugger.h"
|
|
|
|
|
|
|
|
#include "RegisterWindow.h"
|
|
|
|
#include "LogWindow.h"
|
2008-07-17 20:08:01 +00:00
|
|
|
#include "BreakpointWindow.h"
|
2008-07-21 18:42:44 +00:00
|
|
|
#include "MemoryWindow.h"
|
2008-08-21 17:22:55 +00:00
|
|
|
#include "JitWindow.h"
|
2008-07-12 17:40:22 +00:00
|
|
|
|
|
|
|
#include "CodeWindow.h"
|
2008-07-21 18:42:44 +00:00
|
|
|
#include "CodeView.h"
|
2008-08-21 17:22:55 +00:00
|
|
|
|
2008-08-23 15:15:25 +00:00
|
|
|
#include "FileUtil.h"
|
2008-08-21 17:22:55 +00:00
|
|
|
#include "Core.h"
|
2008-10-27 21:27:23 +00:00
|
|
|
#include "HLE/HLE.h"
|
2008-08-23 15:15:25 +00:00
|
|
|
#include "Boot/Boot.h"
|
2008-08-21 17:22:55 +00:00
|
|
|
#include "LogManager.h"
|
2008-07-12 17:40:22 +00:00
|
|
|
#include "HW/CPU.h"
|
|
|
|
#include "PowerPC/PowerPC.h"
|
|
|
|
#include "Debugger/PPCDebugInterface.h"
|
|
|
|
#include "Debugger/Debugger_SymbolMap.h"
|
2008-08-09 16:56:24 +00:00
|
|
|
#include "PowerPC/PPCAnalyst.h"
|
2008-08-30 12:11:25 +00:00
|
|
|
#include "PowerPC/Profiler.h"
|
2008-08-24 18:50:51 +00:00
|
|
|
#include "PowerPC/SymbolDB.h"
|
2008-08-24 15:46:08 +00:00
|
|
|
#include "PowerPC/SignatureDB.h"
|
2008-08-23 09:20:36 +00:00
|
|
|
#include "PowerPC/PPCTables.h"
|
2008-08-13 20:48:27 +00:00
|
|
|
#include "PowerPC/Jit64/Jit.h"
|
2008-10-12 06:31:14 +00:00
|
|
|
#include "PowerPC/Jit64/JitCache.h" // for ClearCache()
|
2008-07-12 17:40:22 +00:00
|
|
|
|
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
2008-09-29 03:19:23 +00:00
|
|
|
#include "Plugins/Plugin_DSP.h" // new stuff, to let us open the DLLDebugger
|
2008-10-09 18:47:53 +00:00
|
|
|
#include "Plugins/Plugin_Video.h" // new stuff, to let us open the DLLDebugger
|
2008-09-29 07:30:51 +00:00
|
|
|
#include "../../DolphinWX/Src/PluginManager.h"
|
|
|
|
#include "../../DolphinWX/Src/Config.h"
|
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
2008-09-29 03:19:23 +00:00
|
|
|
|
|
|
|
// and here are the classes
|
|
|
|
class CPluginInfo;
|
|
|
|
class CPluginManager;
|
2008-11-16 20:09:13 +00:00
|
|
|
//extern DynamicLibrary Common::CPlugin;
|
|
|
|
//extern CPluginManager CPluginManager::m_Instance;
|
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
2008-09-29 03:19:23 +00:00
|
|
|
|
2008-07-24 09:39:56 +00:00
|
|
|
extern "C" {
|
2008-07-24 13:40:07 +00:00
|
|
|
#include "../resources/toolbar_play.c"
|
|
|
|
#include "../resources/toolbar_pause.c"
|
|
|
|
#include "../resources/toolbar_add_memorycheck.c"
|
|
|
|
#include "../resources/toolbar_delete.c"
|
|
|
|
#include "../resources/toolbar_add_breakpoint.c"
|
2008-07-24 09:39:56 +00:00
|
|
|
}
|
2008-07-12 17:40:22 +00:00
|
|
|
|
2008-07-24 09:39:56 +00:00
|
|
|
static const long TOOLBAR_STYLE = wxTB_FLAT | wxTB_DOCKABLE | wxTB_TEXT;
|
|
|
|
|
|
|
|
BEGIN_EVENT_TABLE(CCodeWindow, wxFrame)
|
2008-07-20 15:12:12 +00:00
|
|
|
EVT_LISTBOX(IDM_SYMBOLLIST, CCodeWindow::OnSymbolListChange)
|
2008-07-17 22:19:57 +00:00
|
|
|
EVT_LISTBOX(IDM_CALLSTACKLIST, CCodeWindow::OnCallstackListChange)
|
2008-08-24 20:25:36 +00:00
|
|
|
EVT_LISTBOX(IDM_CALLERSLIST, CCodeWindow::OnCallersListChange)
|
|
|
|
EVT_LISTBOX(IDM_CALLSLIST, CCodeWindow::OnCallsListChange)
|
2008-07-17 22:19:57 +00:00
|
|
|
EVT_HOST_COMMAND(wxID_ANY, CCodeWindow::OnHostMessage)
|
|
|
|
EVT_MENU(IDM_LOGWINDOW, CCodeWindow::OnToggleLogWindow)
|
|
|
|
EVT_MENU(IDM_REGISTERWINDOW, CCodeWindow::OnToggleRegisterWindow)
|
|
|
|
EVT_MENU(IDM_BREAKPOINTWINDOW, CCodeWindow::OnToggleBreakPointWindow)
|
2008-07-21 18:42:44 +00:00
|
|
|
EVT_MENU(IDM_MEMORYWINDOW, CCodeWindow::OnToggleMemoryWindow)
|
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
2008-09-29 03:19:23 +00:00
|
|
|
EVT_MENU(IDM_JITWINDOW, CCodeWindow::OnToggleJitWindow)
|
|
|
|
EVT_MENU(IDM_SOUNDWINDOW, CCodeWindow::OnToggleSoundWindow)
|
2008-10-09 18:47:53 +00:00
|
|
|
EVT_MENU(IDM_VIDEOWINDOW, CCodeWindow::OnToggleVideoWindow)
|
2008-08-09 16:56:24 +00:00
|
|
|
|
2008-10-12 06:31:14 +00:00
|
|
|
EVT_MENU(IDM_INTERPRETER, CCodeWindow::OnInterpreter) // CPU Mode
|
|
|
|
EVT_MENU(IDM_JITOFF, CCodeWindow::OnJITOff)
|
|
|
|
EVT_MENU(IDM_JITLSOFF, CCodeWindow::OnJITLSOff)
|
2008-10-28 22:38:53 +00:00
|
|
|
EVT_MENU(IDM_JITLSFOFF, CCodeWindow::OnJITLSFOff)
|
|
|
|
EVT_MENU(IDM_JITLSPOFF, CCodeWindow::OnJITLSPOff)
|
2008-10-12 06:31:14 +00:00
|
|
|
EVT_MENU(IDM_JITFPOFF, CCodeWindow::OnJITFPOff)
|
|
|
|
EVT_MENU(IDM_JITIOFF, CCodeWindow::OnJITIOff)
|
|
|
|
EVT_MENU(IDM_JITPOFF, CCodeWindow::OnJITPOff)
|
|
|
|
EVT_MENU(IDM_JITSROFF, CCodeWindow::OnJITSROff)
|
2008-08-25 20:34:11 +00:00
|
|
|
|
2008-08-24 18:50:51 +00:00
|
|
|
EVT_MENU(IDM_CLEARSYMBOLS, CCodeWindow::OnSymbolsMenu)
|
|
|
|
EVT_MENU(IDM_LOADMAPFILE, CCodeWindow::OnSymbolsMenu)
|
2008-08-09 16:56:24 +00:00
|
|
|
EVT_MENU(IDM_SCANFUNCTIONS, CCodeWindow::OnSymbolsMenu)
|
2008-08-10 18:21:16 +00:00
|
|
|
EVT_MENU(IDM_SAVEMAPFILE, CCodeWindow::OnSymbolsMenu)
|
2008-08-24 15:46:08 +00:00
|
|
|
EVT_MENU(IDM_CREATESIGNATUREFILE, CCodeWindow::OnSymbolsMenu)
|
|
|
|
EVT_MENU(IDM_USESIGNATUREFILE, CCodeWindow::OnSymbolsMenu)
|
2008-10-27 21:27:23 +00:00
|
|
|
EVT_MENU(IDM_PATCHHLEFUNCTIONS, CCodeWindow::OnSymbolsMenu)
|
2008-08-23 09:20:36 +00:00
|
|
|
|
|
|
|
EVT_MENU(IDM_CLEARCODECACHE, CCodeWindow::OnJitMenu)
|
|
|
|
EVT_MENU(IDM_LOGINSTRUCTIONS, CCodeWindow::OnJitMenu)
|
2008-08-30 12:11:25 +00:00
|
|
|
|
|
|
|
EVT_MENU(IDM_PROFILEBLOCKS, CCodeWindow::OnProfilerMenu)
|
|
|
|
EVT_MENU(IDM_WRITEPROFILE, CCodeWindow::OnProfilerMenu)
|
|
|
|
|
2008-07-24 09:39:56 +00:00
|
|
|
// toolbar
|
|
|
|
EVT_MENU(IDM_DEBUG_GO, CCodeWindow::OnCodeStep)
|
|
|
|
EVT_MENU(IDM_STEP, CCodeWindow::OnCodeStep)
|
|
|
|
EVT_MENU(IDM_STEPOVER, CCodeWindow::OnCodeStep)
|
|
|
|
EVT_MENU(IDM_SKIP, CCodeWindow::OnCodeStep)
|
|
|
|
EVT_MENU(IDM_SETPC, CCodeWindow::OnCodeStep)
|
|
|
|
EVT_MENU(IDM_GOTOPC, CCodeWindow::OnCodeStep)
|
|
|
|
EVT_TEXT(IDM_ADDRBOX, CCodeWindow::OnAddrBoxChange)
|
2008-08-24 20:25:36 +00:00
|
|
|
|
|
|
|
EVT_COMMAND(IDM_CODEVIEW, wxEVT_CODEVIEW_CHANGE, CCodeWindow::OnCodeViewChange)
|
2008-07-12 17:40:22 +00:00
|
|
|
END_EVENT_TABLE()
|
|
|
|
|
2008-07-24 09:39:56 +00:00
|
|
|
#define wxGetBitmapFromMemory(name) _wxGetBitmapFromMemory(name, sizeof(name))
|
|
|
|
inline wxBitmap _wxGetBitmapFromMemory(const unsigned char* data, int length)
|
|
|
|
{
|
|
|
|
wxMemoryInputStream is(data, length);
|
|
|
|
return(wxBitmap(wxImage(is, wxBITMAP_TYPE_ANY, -1), -1));
|
|
|
|
}
|
|
|
|
|
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
2008-09-29 03:19:23 +00:00
|
|
|
// =======================================================================================
|
|
|
|
// WARNING: If you create a new dialog window you must add m_dialog(NULL) below otherwise
|
|
|
|
// m_dialog = true and things will crash.
|
|
|
|
// ----------------
|
2008-07-12 17:40:22 +00:00
|
|
|
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)
|
2008-07-24 13:40:07 +00:00
|
|
|
, m_LogWindow(NULL)
|
2008-08-27 12:27:03 +00:00
|
|
|
, m_RegisterWindow(NULL)
|
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
2008-09-29 03:19:23 +00:00
|
|
|
, m_BreakpointWindow(NULL)
|
|
|
|
, m_MemoryWindow(NULL)
|
|
|
|
, m_JitWindow(NULL)
|
2008-08-27 12:27:03 +00:00
|
|
|
{
|
2008-07-24 09:39:56 +00:00
|
|
|
InitBitmaps();
|
2008-07-12 17:40:22 +00:00
|
|
|
|
2008-07-24 09:39:56 +00:00
|
|
|
CreateGUIControls(_LocalCoreStartupParameter);
|
2008-07-12 17:40:22 +00:00
|
|
|
|
2008-07-24 09:39:56 +00:00
|
|
|
// Create the toolbar
|
|
|
|
RecreateToolbar();
|
2008-07-12 17:40:22 +00:00
|
|
|
|
|
|
|
UpdateButtonStates();
|
2008-07-17 21:46:34 +00:00
|
|
|
|
2008-07-24 13:40:07 +00:00
|
|
|
wxTheApp->Connect(wxID_ANY, wxEVT_KEY_DOWN,
|
|
|
|
wxKeyEventHandler(CCodeWindow::OnKeyDown),
|
|
|
|
(wxObject*)0, this);
|
|
|
|
|
2008-07-24 09:39:56 +00:00
|
|
|
// load ini...
|
2008-07-24 13:40:07 +00:00
|
|
|
IniFile file;
|
2008-11-12 04:54:17 +00:00
|
|
|
file.Load(DEBUGGER_CONFIG_FILE);
|
2008-07-17 21:46:34 +00:00
|
|
|
|
2008-07-24 13:40:07 +00:00
|
|
|
this->Load(file);
|
2008-07-24 14:12:09 +00:00
|
|
|
if (m_BreakpointWindow) m_BreakpointWindow->Load(file);
|
|
|
|
if (m_LogWindow) m_LogWindow->Load(file);
|
|
|
|
if (m_RegisterWindow) m_RegisterWindow->Load(file);
|
|
|
|
if (m_MemoryWindow) m_MemoryWindow->Load(file);
|
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
2008-09-29 03:19:23 +00:00
|
|
|
if (m_JitWindow) m_JitWindow->Load(file);
|
2008-07-24 13:40:07 +00:00
|
|
|
}
|
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
2008-09-29 03:19:23 +00:00
|
|
|
// ===============
|
2008-07-24 13:40:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
CCodeWindow::~CCodeWindow()
|
|
|
|
{
|
2008-07-24 09:39:56 +00:00
|
|
|
IniFile file;
|
2008-11-12 04:54:17 +00:00
|
|
|
file.Load(DEBUGGER_CONFIG_FILE);
|
2008-07-17 21:46:34 +00:00
|
|
|
|
2008-07-24 13:40:07 +00:00
|
|
|
this->Save(file);
|
2008-07-24 14:12:09 +00:00
|
|
|
if (m_BreakpointWindow) m_BreakpointWindow->Save(file);
|
|
|
|
if (m_LogWindow) m_LogWindow->Save(file);
|
|
|
|
if (m_RegisterWindow) m_RegisterWindow->Save(file);
|
|
|
|
if (m_MemoryWindow) m_MemoryWindow->Save(file);
|
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
2008-09-29 03:19:23 +00:00
|
|
|
if (m_JitWindow) m_JitWindow->Save(file);
|
2008-07-24 13:40:07 +00:00
|
|
|
|
2008-11-12 04:54:17 +00:00
|
|
|
file.Save(DEBUGGER_CONFIG_FILE);
|
2008-07-24 13:40:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CCodeWindow::Load( IniFile &file )
|
|
|
|
{
|
|
|
|
int x,y,w,h;
|
2008-07-24 09:39:56 +00:00
|
|
|
file.Get("Code", "x", &x, GetPosition().x);
|
|
|
|
file.Get("Code", "y", &y, GetPosition().y);
|
|
|
|
file.Get("Code", "w", &w, GetSize().GetWidth());
|
|
|
|
file.Get("Code", "h", &h, GetSize().GetHeight());
|
|
|
|
this->SetSize(x, y, w, h);
|
2008-07-24 13:40:07 +00:00
|
|
|
}
|
2008-07-17 21:46:34 +00:00
|
|
|
|
2008-07-21 18:42:44 +00:00
|
|
|
|
2008-07-24 13:40:07 +00:00
|
|
|
void CCodeWindow::Save(IniFile &file) const
|
|
|
|
{
|
|
|
|
file.Set("Code", "x", GetPosition().x);
|
|
|
|
file.Set("Code", "y", GetPosition().y);
|
|
|
|
file.Set("Code", "w", GetSize().GetWidth());
|
|
|
|
file.Set("Code", "h", GetSize().GetHeight());
|
2008-07-17 21:46:34 +00:00
|
|
|
}
|
|
|
|
|
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
2008-09-29 03:19:23 +00:00
|
|
|
// =======================================================================================
|
|
|
|
// 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;
|
2008-10-09 18:47:53 +00:00
|
|
|
bool bVideoWindow = false;
|
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
2008-09-29 03:19:23 +00:00
|
|
|
// -------------------
|
2008-07-24 09:39:56 +00:00
|
|
|
void CCodeWindow::CreateGUIControls(const SCoreStartupParameter& _LocalCoreStartupParameter)
|
|
|
|
{
|
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
2008-09-29 03:19:23 +00:00
|
|
|
// =======================================================================================
|
|
|
|
// Decide what windows to use
|
|
|
|
// --------------
|
|
|
|
IniFile ini;
|
2008-11-12 04:54:17 +00:00
|
|
|
ini.Load(DEBUGGER_CONFIG_FILE);
|
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
2008-09-29 03:19:23 +00:00
|
|
|
|
|
|
|
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);
|
2008-10-09 18:47:53 +00:00
|
|
|
ini.Get("ShowOnStart", "VideoWindow", &bVideoWindow, false);
|
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
2008-09-29 03:19:23 +00:00
|
|
|
// ===============
|
|
|
|
|
2008-07-24 09:39:56 +00:00
|
|
|
CreateMenu(_LocalCoreStartupParameter);
|
|
|
|
|
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
2008-09-29 03:19:23 +00:00
|
|
|
// =======================================================================================
|
|
|
|
// Configure the code window
|
2008-07-24 09:39:56 +00:00
|
|
|
wxBoxSizer* sizerBig = new wxBoxSizer(wxHORIZONTAL);
|
|
|
|
wxBoxSizer* sizerLeft = new wxBoxSizer(wxVERTICAL);
|
|
|
|
|
|
|
|
DebugInterface* di = new PPCDebugInterface();
|
|
|
|
|
2008-08-24 20:25:36 +00:00
|
|
|
codeview = new CCodeView(di, this, IDM_CODEVIEW);
|
2008-07-24 09:39:56 +00:00
|
|
|
sizerBig->Add(sizerLeft, 2, wxEXPAND);
|
|
|
|
sizerBig->Add(codeview, 5, wxEXPAND);
|
|
|
|
|
2008-08-24 18:50:51 +00:00
|
|
|
sizerLeft->Add(callstack = new wxListBox(this, IDM_CALLSTACKLIST, wxDefaultPosition, wxSize(90, 100)), 0, wxEXPAND);
|
|
|
|
sizerLeft->Add(symbols = new wxListBox(this, IDM_SYMBOLLIST, wxDefaultPosition, wxSize(90, 100), 0, NULL, wxLB_SORT), 1, wxEXPAND);
|
2008-08-24 20:25:36 +00:00
|
|
|
sizerLeft->Add(calls = new wxListBox(this, IDM_CALLSLIST, wxDefaultPosition, wxSize(90, 100), 0, NULL, wxLB_SORT), 0, wxEXPAND);
|
|
|
|
sizerLeft->Add(callers = new wxListBox(this, IDM_CALLERSLIST, wxDefaultPosition, wxSize(90, 100), 0, NULL, wxLB_SORT), 0, wxEXPAND);
|
2008-08-24 18:50:51 +00:00
|
|
|
|
2008-07-24 09:39:56 +00:00
|
|
|
SetSizer(sizerBig);
|
|
|
|
|
|
|
|
sizerLeft->SetSizeHints(this);
|
|
|
|
sizerLeft->Fit(this);
|
|
|
|
sizerBig->SetSizeHints(this);
|
|
|
|
sizerBig->Fit(this);
|
|
|
|
|
|
|
|
sync_event.Init();
|
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
2008-09-29 03:19:23 +00:00
|
|
|
// =================
|
|
|
|
|
2008-07-24 09:39:56 +00:00
|
|
|
|
|
|
|
// additional dialogs
|
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
2008-09-29 03:19:23 +00:00
|
|
|
if (IsLoggingActivated() && bLogWindow)
|
2008-07-24 09:39:56 +00:00
|
|
|
{
|
2008-07-24 13:40:07 +00:00
|
|
|
m_LogWindow = new CLogWindow(this);
|
|
|
|
m_LogWindow->Show(true);
|
2008-07-24 09:39:56 +00:00
|
|
|
}
|
|
|
|
|
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
2008-09-29 03:19:23 +00:00
|
|
|
if (bRegisterWindow)
|
|
|
|
{
|
|
|
|
m_RegisterWindow = new CRegisterWindow(this);
|
|
|
|
m_RegisterWindow->Show(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(bBreakpointWindow)
|
|
|
|
{
|
|
|
|
m_BreakpointWindow = new CBreakPointWindow(this, this);
|
|
|
|
m_BreakpointWindow->Show(true);
|
|
|
|
}
|
2008-07-24 09:39:56 +00:00
|
|
|
|
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
2008-09-29 03:19:23 +00:00
|
|
|
if(bMemoryWindow)
|
|
|
|
{
|
|
|
|
m_MemoryWindow = new CMemoryWindow(this);
|
|
|
|
m_MemoryWindow->Show(true);
|
|
|
|
}
|
2008-07-24 09:39:56 +00:00
|
|
|
|
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
2008-09-29 03:19:23 +00:00
|
|
|
if(bJitWindow)
|
|
|
|
{
|
|
|
|
m_JitWindow = new CJitWindow(this);
|
|
|
|
m_JitWindow->Show(true);
|
|
|
|
}
|
2008-08-21 17:22:55 +00:00
|
|
|
|
2008-10-04 14:26:47 +00:00
|
|
|
if(bSoundWindow)
|
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
2008-09-29 03:19:23 +00:00
|
|
|
{
|
2008-10-04 13:39:38 +00:00
|
|
|
// possible todo: add some kind of if here to? can it fail?
|
|
|
|
CPluginManager::GetInstance().OpenDebug(
|
|
|
|
GetHandle(),
|
2008-11-16 20:09:13 +00:00
|
|
|
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin.c_str(),
|
|
|
|
false, true
|
2008-10-04 13:39:38 +00:00
|
|
|
);
|
|
|
|
} // don't have any else, just ignore it
|
2008-10-09 18:47:53 +00:00
|
|
|
|
|
|
|
if(bVideoWindow)
|
|
|
|
{
|
2008-11-16 20:09:13 +00:00
|
|
|
wxMessageBox(_T("Warning, automatically opening this window before a game is started \n\
|
|
|
|
may cause a crash. Todo: figure out why and fix it."), wxT("OpenGL Debugging Window"));
|
|
|
|
|
2008-10-09 18:47:53 +00:00
|
|
|
// possible todo: add some kind of if here to? can it fail?
|
|
|
|
CPluginManager::GetInstance().OpenDebug(
|
|
|
|
GetHandle(),
|
2008-11-16 20:09:13 +00:00
|
|
|
_LocalCoreStartupParameter.m_strVideoPlugin.c_str(),
|
|
|
|
true, true
|
2008-10-09 18:47:53 +00:00
|
|
|
);
|
|
|
|
} // don't have any else, just ignore it
|
2008-07-24 09:39:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-07-12 17:40:22 +00:00
|
|
|
void CCodeWindow::CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParameter)
|
|
|
|
{
|
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
2008-09-29 03:19:23 +00:00
|
|
|
|
|
|
|
// =======================================================================================
|
|
|
|
// Windowses
|
|
|
|
// ---------------
|
2008-07-12 17:40:22 +00:00
|
|
|
wxMenuBar* pMenuBar = new wxMenuBar(wxMB_DOCKABLE);
|
|
|
|
|
2008-10-12 06:31:14 +00:00
|
|
|
{
|
2008-08-09 16:56:24 +00:00
|
|
|
wxMenu* pCoreMenu = new wxMenu;
|
2008-10-12 06:31:14 +00:00
|
|
|
|
2008-08-09 16:56:24 +00:00
|
|
|
wxMenuItem* interpreter = pCoreMenu->Append(IDM_INTERPRETER, _T("&Interpreter"), wxEmptyString, wxITEM_CHECK);
|
2008-08-25 20:34:11 +00:00
|
|
|
interpreter->Check(!_LocalCoreStartupParameter.bUseJIT);
|
2008-07-12 17:40:22 +00:00
|
|
|
|
2008-10-12 13:59:26 +00:00
|
|
|
#ifdef JIT_OFF_OPTIONS
|
2008-10-12 06:31:14 +00:00
|
|
|
jitoff = pCoreMenu->Append(IDM_JITOFF, _T("&JIT off"), wxEmptyString, wxITEM_CHECK);
|
|
|
|
jitoff->Check(_LocalCoreStartupParameter.bJITOff);
|
|
|
|
|
|
|
|
jitlsoff = pCoreMenu->Append(IDM_JITLSOFF, _T("&JIT LoadStore off"), wxEmptyString, wxITEM_CHECK);
|
|
|
|
jitlsoff->Check(_LocalCoreStartupParameter.bJITLoadStoreOff);
|
|
|
|
|
2008-10-28 22:38:53 +00:00
|
|
|
jitlspoff = pCoreMenu->Append(IDM_JITLSFOFF, _T("&JIT LoadStore Floating off"), wxEmptyString, wxITEM_CHECK);
|
|
|
|
jitlspoff->Check(_LocalCoreStartupParameter.bJITLoadStoreFloatingOff);
|
|
|
|
|
|
|
|
jitlsfoff = pCoreMenu->Append(IDM_JITLSPOFF, _T("&JIT LoadStore Paired off"), wxEmptyString, wxITEM_CHECK);
|
|
|
|
jitlsfoff->Check(_LocalCoreStartupParameter.bJITLoadStorePairedOff);
|
|
|
|
|
2008-10-12 06:31:14 +00:00
|
|
|
jitfpoff = pCoreMenu->Append(IDM_JITFPOFF, _T("&JIT FloatingPoint off"), wxEmptyString, wxITEM_CHECK);
|
|
|
|
jitfpoff->Check(_LocalCoreStartupParameter.bJITFloatingPointOff);
|
|
|
|
|
|
|
|
jitioff = pCoreMenu->Append(IDM_JITIOFF, _T("&JIT Integer off"), wxEmptyString, wxITEM_CHECK);
|
|
|
|
jitioff->Check(_LocalCoreStartupParameter.bJITIntegerOff);
|
|
|
|
|
|
|
|
jitpoff = pCoreMenu->Append(IDM_JITPOFF, _T("&JIT Paired off"), wxEmptyString, wxITEM_CHECK);
|
|
|
|
jitpoff->Check(_LocalCoreStartupParameter.bJITPairedOff);
|
|
|
|
|
|
|
|
jitsroff = pCoreMenu->Append(IDM_JITSROFF, _T("&JIT SystemRegisters off"), wxEmptyString, wxITEM_CHECK);
|
|
|
|
jitsroff->Check(_LocalCoreStartupParameter.bJITSystemRegistersOff);
|
2008-10-12 13:59:26 +00:00
|
|
|
#endif
|
2008-10-12 06:31:14 +00:00
|
|
|
|
2008-07-16 12:19:14 +00:00
|
|
|
// wxMenuItem* dualcore = pDebugMenu->Append(IDM_DUALCORE, _T("&DualCore"), wxEmptyString, wxITEM_CHECK);
|
|
|
|
// dualcore->Check(_LocalCoreStartupParameter.bUseDualCore);
|
2008-07-12 17:40:22 +00:00
|
|
|
|
2008-08-25 20:34:11 +00:00
|
|
|
pMenuBar->Append(pCoreMenu, _T("&CPU Mode"));
|
2008-07-12 17:40:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
wxMenu* pDebugDialogs = new wxMenu;
|
|
|
|
|
|
|
|
if (IsLoggingActivated())
|
|
|
|
{
|
|
|
|
wxMenuItem* pLogWindow = pDebugDialogs->Append(IDM_LOGWINDOW, _T("&LogManager"), wxEmptyString, wxITEM_CHECK);
|
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
2008-09-29 03:19:23 +00:00
|
|
|
pLogWindow->Check(bLogWindow);
|
2008-07-12 17:40:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
wxMenuItem* pRegister = pDebugDialogs->Append(IDM_REGISTERWINDOW, _T("&Registers"), wxEmptyString, wxITEM_CHECK);
|
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
2008-09-29 03:19:23 +00:00
|
|
|
pRegister->Check(bRegisterWindow);
|
2008-07-12 17:40:22 +00:00
|
|
|
|
2008-07-17 20:08:01 +00:00
|
|
|
wxMenuItem* pBreakPoints = pDebugDialogs->Append(IDM_BREAKPOINTWINDOW, _T("&BreakPoints"), wxEmptyString, wxITEM_CHECK);
|
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
2008-09-29 03:19:23 +00:00
|
|
|
pBreakPoints->Check(bBreakpointWindow);
|
2008-07-17 20:08:01 +00:00
|
|
|
|
2008-07-21 18:42:44 +00:00
|
|
|
wxMenuItem* pMemory = pDebugDialogs->Append(IDM_MEMORYWINDOW, _T("&Memory"), wxEmptyString, wxITEM_CHECK);
|
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
2008-09-29 03:19:23 +00:00
|
|
|
pMemory->Check(bMemoryWindow);
|
|
|
|
|
|
|
|
wxMenuItem* pJit = pDebugDialogs->Append(IDM_JITWINDOW, _T("&Jit"), wxEmptyString, wxITEM_CHECK);
|
|
|
|
pJit->Check(bJitWindow);
|
|
|
|
|
|
|
|
wxMenuItem* pSound = pDebugDialogs->Append(IDM_SOUNDWINDOW, _T("&Sound"), wxEmptyString, wxITEM_CHECK);
|
2008-10-04 14:26:47 +00:00
|
|
|
pSound->Check(bSoundWindow);
|
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
2008-09-29 03:19:23 +00:00
|
|
|
|
2008-10-09 18:47:53 +00:00
|
|
|
wxMenuItem* pVideo = pDebugDialogs->Append(IDM_VIDEOWINDOW, _T("&Video"), wxEmptyString, wxITEM_CHECK);
|
|
|
|
pVideo->Check(bVideoWindow);
|
|
|
|
|
2008-07-21 18:42:44 +00:00
|
|
|
pMenuBar->Append(pDebugDialogs, _T("&Views"));
|
2008-07-12 17:40:22 +00:00
|
|
|
}
|
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
2008-09-29 03:19:23 +00:00
|
|
|
// ===============
|
|
|
|
|
2008-07-12 17:40:22 +00:00
|
|
|
|
2008-08-09 16:56:24 +00:00
|
|
|
{
|
|
|
|
wxMenu *pSymbolsMenu = new wxMenu;
|
2008-08-24 18:50:51 +00:00
|
|
|
pSymbolsMenu->Append(IDM_CLEARSYMBOLS, _T("&Clear symbols"));
|
2008-08-24 21:30:59 +00:00
|
|
|
// pSymbolsMenu->Append(IDM_CLEANSYMBOLS, _T("&Clean symbols (zz)"));
|
2008-08-24 18:50:51 +00:00
|
|
|
pSymbolsMenu->Append(IDM_SCANFUNCTIONS, _T("&Generate symbol map"));
|
|
|
|
pSymbolsMenu->AppendSeparator();
|
|
|
|
pSymbolsMenu->Append(IDM_LOADMAPFILE, _T("&Load symbol map"));
|
2008-08-23 15:15:25 +00:00
|
|
|
pSymbolsMenu->Append(IDM_SAVEMAPFILE, _T("&Save symbol map"));
|
2008-08-24 15:46:08 +00:00
|
|
|
pSymbolsMenu->AppendSeparator();
|
|
|
|
pSymbolsMenu->Append(IDM_CREATESIGNATUREFILE, _T("&Create signature file..."));
|
|
|
|
pSymbolsMenu->Append(IDM_USESIGNATUREFILE, _T("&Use signature file..."));
|
2008-10-27 21:27:23 +00:00
|
|
|
pSymbolsMenu->AppendSeparator();
|
|
|
|
pSymbolsMenu->Append(IDM_PATCHHLEFUNCTIONS, _T("&Patch HLE functions"));
|
2008-08-09 16:56:24 +00:00
|
|
|
pMenuBar->Append(pSymbolsMenu, _T("&Symbols"));
|
|
|
|
}
|
2008-08-13 20:48:27 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
wxMenu *pJitMenu = new wxMenu;
|
|
|
|
pJitMenu->Append(IDM_CLEARCODECACHE, _T("&Clear code cache"));
|
2008-08-23 09:20:36 +00:00
|
|
|
pJitMenu->Append(IDM_LOGINSTRUCTIONS, _T("&Log JIT instruction coverage"));
|
2008-08-13 20:48:27 +00:00
|
|
|
pMenuBar->Append(pJitMenu, _T("&JIT"));
|
|
|
|
}
|
|
|
|
|
2008-08-30 12:11:25 +00:00
|
|
|
{
|
|
|
|
wxMenu *pProfilerMenu = new wxMenu;
|
|
|
|
pProfilerMenu->Append(IDM_PROFILEBLOCKS, _T("&Profile blocks"), wxEmptyString, wxITEM_CHECK);
|
|
|
|
pProfilerMenu->AppendSeparator();
|
|
|
|
pProfilerMenu->Append(IDM_WRITEPROFILE, _T("&Write to profile.txt, show"));
|
|
|
|
pMenuBar->Append(pProfilerMenu, _T("&Profiler"));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-07-12 17:40:22 +00:00
|
|
|
SetMenuBar(pMenuBar);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool CCodeWindow::UseInterpreter()
|
|
|
|
{
|
2008-10-27 21:27:23 +00:00
|
|
|
return GetMenuBar()->IsChecked(IDM_INTERPRETER);
|
2008-07-12 17:40:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool CCodeWindow::UseDualCore()
|
|
|
|
{
|
2008-10-27 21:27:23 +00:00
|
|
|
return GetMenuBar()->IsChecked(IDM_DUALCORE);
|
2008-07-12 17:40:22 +00:00
|
|
|
}
|
|
|
|
|
2008-10-12 06:31:14 +00:00
|
|
|
|
|
|
|
// =======================================================================================
|
|
|
|
// CPU Mode
|
|
|
|
// --------------
|
2008-08-25 20:34:11 +00:00
|
|
|
void CCodeWindow::OnInterpreter(wxCommandEvent& event)
|
|
|
|
{
|
|
|
|
if (Core::GetState() != Core::CORE_RUN) {
|
|
|
|
PowerPC::SetMode(UseInterpreter() ? PowerPC::MODE_INTERPRETER : PowerPC::MODE_JIT);
|
|
|
|
} else {
|
2008-08-30 12:11:25 +00:00
|
|
|
event.Skip();
|
2008-08-25 20:34:11 +00:00
|
|
|
wxMessageBox(_T("Please pause the emulator before changing mode."));
|
|
|
|
}
|
|
|
|
}
|
2008-10-12 06:31:14 +00:00
|
|
|
void CCodeWindow::DoJITOff(wxCommandEvent& event, wxMenuItem* a, bool& b)
|
|
|
|
{
|
|
|
|
if (Core::GetState() == Core::CORE_UNINITIALIZED)
|
|
|
|
{
|
|
|
|
// we disallow changing the status here because it will be reset to the defult when BootCore()
|
|
|
|
// creates the SCoreStartupParameter as a game is loaded
|
|
|
|
a->Check(!a->IsChecked());
|
|
|
|
wxMessageBox(_T("Please start a game before changing mode."));
|
|
|
|
} else {
|
|
|
|
if (Core::GetState() != Core::CORE_RUN)
|
|
|
|
{
|
|
|
|
b = !b;
|
|
|
|
Jit64::ClearCache();
|
|
|
|
} else {
|
|
|
|
//event.Skip(); // this doesn't work
|
|
|
|
a->Check(!a->IsChecked());
|
|
|
|
wxMessageBox(_T("Please pause the emulator before changing mode."));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void CCodeWindow::OnJITOff(wxCommandEvent& event) {DoJITOff(event, jitoff,
|
|
|
|
Core::g_CoreStartupParameter.bJITOff);}
|
|
|
|
void CCodeWindow::OnJITLSOff(wxCommandEvent& event) {DoJITOff(event, jitlsoff,
|
|
|
|
Core::g_CoreStartupParameter.bJITLoadStoreOff);}
|
2008-10-28 22:38:53 +00:00
|
|
|
void CCodeWindow::OnJITLSFOff(wxCommandEvent& event) {DoJITOff(event, jitlsoff,
|
|
|
|
Core::g_CoreStartupParameter.bJITLoadStoreFloatingOff);}
|
|
|
|
void CCodeWindow::OnJITLSPOff(wxCommandEvent& event) {DoJITOff(event, jitlsoff,
|
|
|
|
Core::g_CoreStartupParameter.bJITLoadStorePairedOff);}
|
2008-10-12 06:31:14 +00:00
|
|
|
void CCodeWindow::OnJITFPOff(wxCommandEvent& event) {DoJITOff(event, jitfpoff,
|
|
|
|
Core::g_CoreStartupParameter.bJITFloatingPointOff);}
|
|
|
|
void CCodeWindow::OnJITIOff(wxCommandEvent& event) {DoJITOff(event, jitioff,
|
|
|
|
Core::g_CoreStartupParameter.bJITIntegerOff);}
|
|
|
|
void CCodeWindow::OnJITPOff(wxCommandEvent& event) {DoJITOff(event, jitpoff,
|
|
|
|
Core::g_CoreStartupParameter.bJITPairedOff);}
|
|
|
|
void CCodeWindow::OnJITSROff(wxCommandEvent& event) {DoJITOff(event, jitsroff,
|
|
|
|
Core::g_CoreStartupParameter.bJITSystemRegistersOff);}
|
|
|
|
// ==============
|
|
|
|
|
2008-07-12 17:40:22 +00:00
|
|
|
|
2008-08-13 20:48:27 +00:00
|
|
|
void CCodeWindow::OnJitMenu(wxCommandEvent& event)
|
|
|
|
{
|
|
|
|
switch (event.GetId())
|
|
|
|
{
|
|
|
|
case IDM_CLEARCODECACHE:
|
|
|
|
Jit64::ClearCache();
|
|
|
|
break;
|
2008-08-23 09:20:36 +00:00
|
|
|
case IDM_LOGINSTRUCTIONS:
|
|
|
|
PPCTables::LogCompiledInstructions();
|
|
|
|
break;
|
2008-08-13 20:48:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-08-30 12:11:25 +00:00
|
|
|
void CCodeWindow::OnProfilerMenu(wxCommandEvent& event)
|
|
|
|
{
|
|
|
|
if (Core::GetState() == Core::CORE_RUN) {
|
|
|
|
event.Skip();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
switch (event.GetId())
|
|
|
|
{
|
|
|
|
case IDM_PROFILEBLOCKS:
|
|
|
|
Jit64::ClearCache();
|
|
|
|
Profiler::g_ProfileBlocks = GetMenuBar()->IsChecked(IDM_PROFILEBLOCKS);
|
|
|
|
break;
|
|
|
|
case IDM_WRITEPROFILE:
|
|
|
|
Profiler::WriteProfileResults("profiler.txt");
|
2008-10-27 21:27:23 +00:00
|
|
|
File::Launch("profiler.txt");
|
2008-08-30 12:11:25 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-08-09 16:56:24 +00:00
|
|
|
void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event)
|
|
|
|
{
|
|
|
|
if (Core::GetState() == Core::CORE_UNINITIALIZED)
|
|
|
|
{
|
|
|
|
// TODO: disable menu items instead :P
|
|
|
|
return;
|
|
|
|
}
|
2008-08-23 15:15:25 +00:00
|
|
|
std::string mapfile = CBoot::GenerateMapFilename();
|
2008-08-09 16:56:24 +00:00
|
|
|
switch (event.GetId())
|
|
|
|
{
|
2008-08-24 18:50:51 +00:00
|
|
|
case IDM_CLEARSYMBOLS:
|
|
|
|
g_symbolDB.Clear();
|
|
|
|
Host_NotifyMapLoaded();
|
|
|
|
break;
|
2008-08-24 21:30:59 +00:00
|
|
|
case IDM_CLEANSYMBOLS:
|
|
|
|
g_symbolDB.Clear("zz");
|
|
|
|
Host_NotifyMapLoaded();
|
|
|
|
break;
|
2008-08-09 16:56:24 +00:00
|
|
|
case IDM_SCANFUNCTIONS:
|
2008-08-24 18:50:51 +00:00
|
|
|
{
|
|
|
|
PPCAnalyst::FindFunctions(0x80000000, 0x80400000, &g_symbolDB);
|
|
|
|
SignatureDB db;
|
2008-11-12 04:54:17 +00:00
|
|
|
if (db.Load(TOTALDB_FILE))
|
2008-08-24 18:50:51 +00:00
|
|
|
db.Apply(&g_symbolDB);
|
2008-10-27 21:27:23 +00:00
|
|
|
|
|
|
|
// HLE::PatchFunctions();
|
2008-08-24 21:30:59 +00:00
|
|
|
NotifyMapLoaded();
|
2008-08-24 18:50:51 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case IDM_LOADMAPFILE:
|
2008-09-22 19:48:12 +00:00
|
|
|
if (!File::Exists(mapfile.c_str()))
|
2008-08-10 18:21:16 +00:00
|
|
|
{
|
2008-08-24 18:50:51 +00:00
|
|
|
g_symbolDB.Clear();
|
|
|
|
PPCAnalyst::FindFunctions(0x80000000, 0x80400000, &g_symbolDB);
|
2008-08-24 15:46:08 +00:00
|
|
|
SignatureDB db;
|
2008-11-12 04:54:17 +00:00
|
|
|
if (db.Load(TOTALDB_FILE))
|
2008-08-24 18:50:51 +00:00
|
|
|
db.Apply(&g_symbolDB);
|
2008-08-23 15:15:25 +00:00
|
|
|
} else {
|
2008-08-24 18:50:51 +00:00
|
|
|
g_symbolDB.LoadMap(mapfile.c_str());
|
2008-08-10 18:21:16 +00:00
|
|
|
}
|
2008-08-24 21:30:59 +00:00
|
|
|
NotifyMapLoaded();
|
2008-08-10 18:21:16 +00:00
|
|
|
break;
|
|
|
|
case IDM_SAVEMAPFILE:
|
2008-08-24 18:50:51 +00:00
|
|
|
g_symbolDB.SaveMap(mapfile.c_str());
|
2008-08-10 18:21:16 +00:00
|
|
|
break;
|
2008-08-24 15:46:08 +00:00
|
|
|
case IDM_CREATESIGNATUREFILE:
|
|
|
|
{
|
2008-08-24 22:39:36 +00:00
|
|
|
wxTextEntryDialog input_prefix(this, wxString::FromAscii("Only export symbols with prefix:"), wxGetTextFromUserPromptStr, _T("."));
|
2008-08-24 21:54:59 +00:00
|
|
|
if (input_prefix.ShowModal() == wxID_OK) {
|
2008-08-24 22:39:36 +00:00
|
|
|
std::string prefix(input_prefix.GetValue().mb_str());
|
2008-08-24 21:54:59 +00:00
|
|
|
|
|
|
|
wxString path = wxFileSelector(
|
|
|
|
_T("Save signature as"), wxEmptyString, wxEmptyString, wxEmptyString,
|
|
|
|
_T("Dolphin Signature File (*.dsy)|*.dsy;"), wxFD_SAVE,
|
|
|
|
this);
|
|
|
|
if (path) {
|
|
|
|
SignatureDB db;
|
|
|
|
db.Initialize(&g_symbolDB, prefix.c_str());
|
|
|
|
std::string filename(path.ToAscii()); // PPCAnalyst::SaveSignatureDB(
|
|
|
|
db.Save(path.ToAscii());
|
|
|
|
}
|
2008-08-24 15:46:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case IDM_USESIGNATUREFILE:
|
|
|
|
{
|
|
|
|
wxString path = wxFileSelector(
|
|
|
|
_T("Apply signature file"), wxEmptyString, wxEmptyString, wxEmptyString,
|
|
|
|
_T("Dolphin Signature File (*.dsy)|*.dsy;"), wxFD_OPEN | wxFD_FILE_MUST_EXIST,
|
|
|
|
this);
|
|
|
|
if (path) {
|
|
|
|
SignatureDB db;
|
|
|
|
db.Load(path.ToAscii());
|
2008-08-24 18:50:51 +00:00
|
|
|
db.Apply(&g_symbolDB);
|
2008-08-24 15:46:08 +00:00
|
|
|
}
|
|
|
|
}
|
2008-08-24 21:30:59 +00:00
|
|
|
NotifyMapLoaded();
|
2008-08-24 15:46:08 +00:00
|
|
|
break;
|
2008-10-27 21:27:23 +00:00
|
|
|
case IDM_PATCHHLEFUNCTIONS:
|
|
|
|
HLE::PatchFunctions();
|
|
|
|
Update();
|
|
|
|
break;
|
2008-08-09 16:56:24 +00:00
|
|
|
}
|
|
|
|
}
|
2008-07-17 21:46:34 +00:00
|
|
|
|
2008-07-12 17:40:22 +00:00
|
|
|
void CCodeWindow::OnCodeStep(wxCommandEvent& event)
|
|
|
|
{
|
|
|
|
switch (event.GetId())
|
|
|
|
{
|
|
|
|
case IDM_DEBUG_GO:
|
|
|
|
{
|
|
|
|
// [F|RES] prolly we should disable the other buttons in go mode too ...
|
2008-08-24 20:25:36 +00:00
|
|
|
JumpToAddress(PC);
|
2008-07-12 17:40:22 +00:00
|
|
|
|
|
|
|
if (CCPU::IsStepping())
|
|
|
|
{
|
|
|
|
CCPU::EnableStepping(false);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CCPU::EnableStepping(true);
|
|
|
|
Host_UpdateLogDisplay();
|
|
|
|
}
|
|
|
|
|
|
|
|
Update();
|
|
|
|
}
|
2008-08-23 15:15:25 +00:00
|
|
|
break;
|
2008-07-12 17:40:22 +00:00
|
|
|
|
|
|
|
case IDM_STEP:
|
2008-07-24 13:40:07 +00:00
|
|
|
SingleCPUStep();
|
|
|
|
|
2008-07-12 17:40:22 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case IDM_STEPOVER:
|
|
|
|
CCPU::EnableStepping(true);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case IDM_SKIP:
|
|
|
|
PC += 4;
|
|
|
|
Update();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case IDM_SETPC:
|
|
|
|
PC = codeview->GetSelection();
|
|
|
|
Update();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case IDM_GOTOPC:
|
2008-08-24 20:25:36 +00:00
|
|
|
JumpToAddress(PC);
|
2008-07-12 17:40:22 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
UpdateButtonStates();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-08-24 20:25:36 +00:00
|
|
|
void CCodeWindow::JumpToAddress(u32 _Address)
|
|
|
|
{
|
|
|
|
codeview->Center(_Address);
|
|
|
|
UpdateLists();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CCodeWindow::UpdateLists()
|
|
|
|
{
|
|
|
|
callers->Clear();
|
|
|
|
u32 addr = codeview->GetSelection();
|
|
|
|
Symbol *symbol = g_symbolDB.GetSymbolFromAddr(addr);
|
|
|
|
if (!symbol)
|
|
|
|
return;
|
2008-08-24 21:32:35 +00:00
|
|
|
for (int i = 0; i < (int)symbol->callers.size(); i++)
|
2008-08-24 20:25:36 +00:00
|
|
|
{
|
|
|
|
u32 caller_addr = symbol->callers[i].callAddress;
|
|
|
|
Symbol *caller_symbol = g_symbolDB.GetSymbolFromAddr(caller_addr);
|
2008-08-24 21:30:59 +00:00
|
|
|
if (caller_symbol) {
|
2008-08-24 21:32:35 +00:00
|
|
|
int idx = callers->Append(wxString::Format( _T("< %s (%08x)"), caller_symbol->name.c_str(), caller_addr));
|
2008-08-24 21:30:59 +00:00
|
|
|
callers->SetClientData(idx, (void*)caller_addr);
|
|
|
|
}
|
2008-08-24 20:25:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
calls->Clear();
|
2008-08-24 21:32:35 +00:00
|
|
|
for (int i = 0; i < (int)symbol->calls.size(); i++)
|
2008-08-24 20:25:36 +00:00
|
|
|
{
|
|
|
|
u32 call_addr = symbol->calls[i].function;
|
|
|
|
Symbol *call_symbol = g_symbolDB.GetSymbolFromAddr(call_addr);
|
2008-08-24 21:30:59 +00:00
|
|
|
if (call_symbol) {
|
2008-08-24 21:32:35 +00:00
|
|
|
int idx = calls->Append(wxString::Format(_T("> %s (%08x)"), call_symbol->name.c_str(), call_addr));
|
2008-08-24 21:30:59 +00:00
|
|
|
calls->SetClientData(idx, (void*)call_addr);
|
|
|
|
}
|
2008-08-24 20:25:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CCodeWindow::OnCodeViewChange(wxCommandEvent &event)
|
|
|
|
{
|
|
|
|
//PanicAlert("boo");
|
|
|
|
UpdateLists();
|
|
|
|
}
|
|
|
|
|
2008-07-12 17:40:22 +00:00
|
|
|
void CCodeWindow::OnAddrBoxChange(wxCommandEvent& event)
|
|
|
|
{
|
2008-07-24 09:39:56 +00:00
|
|
|
wxTextCtrl* pAddrCtrl = (wxTextCtrl*)GetToolBar()->FindControl(IDM_ADDRBOX);
|
|
|
|
wxString txt = pAddrCtrl->GetValue();
|
2008-07-12 17:40:22 +00:00
|
|
|
|
2008-08-24 20:32:46 +00:00
|
|
|
std::string text(txt.mb_str());
|
2008-08-24 20:25:36 +00:00
|
|
|
text = StripSpaces(text);
|
|
|
|
if (text.size() == 8)
|
2008-07-12 17:40:22 +00:00
|
|
|
{
|
|
|
|
u32 addr;
|
2008-08-24 20:25:36 +00:00
|
|
|
sscanf(text.c_str(), "%08x", &addr);
|
|
|
|
JumpToAddress(addr);
|
2008-07-12 17:40:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
event.Skip(1);
|
|
|
|
}
|
|
|
|
|
2008-08-24 20:25:36 +00:00
|
|
|
void CCodeWindow::OnCallstackListChange(wxCommandEvent& event)
|
|
|
|
{
|
|
|
|
int index = callstack->GetSelection();
|
2008-09-14 09:18:03 +00:00
|
|
|
if (index >= 0) {
|
|
|
|
u32 address = (u32)(u64)(callstack->GetClientData(index));
|
|
|
|
if (address)
|
|
|
|
JumpToAddress(address);
|
|
|
|
}
|
2008-08-24 20:25:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CCodeWindow::OnCallersListChange(wxCommandEvent& event)
|
|
|
|
{
|
|
|
|
int index = callers->GetSelection();
|
2008-09-14 09:18:03 +00:00
|
|
|
if (index >= 0) {
|
|
|
|
u32 address = (u32)(u64)(callers->GetClientData(index));
|
|
|
|
if (address)
|
|
|
|
JumpToAddress(address);
|
|
|
|
}
|
2008-08-24 20:25:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CCodeWindow::OnCallsListChange(wxCommandEvent& event)
|
|
|
|
{
|
|
|
|
int index = calls->GetSelection();
|
2008-09-14 09:18:03 +00:00
|
|
|
if (index >= 0) {
|
|
|
|
u32 address = (u32)(u64)(calls->GetClientData(index));
|
|
|
|
if (address)
|
|
|
|
JumpToAddress(address);
|
|
|
|
}
|
2008-08-24 20:25:36 +00:00
|
|
|
}
|
2008-07-12 17:40:22 +00:00
|
|
|
|
|
|
|
void CCodeWindow::Update()
|
|
|
|
{
|
|
|
|
codeview->Refresh();
|
|
|
|
callstack->Clear();
|
|
|
|
|
2008-08-24 15:46:08 +00:00
|
|
|
std::vector<Debugger::CallstackEntry> stack;
|
2008-07-12 17:40:22 +00:00
|
|
|
|
|
|
|
if (Debugger::GetCallstack(stack))
|
|
|
|
{
|
|
|
|
for (size_t i = 0; i < stack.size(); i++)
|
|
|
|
{
|
|
|
|
int idx = callstack->Append(wxString::FromAscii(stack[i].Name.c_str()));
|
|
|
|
callstack->SetClientData(idx, (void*)(u64)stack[i].vAddress);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-07-20 11:02:41 +00:00
|
|
|
callstack->Append(wxString::FromAscii("invalid callstack"));
|
2008-07-12 17:40:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
UpdateButtonStates();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CCodeWindow::NotifyMapLoaded()
|
|
|
|
{
|
2008-08-24 20:25:36 +00:00
|
|
|
g_symbolDB.FillInCallers();
|
2008-07-12 17:40:22 +00:00
|
|
|
symbols->Show(false); // hide it for faster filling
|
|
|
|
symbols->Clear();
|
2008-08-24 18:50:51 +00:00
|
|
|
for (SymbolDB::XFuncMap::iterator iter = g_symbolDB.GetIterator(); iter != g_symbolDB.End(); iter++)
|
2008-07-12 17:40:22 +00:00
|
|
|
{
|
2008-08-24 19:47:10 +00:00
|
|
|
int idx = symbols->Append(wxString::FromAscii(iter->second.name.c_str()));
|
2008-08-24 18:50:51 +00:00
|
|
|
symbols->SetClientData(idx, (void*)&iter->second);
|
2008-07-12 17:40:22 +00:00
|
|
|
}
|
|
|
|
symbols->Show(true);
|
|
|
|
Update();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CCodeWindow::UpdateButtonStates()
|
|
|
|
{
|
2008-07-24 13:40:07 +00:00
|
|
|
wxToolBar* toolBar = GetToolBar();
|
2008-07-12 17:40:22 +00:00
|
|
|
if (Core::GetState() == Core::CORE_UNINITIALIZED)
|
|
|
|
{
|
2008-07-24 09:39:56 +00:00
|
|
|
toolBar->EnableTool(IDM_DEBUG_GO, false);
|
|
|
|
toolBar->EnableTool(IDM_STEP, false);
|
|
|
|
toolBar->EnableTool(IDM_STEPOVER, false);
|
|
|
|
toolBar->EnableTool(IDM_SKIP, false);
|
2008-07-12 17:40:22 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (!CCPU::IsStepping())
|
|
|
|
{
|
2008-07-24 09:39:56 +00:00
|
|
|
toolBar->SetToolShortHelp(IDM_DEBUG_GO, _T("&Pause"));
|
2008-07-24 13:40:07 +00:00
|
|
|
toolBar->SetToolNormalBitmap(IDM_DEBUG_GO, m_Bitmaps[Toolbar_Pause]);
|
2008-07-24 09:39:56 +00:00
|
|
|
toolBar->EnableTool(IDM_DEBUG_GO, true);
|
|
|
|
toolBar->EnableTool(IDM_STEP, false);
|
|
|
|
toolBar->EnableTool(IDM_STEPOVER, false);
|
|
|
|
toolBar->EnableTool(IDM_SKIP, false);
|
2008-07-12 17:40:22 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-07-24 13:40:07 +00:00
|
|
|
toolBar->SetToolShortHelp(IDM_DEBUG_GO, _T("&Play"));
|
|
|
|
toolBar->SetToolNormalBitmap(IDM_DEBUG_GO, m_Bitmaps[Toolbar_DebugGo]);
|
2008-07-24 09:39:56 +00:00
|
|
|
toolBar->EnableTool(IDM_DEBUG_GO, true);
|
|
|
|
toolBar->EnableTool(IDM_STEP, true);
|
|
|
|
toolBar->EnableTool(IDM_STEPOVER, true);
|
|
|
|
toolBar->EnableTool(IDM_SKIP, true);
|
2008-07-12 17:40:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-07-20 15:12:12 +00:00
|
|
|
void CCodeWindow::OnSymbolListChange(wxCommandEvent& event)
|
2008-07-12 17:40:22 +00:00
|
|
|
{
|
|
|
|
int index = symbols->GetSelection();
|
2008-09-14 09:18:03 +00:00
|
|
|
if (index >= 0) {
|
|
|
|
Symbol* pSymbol = static_cast<Symbol *>(symbols->GetClientData(index));
|
|
|
|
if (pSymbol != NULL)
|
|
|
|
{
|
2008-09-23 00:05:08 +00:00
|
|
|
if(pSymbol->type == Symbol::SYMBOL_DATA)
|
|
|
|
{
|
|
|
|
if(m_MemoryWindow && m_MemoryWindow->IsVisible())
|
|
|
|
m_MemoryWindow->JumpToAddress(pSymbol->address);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
JumpToAddress(pSymbol->address);
|
|
|
|
}
|
2008-09-14 09:18:03 +00:00
|
|
|
}
|
2008-07-12 17:40:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-08-10 18:21:16 +00:00
|
|
|
void CCodeWindow::OnSymbolListContextMenu(wxContextMenuEvent& event)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-07-12 17:40:22 +00:00
|
|
|
|
|
|
|
void CCodeWindow::OnToggleLogWindow(wxCommandEvent& event)
|
|
|
|
{
|
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
2008-09-29 03:19:23 +00:00
|
|
|
|
2008-07-12 17:40:22 +00:00
|
|
|
if (IsLoggingActivated())
|
|
|
|
{
|
|
|
|
bool show = GetMenuBar()->IsChecked(event.GetId());
|
|
|
|
|
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
2008-09-29 03:19:23 +00:00
|
|
|
// 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;
|
2008-11-12 04:54:17 +00:00
|
|
|
ini.Load(DEBUGGER_CONFIG_FILE);
|
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
2008-09-29 03:19:23 +00:00
|
|
|
ini.Set("ShowOnStart", "LogWindow", show);
|
2008-11-12 04:54:17 +00:00
|
|
|
ini.Save(DEBUGGER_CONFIG_FILE);
|
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
2008-09-29 03:19:23 +00:00
|
|
|
|
2008-07-12 17:40:22 +00:00
|
|
|
if (show)
|
|
|
|
{
|
2008-07-24 13:40:07 +00:00
|
|
|
if (!m_LogWindow)
|
2008-07-12 17:40:22 +00:00
|
|
|
{
|
2008-07-24 13:40:07 +00:00
|
|
|
m_LogWindow = new CLogWindow(this);
|
2008-07-12 17:40:22 +00:00
|
|
|
}
|
|
|
|
|
2008-07-24 13:40:07 +00:00
|
|
|
m_LogWindow->Show(true);
|
2008-07-12 17:40:22 +00:00
|
|
|
}
|
|
|
|
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.
|
2008-07-24 13:40:07 +00:00
|
|
|
wxASSERT(m_LogWindow != NULL);
|
2008-07-12 17:40:22 +00:00
|
|
|
|
2008-07-24 13:40:07 +00:00
|
|
|
if (m_LogWindow)
|
2008-07-12 17:40:22 +00:00
|
|
|
{
|
2008-07-24 13:40:07 +00:00
|
|
|
m_LogWindow->Hide();
|
2008-07-12 17:40:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CCodeWindow::OnToggleRegisterWindow(wxCommandEvent& event)
|
|
|
|
{
|
|
|
|
bool show = GetMenuBar()->IsChecked(event.GetId());
|
|
|
|
|
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
2008-09-29 03:19:23 +00:00
|
|
|
IniFile ini;
|
2008-11-12 04:54:17 +00:00
|
|
|
ini.Load(DEBUGGER_CONFIG_FILE);
|
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
2008-09-29 03:19:23 +00:00
|
|
|
ini.Set("ShowOnStart", "RegisterWindow", show);
|
2008-11-12 04:54:17 +00:00
|
|
|
ini.Save(DEBUGGER_CONFIG_FILE);
|
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
2008-09-29 03:19:23 +00:00
|
|
|
|
2008-07-12 17:40:22 +00:00
|
|
|
if (show)
|
|
|
|
{
|
|
|
|
if (!m_RegisterWindow)
|
|
|
|
{
|
|
|
|
m_RegisterWindow = new CRegisterWindow(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
m_RegisterWindow->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_RegisterWindow != NULL);
|
|
|
|
|
|
|
|
if (m_RegisterWindow)
|
|
|
|
{
|
|
|
|
m_RegisterWindow->Hide();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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
2008-09-29 03:19:23 +00:00
|
|
|
|
|
|
|
// =======================================================================================
|
|
|
|
// Toggle Sound Debugging Window
|
|
|
|
// ------------
|
|
|
|
void CCodeWindow::OnToggleSoundWindow(wxCommandEvent& event)
|
|
|
|
{
|
|
|
|
bool show = GetMenuBar()->IsChecked(event.GetId());
|
|
|
|
|
|
|
|
IniFile ini;
|
2008-11-12 04:54:17 +00:00
|
|
|
ini.Load(DEBUGGER_CONFIG_FILE);
|
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
2008-09-29 03:19:23 +00:00
|
|
|
ini.Set("ShowOnStart", "SoundWindow", show);
|
2008-11-12 04:54:17 +00:00
|
|
|
ini.Save(DEBUGGER_CONFIG_FILE);
|
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
2008-09-29 03:19:23 +00:00
|
|
|
|
2008-10-04 14:26:47 +00:00
|
|
|
if (show)
|
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
2008-09-29 03:19:23 +00:00
|
|
|
{
|
2008-10-04 13:39:38 +00:00
|
|
|
// TODO: add some kind of if() check here to?
|
|
|
|
CPluginManager::GetInstance().OpenDebug(
|
2008-11-16 20:09:13 +00:00
|
|
|
GetHandle(),
|
|
|
|
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin.c_str(),
|
|
|
|
false, true // DSP, show
|
|
|
|
);
|
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
2008-09-29 03:19:23 +00:00
|
|
|
}
|
|
|
|
else // hide
|
|
|
|
{
|
2008-11-16 20:09:13 +00:00
|
|
|
// Close the sound dll that has an open debugger
|
|
|
|
CPluginManager::GetInstance().OpenDebug(
|
|
|
|
GetHandle(),
|
|
|
|
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin.c_str(),
|
|
|
|
false, false // DSP, hide
|
|
|
|
);
|
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
2008-09-29 03:19:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
// ===========
|
|
|
|
|
|
|
|
|
2008-10-09 18:47:53 +00:00
|
|
|
// =======================================================================================
|
|
|
|
// Toggle Video Debugging Window
|
|
|
|
// ------------
|
|
|
|
void CCodeWindow::OnToggleVideoWindow(wxCommandEvent& event)
|
|
|
|
{
|
|
|
|
bool show = GetMenuBar()->IsChecked(event.GetId());
|
|
|
|
|
|
|
|
IniFile ini;
|
2008-11-12 04:54:17 +00:00
|
|
|
ini.Load(DEBUGGER_CONFIG_FILE);
|
2008-10-09 18:47:53 +00:00
|
|
|
ini.Set("ShowOnStart", "VideoWindow", show);
|
2008-11-12 04:54:17 +00:00
|
|
|
ini.Save(DEBUGGER_CONFIG_FILE);
|
2008-10-09 18:47:53 +00:00
|
|
|
|
|
|
|
if (show)
|
|
|
|
{
|
|
|
|
// TODO: add some kind of if() check here to?
|
|
|
|
CPluginManager::GetInstance().OpenDebug(
|
|
|
|
GetHandle(),
|
2008-11-16 20:09:13 +00:00
|
|
|
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoPlugin.c_str(),
|
|
|
|
true, true // Video, show
|
2008-10-09 18:47:53 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
else // hide
|
|
|
|
{
|
2008-11-16 20:09:13 +00:00
|
|
|
// Close the video dll that has an open debugger
|
|
|
|
CPluginManager::GetInstance().OpenDebug(
|
|
|
|
GetHandle(),
|
|
|
|
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoPlugin.c_str(),
|
|
|
|
true, false // Video, hide
|
|
|
|
);
|
2008-10-09 18:47:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
// ===========
|
|
|
|
|
|
|
|
|
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
2008-09-29 03:19:23 +00:00
|
|
|
void CCodeWindow::OnToggleJitWindow(wxCommandEvent& event)
|
|
|
|
{
|
|
|
|
bool show = GetMenuBar()->IsChecked(event.GetId());
|
|
|
|
|
|
|
|
IniFile ini;
|
2008-11-12 04:54:17 +00:00
|
|
|
ini.Load(DEBUGGER_CONFIG_FILE);
|
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
2008-09-29 03:19:23 +00:00
|
|
|
ini.Set("ShowOnStart", "JitWindow", show);
|
2008-11-12 04:54:17 +00:00
|
|
|
ini.Save(DEBUGGER_CONFIG_FILE);
|
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
2008-09-29 03:19:23 +00:00
|
|
|
|
|
|
|
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();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-07-17 20:08:01 +00:00
|
|
|
void CCodeWindow::OnToggleBreakPointWindow(wxCommandEvent& event)
|
|
|
|
{
|
|
|
|
bool show = GetMenuBar()->IsChecked(event.GetId());
|
|
|
|
|
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
2008-09-29 03:19:23 +00:00
|
|
|
IniFile ini;
|
2008-11-12 04:54:17 +00:00
|
|
|
ini.Load(DEBUGGER_CONFIG_FILE);
|
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
2008-09-29 03:19:23 +00:00
|
|
|
ini.Set("ShowOnStart", "BreakpointWindow", show);
|
2008-11-12 04:54:17 +00:00
|
|
|
ini.Save(DEBUGGER_CONFIG_FILE);
|
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
2008-09-29 03:19:23 +00:00
|
|
|
|
2008-07-17 20:08:01 +00:00
|
|
|
if (show)
|
|
|
|
{
|
|
|
|
if (!m_BreakpointWindow)
|
|
|
|
{
|
2008-07-17 21:46:34 +00:00
|
|
|
m_BreakpointWindow = new CBreakPointWindow(this, this);
|
2008-07-17 20:08:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
m_BreakpointWindow->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_BreakpointWindow != NULL);
|
|
|
|
|
|
|
|
if (m_BreakpointWindow)
|
|
|
|
{
|
|
|
|
m_BreakpointWindow->Hide();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2008-07-12 17:40:22 +00:00
|
|
|
|
2008-07-21 18:42:44 +00:00
|
|
|
void CCodeWindow::OnToggleMemoryWindow(wxCommandEvent& event)
|
|
|
|
{
|
|
|
|
bool show = GetMenuBar()->IsChecked(event.GetId());
|
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
2008-09-29 03:19:23 +00:00
|
|
|
|
|
|
|
IniFile ini;
|
2008-11-12 04:54:17 +00:00
|
|
|
ini.Load(DEBUGGER_CONFIG_FILE);
|
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
2008-09-29 03:19:23 +00:00
|
|
|
ini.Set("ShowOnStart", "MemoryWindow", show);
|
2008-11-12 04:54:17 +00:00
|
|
|
ini.Save(DEBUGGER_CONFIG_FILE);
|
2008-07-21 18:42:44 +00:00
|
|
|
|
|
|
|
if (show)
|
|
|
|
{
|
|
|
|
if (!m_MemoryWindow)
|
|
|
|
{
|
|
|
|
m_MemoryWindow = new CMemoryWindow(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
m_MemoryWindow->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_MemoryWindow != NULL);
|
|
|
|
|
|
|
|
if (m_MemoryWindow)
|
|
|
|
{
|
|
|
|
m_MemoryWindow->Hide();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2008-08-09 16:56:24 +00:00
|
|
|
|
2008-07-12 17:40:22 +00:00
|
|
|
void CCodeWindow::OnHostMessage(wxCommandEvent& event)
|
|
|
|
{
|
|
|
|
switch (event.GetId())
|
|
|
|
{
|
|
|
|
case IDM_NOTIFYMAPLOADED:
|
|
|
|
NotifyMapLoaded();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case IDM_UPDATELOGDISPLAY:
|
|
|
|
|
2008-07-24 13:40:07 +00:00
|
|
|
if (m_LogWindow)
|
2008-07-12 17:40:22 +00:00
|
|
|
{
|
2008-07-24 13:40:07 +00:00
|
|
|
m_LogWindow->NotifyUpdate();
|
2008-07-12 17:40:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case IDM_UPDATEDISASMDIALOG:
|
|
|
|
Update();
|
|
|
|
|
|
|
|
if (m_RegisterWindow)
|
|
|
|
{
|
|
|
|
m_RegisterWindow->NotifyUpdate();
|
|
|
|
}
|
|
|
|
break;
|
2008-07-17 20:08:01 +00:00
|
|
|
|
|
|
|
case IDM_UPDATEBREAKPOINTS:
|
2008-07-17 21:46:34 +00:00
|
|
|
Update();
|
2008-07-17 20:08:01 +00:00
|
|
|
|
|
|
|
if (m_BreakpointWindow)
|
|
|
|
{
|
|
|
|
m_BreakpointWindow->NotifyUpdate();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2008-07-12 17:40:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-07-24 09:39:56 +00:00
|
|
|
void CCodeWindow::PopulateToolbar(wxToolBar* toolBar)
|
|
|
|
{
|
|
|
|
int w = m_Bitmaps[Toolbar_DebugGo].GetWidth(),
|
|
|
|
h = m_Bitmaps[Toolbar_DebugGo].GetHeight();
|
|
|
|
|
|
|
|
toolBar->SetToolBitmapSize(wxSize(w, h));
|
2008-08-09 16:56:24 +00:00
|
|
|
toolBar->AddTool(IDM_DEBUG_GO, _T("Play"), m_Bitmaps[Toolbar_DebugGo]);
|
|
|
|
toolBar->AddTool(IDM_STEP, _T("Step"), m_Bitmaps[Toolbar_Step]);
|
|
|
|
toolBar->AddTool(IDM_STEPOVER, _T("Step Over"), m_Bitmaps[Toolbar_StepOver]);
|
|
|
|
toolBar->AddTool(IDM_SKIP, _T("Skip"), m_Bitmaps[Toolbar_Skip]);
|
2008-07-24 09:39:56 +00:00
|
|
|
toolBar->AddSeparator();
|
2008-08-14 19:57:46 +00:00
|
|
|
toolBar->AddTool(IDM_GOTOPC, _T("Show PC"), m_Bitmaps[Toolbar_GotoPC]);
|
2008-08-09 16:56:24 +00:00
|
|
|
toolBar->AddTool(IDM_SETPC, _T("Set PC"), m_Bitmaps[Toolbar_SetPC]);
|
2008-07-24 09:39:56 +00:00
|
|
|
toolBar->AddSeparator();
|
|
|
|
toolBar->AddControl(new wxTextCtrl(toolBar, IDM_ADDRBOX, _T("")));
|
|
|
|
|
|
|
|
// after adding the buttons to the toolbar, must call Realize() to reflect
|
|
|
|
// the changes
|
|
|
|
toolBar->Realize();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CCodeWindow::RecreateToolbar()
|
|
|
|
{
|
|
|
|
// delete and recreate the toolbar
|
|
|
|
wxToolBarBase* toolBar = GetToolBar();
|
|
|
|
delete toolBar;
|
|
|
|
SetToolBar(NULL);
|
|
|
|
|
|
|
|
long style = TOOLBAR_STYLE;
|
|
|
|
style &= ~(wxTB_HORIZONTAL | wxTB_VERTICAL | wxTB_BOTTOM | wxTB_RIGHT | wxTB_HORZ_LAYOUT | wxTB_TOP);
|
|
|
|
wxToolBar* theToolBar = CreateToolBar(style, ID_TOOLBAR);
|
|
|
|
|
|
|
|
PopulateToolbar(theToolBar);
|
|
|
|
SetToolBar(theToolBar);
|
|
|
|
}
|
|
|
|
|
2008-07-12 17:40:22 +00:00
|
|
|
|
2008-07-24 09:39:56 +00:00
|
|
|
void CCodeWindow::InitBitmaps()
|
|
|
|
{
|
|
|
|
// load original size 48x48
|
2008-07-24 13:40:07 +00:00
|
|
|
m_Bitmaps[Toolbar_DebugGo] = wxGetBitmapFromMemory(toolbar_play_png);
|
2008-07-24 09:39:56 +00:00
|
|
|
m_Bitmaps[Toolbar_Step] = wxGetBitmapFromMemory(toolbar_add_breakpoint_png);
|
|
|
|
m_Bitmaps[Toolbar_StepOver] = wxGetBitmapFromMemory(toolbar_add_memcheck_png);
|
|
|
|
m_Bitmaps[Toolbar_Skip] = wxGetBitmapFromMemory(toolbar_add_memcheck_png);
|
|
|
|
m_Bitmaps[Toolbar_GotoPC] = wxGetBitmapFromMemory(toolbar_add_memcheck_png);
|
|
|
|
m_Bitmaps[Toolbar_SetPC] = wxGetBitmapFromMemory(toolbar_add_memcheck_png);
|
2008-07-24 13:40:07 +00:00
|
|
|
m_Bitmaps[Toolbar_Pause] = wxGetBitmapFromMemory(toolbar_pause_png);
|
2008-07-24 09:39:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
// scale to 16x16 for toolbar
|
|
|
|
for (size_t n = Toolbar_DebugGo; n < Bitmaps_max; n++)
|
|
|
|
{
|
|
|
|
m_Bitmaps[n] = wxBitmap(m_Bitmaps[n].ConvertToImage().Scale(16, 16));
|
|
|
|
}
|
|
|
|
}
|
2008-07-24 13:40:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
void CCodeWindow::OnKeyDown(wxKeyEvent& event)
|
|
|
|
{
|
2008-07-24 14:12:09 +00:00
|
|
|
if ((event.GetKeyCode() == WXK_SPACE) && IsActive())
|
2008-07-24 13:40:07 +00:00
|
|
|
{
|
|
|
|
SingleCPUStep();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
event.Skip();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CCodeWindow::SingleCPUStep()
|
|
|
|
{
|
|
|
|
CCPU::StepOpcode(&sync_event);
|
|
|
|
// if (CCPU::IsStepping())
|
|
|
|
// sync_event.Wait();
|
|
|
|
wxThread::Sleep(20);
|
|
|
|
// need a short wait here
|
2008-08-24 20:25:36 +00:00
|
|
|
JumpToAddress(PC);
|
2008-07-24 13:40:07 +00:00
|
|
|
Update();
|
|
|
|
Host_UpdateLogDisplay();
|
2008-08-23 03:48:40 +00:00
|
|
|
}
|