Add debugger config to ini, and put it to use

This commit is contained in:
Kingcom 2014-02-24 11:48:06 +01:00
parent 8ee14a8039
commit 807521f91b
8 changed files with 83 additions and 15 deletions

View File

@ -404,6 +404,31 @@ struct Pcsx2Config
}
};
struct DebugOptions
{
BITFIELD32()
bool
EnableDebugger :1,
ShowDebuggerOnStart :1;
BITFIELD_END
u8 FontWidth;
u8 FontHeight;
DebugOptions();
void LoadSave( IniInterface& conf );
bool operator ==( const DebugOptions& right ) const
{
return OpEqu( bitset ) && OpEqu( FontWidth ) && OpEqu( FontHeight );
}
bool operator !=( const DebugOptions& right ) const
{
return !this->operator ==( right );
}
};
BITFIELD32()
bool
CdvdVerboseReads :1, // enables cdvd read activity verbosely dumped to the console
@ -429,6 +454,7 @@ struct Pcsx2Config
SpeedhackOptions Speedhacks;
GamefixOptions Gamefixes;
ProfilerOptions Profiler;
DebugOptions Debugger;
TraceLogFilters Trace;

View File

@ -371,6 +371,28 @@ void Pcsx2Config::GamefixOptions::LoadSave( IniInterface& ini )
IniBitBool( FMVinSoftwareHack );
}
Pcsx2Config::DebugOptions::DebugOptions()
{
EnableDebugger = false;
ShowDebuggerOnStart = false;
FontWidth = 8;
FontHeight = 12;
}
void Pcsx2Config::DebugOptions::LoadSave( IniInterface& ini )
{
ScopedIniGroup path( ini, L"Debugger" );
IniBitBool( EnableDebugger );
IniBitBool( ShowDebuggerOnStart );
IniBitfield(FontWidth);
IniBitfield(FontHeight);
}
Pcsx2Config::Pcsx2Config()
{
bitset = 0;
@ -405,6 +427,7 @@ void Pcsx2Config::LoadSave( IniInterface& ini )
Gamefixes .LoadSave( ini );
Profiler .LoadSave( ini );
Debugger .LoadSave( ini );
Trace .LoadSave( ini );
ini.Flush();

View File

@ -230,9 +230,12 @@ void SysCoreThread::GameStartingInThread()
{
GetMTGS().SendGameCRC(ElfCRC);
if (EmuConfig.Debugger.EnableDebugger)
{
MIPSAnalyst::ScanForFunctions(ElfTextRange.first,ElfTextRange.first+ElfTextRange.second,true);
symbolMap.UpdateActiveSymbols();
sApp.PostAppMethod(&Pcsx2App::resetDebugger);
}
if (EmuConfig.EnablePatches) ApplyPatch(0);
if (EmuConfig.EnableCheats) ApplyCheat(0);

View File

@ -88,9 +88,17 @@ void Pcsx2App::OpenMainFrame()
MainEmuFrame* mainFrame = new MainEmuFrame( NULL, pxGetAppName() );
m_id_MainFrame = mainFrame->GetId();
if (g_Conf->EmuOptions.Debugger.EnableDebugger)
{
DisassemblyDialog* disassembly = new DisassemblyDialog( mainFrame );
m_id_Disassembler = disassembly->GetId();
if (g_Conf->EmuOptions.Debugger.ShowDebuggerOnStart)
disassembly->Show();
} else {
m_id_Disassembler = 0;
}
PostIdleAppMethod( &Pcsx2App::OpenProgramLog );
SetTopWindow( mainFrame ); // not really needed...

View File

@ -5,6 +5,7 @@
#include "DebugEvents.h"
#include "BreakpointWindow.h"
#include "AppConfig.h"
#include <wx/mstream.h>
#include <wx/clipbrd.h>
@ -65,8 +66,8 @@ CtrlDisassemblyView::CtrlDisassemblyView(wxWindow* parent, DebugInterface* _cpu)
{
manager.setCpu(cpu);
windowStart = 0x100000;
rowHeight = 14;
charWidth = 8;
rowHeight = g_Conf->EmuOptions.Debugger.FontHeight+2;
charWidth = g_Conf->EmuOptions.Debugger.FontWidth;
displaySymbols = true;
visibleRows = 1;

View File

@ -1,6 +1,7 @@
#include "PrecompiledHeader.h"
#include "CtrlMemView.h"
#include "DebugTools/Debug.h"
#include "AppConfig.h"
#include "BreakpointWindow.h"
#include "DebugEvents.h"
@ -35,8 +36,8 @@ enum MemoryViewMenuIdentifiers
CtrlMemView::CtrlMemView(wxWindow* parent, DebugInterface* _cpu)
: wxWindow(parent,wxID_ANY,wxDefaultPosition,wxDefaultSize,wxWANTS_CHARS), cpu(_cpu)
{
rowHeight = 12;
charWidth = 8;
rowHeight = g_Conf->EmuOptions.Debugger.FontHeight;
charWidth = g_Conf->EmuOptions.Debugger.FontWidth;
windowStart = 0x480000;
curAddress = windowStart;
rowSize = 16;

View File

@ -3,6 +3,7 @@
#include "DebugTools/Debug.h"
#include "DebugEvents.h"
#include "AppConfig.h"
BEGIN_EVENT_TABLE(CtrlRegisterList, wxWindow)
EVT_PAINT(CtrlRegisterList::paintEvent)
@ -24,8 +25,8 @@ enum DisassemblyMenuIdentifiers
CtrlRegisterList::CtrlRegisterList(wxWindow* parent, DebugInterface* _cpu)
: wxWindow(parent,wxID_ANY,wxDefaultPosition,wxDefaultSize,wxWANTS_CHARS|wxBORDER), cpu(_cpu)
{
rowHeight = 14;
charWidth = 8;
rowHeight = g_Conf->EmuOptions.Debugger.FontHeight+2;
charWidth = g_Conf->EmuOptions.Debugger.FontWidth;
category = 0;
maxBits = 128;

View File

@ -339,6 +339,8 @@ MainEmuFrame::MainEmuFrame(wxWindow* parent, const wxString& title)
m_menubar.Append( &m_menuCDVD, _("CD&VD") );
m_menubar.Append( &m_menuConfig, _("&Config") );
m_menubar.Append( &m_menuMisc, _("&Misc") );
if (g_Conf->EmuOptions.Debugger.EnableDebugger)
m_menubar.Append( &m_menuDebug, _("&Debug") );
SetMenuBar( &m_menubar );
@ -506,9 +508,12 @@ MainEmuFrame::MainEmuFrame(wxWindow* parent, const wxString& title)
m_menuMisc.AppendSeparator();
m_menuMisc.Append( MenuId_ChangeLang, L"Change Language" ); // Always in English
if (g_Conf->EmuOptions.Debugger.EnableDebugger)
{
m_menuDebug.Append(MenuId_Debug_Open, _("Open Debug Window..."), wxEmptyString);
//m_menuDebug.Append(MenuId_Debug_MemoryDump, _("Memory Dump..."), wxEmptyString);
m_menuDebug.Append(MenuId_Debug_Logging, _("Logging..."), wxEmptyString);
}
m_MenuItem_Console.Check( g_Conf->ProgLogBox.Visible );