diff options
| author | hrydgard <hrydgard@gmail.com> | 2010-06-03 18:05:08 +0000 |
|---|---|---|
| committer | hrydgard <hrydgard@gmail.com> | 2010-06-03 18:05:08 +0000 |
| commit | a3c96ac42c4c2ce4a4cf2f5ca09a5ae9dd4bd303 (patch) | |
| tree | da7ca1f64fce704934d581c82a9533fe38b103f1 /Source/Core/DebuggerWX | |
| parent | 3236aa9e73cf6d0bc798cce6f5224cff40eb6955 (diff) | |
Warp back to 5578. Sorry for the lost changes, please re-apply. Reason: 5579 is a complete disaster.
Not only does it change tons of files to switch to a new and non-working (it doesn't parse my ini files, at least) ini parser, it also reshuffles a lot of code and removes a plugin. The latter part is fine, but doing these two major switches in one revision, one of which is broken, is completely unacceptable. I said to merge tiny changes, not massive reworkings.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5589 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/DebuggerWX')
| -rw-r--r-- | Source/Core/DebuggerWX/Src/BreakpointWindow.cpp | 10 | ||||
| -rw-r--r-- | Source/Core/DebuggerWX/Src/CodeWindowFunctions.cpp | 124 | ||||
| -rw-r--r-- | Source/Core/DebuggerWX/Src/MemoryWindow.cpp | 24 |
3 files changed, 75 insertions, 83 deletions
diff --git a/Source/Core/DebuggerWX/Src/BreakpointWindow.cpp b/Source/Core/DebuggerWX/Src/BreakpointWindow.cpp index c413813842..8198247038 100644 --- a/Source/Core/DebuggerWX/Src/BreakpointWindow.cpp +++ b/Source/Core/DebuggerWX/Src/BreakpointWindow.cpp @@ -142,14 +142,13 @@ void CBreakPointWindow::OnAddBreakPointMany() if (ini.Load(filename.c_str())) // check if there is any file there { // get lines from a certain section - if (!ini.Exists("BreakPoints")) + std::vector<std::string> lines; + if (!ini.GetLines("BreakPoints", lines)) { wxMessageBox(_T("You have no [BreakPoints] line in your file")); return; } - std::vector<std::string> lines; - ini["BreakPoints"].GetLines(lines); for (std::vector<std::string>::const_iterator iter = lines.begin(); iter != lines.end(); ++iter) { std::string line = StripSpaces(*iter); @@ -189,14 +188,13 @@ void CBreakPointWindow::OnAddMemoryCheckMany() if (ini.Load(filename.c_str())) { // get lines from a certain section - if (!ini.Exists("MemoryChecks")) + std::vector<std::string> lines; + if (!ini.GetLines("MemoryChecks", lines)) { wxMessageBox(_T("You have no [MemoryChecks] line in your file")); return; } - std::vector<std::string> lines; - ini["MemoryChecks"].GetLines(lines); for (std::vector<std::string>::const_iterator iter = lines.begin(); iter != lines.end(); ++iter) { std::string line = StripSpaces(*iter); diff --git a/Source/Core/DebuggerWX/Src/CodeWindowFunctions.cpp b/Source/Core/DebuggerWX/Src/CodeWindowFunctions.cpp index 3b050b60c8..f8c1310aee 100644 --- a/Source/Core/DebuggerWX/Src/CodeWindowFunctions.cpp +++ b/Source/Core/DebuggerWX/Src/CodeWindowFunctions.cpp @@ -88,93 +88,89 @@ void CCodeWindow::Load() // The font to override DebuggerFont with std::string fontDesc; - Section& showonstart = ini["ShowOnStart"]; - showonstart.Get("DebuggerFont", &fontDesc); + ini.Get("ShowOnStart", "DebuggerFont", &fontDesc); if (!fontDesc.empty()) DebuggerFont.SetNativeFontInfoUserDesc(wxString::FromAscii(fontDesc.c_str())); // Decide what windows to use // This stuff really doesn't belong in CodeWindow anymore, does it? It should be // in Frame.cpp somewhere, even though it's debugger stuff. - showonstart.Get("Code", &bCodeWindow, true); - showonstart.Get("Registers", &bRegisterWindow, false); - showonstart.Get("Breakpoints", &bBreakpointWindow, false); - showonstart.Get("Memory", &bMemoryWindow, false); - showonstart.Get("JIT", &bJitWindow, false); - showonstart.Get("Sound", &bSoundWindow, false); - showonstart.Get("Video", &bVideoWindow, false); + ini.Get("ShowOnStart", "Code", &bCodeWindow, true); + ini.Get("ShowOnStart", "Registers", &bRegisterWindow, false); + ini.Get("ShowOnStart", "Breakpoints", &bBreakpointWindow, false); + ini.Get("ShowOnStart", "Memory", &bMemoryWindow, false); + ini.Get("ShowOnStart", "JIT", &bJitWindow, false); + ini.Get("ShowOnStart", "Sound", &bSoundWindow, false); + ini.Get("ShowOnStart", "Video", &bVideoWindow, false); // Get notebook affiliation - Section& section = ini[StringFromFormat("P - %s", + std::string _Section = StringFromFormat("P - %s", (Parent->ActivePerspective < Parent->Perspectives.size()) - ? Parent->Perspectives.at(Parent->ActivePerspective).Name.c_str() : "")]; - section.Get("Log", &iLogWindow, 1); - section.Get("Console", &iConsoleWindow, 1); - section.Get("Code", &iCodeWindow, 1); - section.Get("Registers", &iRegisterWindow, 1); - section.Get("Breakpoints", &iBreakpointWindow, 0); - section.Get("Memory", &iMemoryWindow, 1); - section.Get("JIT", &iJitWindow, 1); - section.Get("Sound", &iSoundWindow, 0); - section.Get("Video", &iVideoWindow, 0); + ? Parent->Perspectives.at(Parent->ActivePerspective).Name.c_str() : ""); + ini.Get(_Section.c_str(), "Log", &iLogWindow, 1); + ini.Get(_Section.c_str(), "Console", &iConsoleWindow, 1); + ini.Get(_Section.c_str(), "Code", &iCodeWindow, 1); + ini.Get(_Section.c_str(), "Registers", &iRegisterWindow, 1); + ini.Get(_Section.c_str(), "Breakpoints", &iBreakpointWindow, 0); + ini.Get(_Section.c_str(), "Memory", &iMemoryWindow, 1); + ini.Get(_Section.c_str(), "JIT", &iJitWindow, 1); + ini.Get(_Section.c_str(), "Sound", &iSoundWindow, 0); + ini.Get(_Section.c_str(), "Video", &iVideoWindow, 0); // Get floating setting - Section& flt = ini["Float"]; - flt.Get("Log", &Parent->bFloatLogWindow, false); - flt.Get("Console", &Parent->bFloatConsoleWindow, false); - flt.Get("Code", &bFloatCodeWindow, false); - flt.Get("Registers", &bFloatRegisterWindow, false); - flt.Get("Breakpoints", &bFloatBreakpointWindow, false); - flt.Get("Memory", &bFloatMemoryWindow, false); - flt.Get("JIT", &bFloatJitWindow, false); - flt.Get("Sound", &bFloatSoundWindow, false); - flt.Get("Video", &bFloatVideoWindow, false); + ini.Get("Float", "Log", &Parent->bFloatLogWindow, false); + ini.Get("Float", "Console", &Parent->bFloatConsoleWindow, false); + ini.Get("Float", "Code", &bFloatCodeWindow, false); + ini.Get("Float", "Registers", &bFloatRegisterWindow, false); + ini.Get("Float", "Breakpoints", &bFloatBreakpointWindow, false); + ini.Get("Float", "Memory", &bFloatMemoryWindow, false); + ini.Get("Float", "JIT", &bFloatJitWindow, false); + ini.Get("Float", "Sound", &bFloatSoundWindow, false); + ini.Get("Float", "Video", &bFloatVideoWindow, false); // Boot to pause or not - showonstart.Get("AutomaticStart", &bAutomaticStart, false); - showonstart.Get("BootToPause", &bBootToPause, true); + ini.Get("ShowOnStart", "AutomaticStart", &bAutomaticStart, false); + ini.Get("ShowOnStart", "BootToPause", &bBootToPause, true); } void CCodeWindow::Save() { IniFile ini; ini.Load(File::GetUserPath(F_DEBUGGERCONFIG_IDX)); - Section& showonstart = ini["ShowOnStart"]; - showonstart.Set("DebuggerFont", std::string(DebuggerFont.GetNativeFontInfoUserDesc().mb_str())); + ini.Set("ShowOnStart", "DebuggerFont", std::string(DebuggerFont.GetNativeFontInfoUserDesc().mb_str())); // Boot to pause or not - showonstart.Set("AutomaticStart", GetMenuBar()->IsChecked(IDM_AUTOMATICSTART)); - showonstart.Set("BootToPause", GetMenuBar()->IsChecked(IDM_BOOTTOPAUSE)); + ini.Set("ShowOnStart", "AutomaticStart", GetMenuBar()->IsChecked(IDM_AUTOMATICSTART)); + ini.Set("ShowOnStart", "BootToPause", GetMenuBar()->IsChecked(IDM_BOOTTOPAUSE)); // Save windows settings - //showonstart.Set("Code", GetMenuBar()->IsChecked(IDM_CODEWINDOW)); - showonstart.Set("Registers", GetMenuBar()->IsChecked(IDM_REGISTERWINDOW)); - showonstart.Set("Breakpoints", GetMenuBar()->IsChecked(IDM_BREAKPOINTWINDOW)); - showonstart.Set("Memory", GetMenuBar()->IsChecked(IDM_MEMORYWINDOW)); - showonstart.Set("JIT", GetMenuBar()->IsChecked(IDM_JITWINDOW)); - showonstart.Set("Sound", GetMenuBar()->IsChecked(IDM_SOUNDWINDOW)); - showonstart.Set("Video", GetMenuBar()->IsChecked(IDM_VIDEOWINDOW)); - Section& section = ini[StringFromFormat("P - %s", + //ini.Set("ShowOnStart", "Code", GetMenuBar()->IsChecked(IDM_CODEWINDOW)); + ini.Set("ShowOnStart", "Registers", GetMenuBar()->IsChecked(IDM_REGISTERWINDOW)); + ini.Set("ShowOnStart", "Breakpoints", GetMenuBar()->IsChecked(IDM_BREAKPOINTWINDOW)); + ini.Set("ShowOnStart", "Memory", GetMenuBar()->IsChecked(IDM_MEMORYWINDOW)); + ini.Set("ShowOnStart", "JIT", GetMenuBar()->IsChecked(IDM_JITWINDOW)); + ini.Set("ShowOnStart", "Sound", GetMenuBar()->IsChecked(IDM_SOUNDWINDOW)); + ini.Set("ShowOnStart", "Video", GetMenuBar()->IsChecked(IDM_VIDEOWINDOW)); + std::string _Section = StringFromFormat("P - %s", (Parent->ActivePerspective < Parent->Perspectives.size()) - ? Parent->Perspectives.at(Parent->ActivePerspective).Name.c_str() : "")]; - section.Set("Log", iLogWindow); - section.Set("Console", iConsoleWindow); - section.Set("Code", iCodeWindow); - section.Set("Registers", iRegisterWindow); - section.Set("Breakpoints", iBreakpointWindow); - section.Set("Memory", iMemoryWindow); - section.Set("JIT", iJitWindow); - section.Set("Sound", iSoundWindow); - section.Set("Video", iVideoWindow); + ? Parent->Perspectives.at(Parent->ActivePerspective).Name.c_str() : ""); + ini.Set(_Section.c_str(), "Log", iLogWindow); + ini.Set(_Section.c_str(), "Console", iConsoleWindow); + ini.Set(_Section.c_str(), "Code", iCodeWindow); + ini.Set(_Section.c_str(), "Registers", iRegisterWindow); + ini.Set(_Section.c_str(), "Breakpoints", iBreakpointWindow); + ini.Set(_Section.c_str(), "Memory", iMemoryWindow); + ini.Set(_Section.c_str(), "JIT", iJitWindow); + ini.Set(_Section.c_str(), "Sound", iSoundWindow); + ini.Set(_Section.c_str(), "Video", iVideoWindow); // Save floating setting - Section& flt = ini["Float"]; - flt.Set("Log", !!FindWindowById(IDM_LOGWINDOW_PARENT)); - flt.Set("Console", !!FindWindowById(IDM_CONSOLEWINDOW_PARENT)); - flt.Set("Code", !!FindWindowById(IDM_CODEWINDOW_PARENT)); - flt.Set("Registers", !!FindWindowById(IDM_REGISTERWINDOW_PARENT)); - flt.Set("Breakpoints", !!FindWindowById(IDM_BREAKPOINTWINDOW_PARENT)); - flt.Set("Memory", !!FindWindowById(IDM_MEMORYWINDOW_PARENT)); - flt.Set("JIT", !!FindWindowById(IDM_JITWINDOW_PARENT)); - flt.Set("Sound", !!FindWindowById(IDM_SOUNDWINDOW_PARENT)); - flt.Set("Video", !!FindWindowById(IDM_VIDEOWINDOW_PARENT)); + ini.Set("Float", "Log", !!FindWindowById(IDM_LOGWINDOW_PARENT)); + ini.Set("Float", "Console", !!FindWindowById(IDM_CONSOLEWINDOW_PARENT)); + ini.Set("Float", "Code", !!FindWindowById(IDM_CODEWINDOW_PARENT)); + ini.Set("Float", "Registers", !!FindWindowById(IDM_REGISTERWINDOW_PARENT)); + ini.Set("Float", "Breakpoints", !!FindWindowById(IDM_BREAKPOINTWINDOW_PARENT)); + ini.Set("Float", "Memory", !!FindWindowById(IDM_MEMORYWINDOW_PARENT)); + ini.Set("Float", "JIT", !!FindWindowById(IDM_JITWINDOW_PARENT)); + ini.Set("Float", "Sound", !!FindWindowById(IDM_SOUNDWINDOW_PARENT)); + ini.Set("Float", "Video", !!FindWindowById(IDM_VIDEOWINDOW_PARENT)); ini.Save(File::GetUserPath(F_DEBUGGERCONFIG_IDX)); } diff --git a/Source/Core/DebuggerWX/Src/MemoryWindow.cpp b/Source/Core/DebuggerWX/Src/MemoryWindow.cpp index d24701975a..61e0468fe0 100644 --- a/Source/Core/DebuggerWX/Src/MemoryWindow.cpp +++ b/Source/Core/DebuggerWX/Src/MemoryWindow.cpp @@ -129,23 +129,21 @@ void CMemoryWindow::Save(IniFile& _IniFile) const // Prevent these bad values that can happen after a crash or hanging if(GetPosition().x != -32000 && GetPosition().y != -32000) { - Section& memwin = _IniFile["MemoryWindow"]; - memwin.Set("x", GetPosition().x); - memwin.Set("y", GetPosition().y); - memwin.Set("w", GetSize().GetWidth()); - memwin.Set("h", GetSize().GetHeight()); + _IniFile.Set("MemoryWindow", "x", GetPosition().x); + _IniFile.Set("MemoryWindow", "y", GetPosition().y); + _IniFile.Set("MemoryWindow", "w", GetSize().GetWidth()); + _IniFile.Set("MemoryWindow", "h", GetSize().GetHeight()); } } void CMemoryWindow::Load(IniFile& _IniFile) { - int x, y, w, h; - Section& memwin = _IniFile["MemoryWindow"]; - memwin.Get("x", &x, GetPosition().x); - memwin.Get("y", &y, GetPosition().y); - memwin.Get("w", &w, GetSize().GetWidth()); - memwin.Get("h", &h, GetSize().GetHeight()); + int x,y,w,h; + _IniFile.Get("MemoryWindow", "x", &x, GetPosition().x); + _IniFile.Get("MemoryWindow", "y", &y, GetPosition().y); + _IniFile.Get("MemoryWindow", "w", &w, GetSize().GetWidth()); + _IniFile.Get("MemoryWindow", "h", &h, GetSize().GetHeight()); SetSize(x, y, w, h); } @@ -324,12 +322,12 @@ void CMemoryWindow::onSearch(wxCommandEvent& event) { //memview->cu wxString rawData=valbox->GetValue(); std::vector<u8> Dest;//May need a better name - size_t size=0; + u32 size=0; int pad=rawData.size()%2;//If it's uneven unsigned long i=0; long count=0; char copy[3]={0}; - size_t newsize=0; + long newsize=0; unsigned char *tmp2=0; char* tmpstr=0; switch (chkHex->GetValue()){ |
