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/
|
|
|
|
|
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
|
|
|
#ifndef CODEWINDOW_H_
|
|
|
|
#define CODEWINDOW_H_
|
|
|
|
|
2008-08-26 23:32:54 +00:00
|
|
|
#include <wx/dialog.h>
|
|
|
|
#include <wx/textctrl.h>
|
|
|
|
#include <wx/listbox.h>
|
2008-07-12 17:40:22 +00:00
|
|
|
#include "Debugger.h"
|
|
|
|
#include "CodeView.h"
|
|
|
|
#include "Thread.h"
|
|
|
|
|
|
|
|
#include "CoreParameter.h"
|
|
|
|
|
|
|
|
class CRegisterWindow;
|
|
|
|
class CLogWindow;
|
2008-07-17 20:08:01 +00:00
|
|
|
class CBreakPointWindow;
|
2008-07-21 18:42:44 +00:00
|
|
|
class CMemoryWindow;
|
2008-08-21 17:22:55 +00:00
|
|
|
class CJitWindow;
|
2008-07-21 18:42:44 +00:00
|
|
|
class CCodeView;
|
2008-07-24 13:40:07 +00:00
|
|
|
class IniFile;
|
2008-07-12 17:40:22 +00:00
|
|
|
|
|
|
|
class CCodeWindow
|
|
|
|
: public wxFrame
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter, wxWindow* parent,
|
|
|
|
wxWindowID id = wxID_ANY,
|
|
|
|
const wxString& title = _T("Dolphin-Debugger"),
|
|
|
|
const wxPoint& pos = wxPoint(950, 100),
|
|
|
|
const wxSize& size = wxSize(400, 500),
|
|
|
|
long style = wxDEFAULT_FRAME_STYLE | wxCLIP_CHILDREN | wxNO_FULL_REPAINT_ON_RESIZE);
|
|
|
|
|
2008-07-24 13:40:07 +00:00
|
|
|
~CCodeWindow();
|
|
|
|
|
|
|
|
void Load(IniFile &file);
|
|
|
|
void Save(IniFile &file) const;
|
2008-07-17 21:46:34 +00:00
|
|
|
|
2008-07-12 17:40:22 +00:00
|
|
|
void Update();
|
|
|
|
void NotifyMapLoaded();
|
|
|
|
|
2008-08-24 20:25:36 +00:00
|
|
|
|
2008-07-12 17:40:22 +00:00
|
|
|
bool UseInterpreter();
|
|
|
|
bool UseDualCore();
|
2008-07-17 21:46:34 +00:00
|
|
|
void JumpToAddress(u32 _Address);
|
2008-07-12 17:40:22 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
2008-07-24 09:39:56 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
ID_TOOLBAR = 500,
|
2008-08-24 20:25:36 +00:00
|
|
|
IDM_CODEVIEW,
|
2008-07-24 09:39:56 +00:00
|
|
|
IDM_DEBUG_GO,
|
|
|
|
IDM_STEP,
|
|
|
|
IDM_STEPOVER,
|
|
|
|
IDM_SKIP,
|
|
|
|
IDM_SETPC,
|
|
|
|
IDM_GOTOPC,
|
|
|
|
IDM_ADDRBOX,
|
|
|
|
IDM_CALLSTACKLIST,
|
2008-08-24 20:25:36 +00:00
|
|
|
IDM_CALLERSLIST,
|
|
|
|
IDM_CALLSLIST,
|
2008-07-24 09:39:56 +00:00
|
|
|
IDM_SYMBOLLIST,
|
|
|
|
IDM_INTERPRETER,
|
2008-10-12 06:31:14 +00:00
|
|
|
IDM_JITOFF, // jit
|
|
|
|
IDM_JITLSOFF,
|
|
|
|
IDM_JITIOFF,
|
|
|
|
IDM_JITFPOFF,
|
|
|
|
IDM_JITPOFF,
|
|
|
|
IDM_JITSROFF,
|
2008-07-24 09:39:56 +00:00
|
|
|
IDM_DUALCORE,
|
|
|
|
IDM_LOGWINDOW,
|
|
|
|
IDM_REGISTERWINDOW,
|
|
|
|
IDM_BREAKPOINTWINDOW,
|
|
|
|
IDM_MEMORYWINDOW,
|
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
|
|
|
IDM_SOUNDWINDOW, // sound
|
2008-10-09 18:47:53 +00:00
|
|
|
IDM_VIDEOWINDOW, // video
|
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
|
|
|
IDM_JITWINDOW, // jit
|
2008-08-09 16:56:24 +00:00
|
|
|
IDM_SCANFUNCTIONS,
|
2008-08-23 09:20:36 +00:00
|
|
|
IDM_LOGINSTRUCTIONS,
|
2008-08-24 18:50:51 +00:00
|
|
|
IDM_LOADMAPFILE,
|
2008-08-10 18:21:16 +00:00
|
|
|
IDM_SAVEMAPFILE,
|
2008-08-24 18:50:51 +00:00
|
|
|
IDM_CLEARSYMBOLS,
|
2008-08-24 21:30:59 +00:00
|
|
|
IDM_CLEANSYMBOLS,
|
2008-08-24 15:46:08 +00:00
|
|
|
IDM_CREATESIGNATUREFILE,
|
|
|
|
IDM_USESIGNATUREFILE,
|
|
|
|
IDM_USESYMBOLFILE,
|
2008-08-13 20:48:27 +00:00
|
|
|
IDM_CLEARCODECACHE,
|
2008-08-30 12:11:25 +00:00
|
|
|
IDM_PROFILEBLOCKS,
|
|
|
|
IDM_WRITEPROFILE,
|
2008-07-24 09:39:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
Toolbar_DebugGo,
|
2008-07-24 13:40:07 +00:00
|
|
|
Toolbar_Pause,
|
2008-07-24 09:39:56 +00:00
|
|
|
Toolbar_Step,
|
|
|
|
Toolbar_StepOver,
|
|
|
|
Toolbar_Skip,
|
|
|
|
Toolbar_GotoPC,
|
|
|
|
Toolbar_SetPC,
|
|
|
|
Bitmaps_max
|
|
|
|
};
|
|
|
|
|
2008-07-12 17:40:22 +00:00
|
|
|
// sub dialogs
|
2008-07-24 13:40:07 +00:00
|
|
|
CLogWindow* m_LogWindow;
|
2008-07-12 17:40:22 +00:00
|
|
|
CRegisterWindow* m_RegisterWindow;
|
2008-07-17 20:08:01 +00:00
|
|
|
CBreakPointWindow* m_BreakpointWindow;
|
2008-07-21 18:42:44 +00:00
|
|
|
CMemoryWindow* m_MemoryWindow;
|
2008-08-21 17:22:55 +00:00
|
|
|
CJitWindow* m_JitWindow;
|
2008-07-12 17:40:22 +00:00
|
|
|
|
2008-10-12 06:31:14 +00:00
|
|
|
wxMenuItem* jitoff;
|
|
|
|
wxMenuItem* jitlsoff;
|
|
|
|
wxMenuItem* jitfpoff;
|
|
|
|
wxMenuItem* jitioff;
|
|
|
|
wxMenuItem* jitpoff;
|
|
|
|
wxMenuItem* jitsroff;
|
|
|
|
|
2008-07-12 17:40:22 +00:00
|
|
|
CCodeView* codeview;
|
|
|
|
wxListBox* callstack;
|
|
|
|
wxListBox* symbols;
|
2008-08-24 20:25:36 +00:00
|
|
|
wxListBox* callers;
|
|
|
|
wxListBox* calls;
|
2008-07-12 17:40:22 +00:00
|
|
|
Common::Event sync_event;
|
|
|
|
|
2008-07-24 09:39:56 +00:00
|
|
|
wxBitmap m_Bitmaps[Bitmaps_max];
|
2008-07-12 17:40:22 +00:00
|
|
|
|
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
|
2008-07-20 15:12:12 +00:00
|
|
|
void OnSymbolListChange(wxCommandEvent& event);
|
2008-08-10 18:21:16 +00:00
|
|
|
void OnSymbolListContextMenu(wxContextMenuEvent& event);
|
2008-07-12 17:40:22 +00:00
|
|
|
void OnCallstackListChange(wxCommandEvent& event);
|
2008-08-24 20:25:36 +00:00
|
|
|
void OnCallersListChange(wxCommandEvent& event);
|
|
|
|
void OnCallsListChange(wxCommandEvent& event);
|
2008-07-12 17:40:22 +00:00
|
|
|
void OnCodeStep(wxCommandEvent& event);
|
2008-08-24 20:25:36 +00:00
|
|
|
void OnCodeViewChange(wxCommandEvent &event);
|
2008-07-24 13:40:07 +00:00
|
|
|
|
|
|
|
void SingleCPUStep();
|
|
|
|
|
2008-07-12 17:40:22 +00:00
|
|
|
void OnAddrBoxChange(wxCommandEvent& event);
|
|
|
|
|
|
|
|
void OnToggleRegisterWindow(wxCommandEvent& event);
|
2008-07-17 20:08:01 +00:00
|
|
|
void OnToggleBreakPointWindow(wxCommandEvent& event);
|
2008-07-12 17:40:22 +00:00
|
|
|
void OnToggleLogWindow(wxCommandEvent& event);
|
2008-07-21 18:42:44 +00:00
|
|
|
void OnToggleMemoryWindow(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
|
|
|
void OnToggleJitWindow(wxCommandEvent& event);
|
|
|
|
void OnToggleSoundWindow(wxCommandEvent& event);
|
2008-10-09 18:47:53 +00:00
|
|
|
void OnToggleVideoWindow(wxCommandEvent& event);
|
|
|
|
|
2008-07-12 17:40:22 +00:00
|
|
|
void OnHostMessage(wxCommandEvent& event);
|
2008-08-09 16:56:24 +00:00
|
|
|
void OnSymbolsMenu(wxCommandEvent& event);
|
2008-08-13 20:48:27 +00:00
|
|
|
void OnJitMenu(wxCommandEvent& event);
|
2008-08-30 12:11:25 +00:00
|
|
|
void OnProfilerMenu(wxCommandEvent& event);
|
2008-07-12 17:40:22 +00:00
|
|
|
|
2008-10-12 06:31:14 +00:00
|
|
|
void OnInterpreter(wxCommandEvent& event); // cpu mode menu
|
|
|
|
void OnJITOff(wxCommandEvent& event);
|
|
|
|
void OnJITLSOff(wxCommandEvent& event);
|
|
|
|
void OnJITFPOff(wxCommandEvent& event);
|
|
|
|
void OnJITIOff(wxCommandEvent& event);
|
|
|
|
void OnJITPOff(wxCommandEvent& event);
|
|
|
|
void OnJITSROff(wxCommandEvent& event);
|
|
|
|
void DoJITOff(wxCommandEvent& event, wxMenuItem* a, bool& b);
|
2008-08-30 12:11:25 +00:00
|
|
|
|
2008-07-12 17:40:22 +00:00
|
|
|
void CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParameter);
|
|
|
|
|
|
|
|
void UpdateButtonStates();
|
2008-08-24 20:25:36 +00:00
|
|
|
void UpdateLists();
|
2008-07-24 09:39:56 +00:00
|
|
|
|
|
|
|
void RecreateToolbar();
|
|
|
|
void PopulateToolbar(wxToolBar* toolBar);
|
|
|
|
void InitBitmaps();
|
|
|
|
void CreateGUIControls(const SCoreStartupParameter& _LocalCoreStartupParameter);
|
2008-07-24 13:40:07 +00:00
|
|
|
void OnKeyDown(wxKeyEvent& event);
|
2008-07-12 17:40:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /*CODEWINDOW_*/
|