2015-05-24 04:55:12 +00:00
|
|
|
// Copyright 2009 Dolphin Emulator Project
|
2015-05-17 23:08:10 +00:00
|
|
|
// Licensed under GPLv2+
|
2013-04-18 03:43:35 +00:00
|
|
|
// Refer to the license.txt file included.
|
2009-02-23 06:15:48 +00:00
|
|
|
|
2014-02-22 22:36:30 +00:00
|
|
|
#include <cstddef>
|
|
|
|
#include <istream>
|
|
|
|
#include <string>
|
|
|
|
#include <utility>
|
|
|
|
#include <vector>
|
|
|
|
#include <wx/filedlg.h>
|
|
|
|
#include <wx/font.h>
|
|
|
|
#include <wx/fontdata.h>
|
2009-02-23 06:15:48 +00:00
|
|
|
#include <wx/fontdlg.h>
|
2014-02-22 22:36:30 +00:00
|
|
|
#include <wx/listbox.h>
|
|
|
|
#include <wx/menu.h>
|
2011-02-28 20:40:15 +00:00
|
|
|
#include <wx/mimetype.h>
|
2014-02-22 22:36:30 +00:00
|
|
|
#include <wx/textdlg.h>
|
2009-02-23 06:15:48 +00:00
|
|
|
|
2014-02-17 10:18:15 +00:00
|
|
|
#include "Common/CommonPaths.h"
|
2014-09-08 01:06:58 +00:00
|
|
|
#include "Common/CommonTypes.h"
|
2014-02-17 10:18:15 +00:00
|
|
|
#include "Common/FileUtil.h"
|
2014-02-22 22:36:30 +00:00
|
|
|
#include "Common/IniFile.h"
|
|
|
|
#include "Common/SymbolDB.h"
|
2009-02-23 06:15:48 +00:00
|
|
|
|
2014-02-17 10:18:15 +00:00
|
|
|
#include "Core/Core.h"
|
|
|
|
#include "Core/Host.h"
|
|
|
|
#include "Core/Boot/Boot.h"
|
2014-02-19 01:56:29 +00:00
|
|
|
#include "Core/HLE/HLE.h"
|
2014-02-17 10:18:15 +00:00
|
|
|
#include "Core/PowerPC/PowerPC.h"
|
|
|
|
#include "Core/PowerPC/PPCAnalyst.h"
|
|
|
|
#include "Core/PowerPC/PPCSymbolDB.h"
|
|
|
|
#include "Core/PowerPC/Profiler.h"
|
|
|
|
#include "Core/PowerPC/SignatureDB.h"
|
|
|
|
#include "Core/PowerPC/JitCommon/JitBase.h"
|
2009-02-23 06:15:48 +00:00
|
|
|
|
2014-02-22 22:36:30 +00:00
|
|
|
#include "DolphinWX/Frame.h"
|
|
|
|
#include "DolphinWX/Globals.h"
|
2014-02-17 10:18:15 +00:00
|
|
|
#include "DolphinWX/WxUtils.h"
|
|
|
|
#include "DolphinWX/Debugger/BreakpointWindow.h"
|
|
|
|
#include "DolphinWX/Debugger/CodeWindow.h"
|
|
|
|
#include "DolphinWX/Debugger/DebuggerPanel.h"
|
|
|
|
#include "DolphinWX/Debugger/DebuggerUIUtil.h"
|
|
|
|
#include "DolphinWX/Debugger/DSPDebugWindow.h"
|
|
|
|
#include "DolphinWX/Debugger/JitWindow.h"
|
|
|
|
#include "DolphinWX/Debugger/MemoryWindow.h"
|
|
|
|
#include "DolphinWX/Debugger/RegisterWindow.h"
|
2014-10-19 10:45:40 +00:00
|
|
|
#include "DolphinWX/Debugger/WatchWindow.h"
|
2009-02-23 06:15:48 +00:00
|
|
|
|
|
|
|
|
2009-09-03 06:54:46 +00:00
|
|
|
// Save and load settings
|
2009-09-08 16:07:13 +00:00
|
|
|
// -----------------------------
|
2009-09-03 06:54:46 +00:00
|
|
|
void CCodeWindow::Load()
|
|
|
|
{
|
|
|
|
IniFile ini;
|
2010-02-02 21:56:29 +00:00
|
|
|
ini.Load(File::GetUserPath(F_DEBUGGERCONFIG_IDX));
|
2009-09-03 06:54:46 +00:00
|
|
|
|
|
|
|
// The font to override DebuggerFont with
|
2010-07-26 03:46:14 +00:00
|
|
|
std::string fontDesc;
|
2014-06-16 05:12:43 +00:00
|
|
|
|
|
|
|
IniFile::Section* general = ini.GetOrCreateSection("General");
|
|
|
|
general->Get("DebuggerFont", &fontDesc);
|
|
|
|
general->Get("AutomaticStart", &bAutomaticStart, false);
|
|
|
|
general->Get("BootToPause", &bBootToPause, true);
|
|
|
|
|
2009-09-03 06:54:46 +00:00
|
|
|
if (!fontDesc.empty())
|
2013-02-28 08:39:06 +00:00
|
|
|
DebuggerFont.SetNativeFontInfoUserDesc(StrToWxStr(fontDesc));
|
2009-09-03 06:54:46 +00:00
|
|
|
|
2010-07-26 03:46:14 +00:00
|
|
|
const char* SettingName[] = {
|
|
|
|
"Log",
|
2011-02-21 15:01:00 +00:00
|
|
|
"LogConfig",
|
2010-07-26 03:46:14 +00:00
|
|
|
"Console",
|
|
|
|
"Registers",
|
|
|
|
"Breakpoints",
|
|
|
|
"Memory",
|
|
|
|
"JIT",
|
|
|
|
"Sound",
|
|
|
|
"Video",
|
|
|
|
"Code"
|
|
|
|
};
|
|
|
|
|
|
|
|
// Decide what windows to show
|
2014-12-21 01:36:26 +00:00
|
|
|
for (int i = 0; i <= IDM_VIDEO_WINDOW - IDM_LOG_WINDOW; i++)
|
2014-06-16 05:12:43 +00:00
|
|
|
ini.GetOrCreateSection("ShowOnStart")->Get(SettingName[i], &bShowOnStart[i], false);
|
2010-07-26 03:46:14 +00:00
|
|
|
|
2009-09-03 06:54:46 +00:00
|
|
|
// Get notebook affiliation
|
2014-06-16 05:12:43 +00:00
|
|
|
std::string section = "P - " +
|
2010-07-26 03:46:14 +00:00
|
|
|
((Parent->ActivePerspective < Parent->Perspectives.size())
|
2010-07-27 02:39:12 +00:00
|
|
|
? Parent->Perspectives[Parent->ActivePerspective].Name : "Perspective 1");
|
2009-09-03 06:54:46 +00:00
|
|
|
|
2014-12-21 01:36:26 +00:00
|
|
|
for (int i = 0; i <= IDM_CODE_WINDOW - IDM_LOG_WINDOW; i++)
|
2014-06-16 05:12:43 +00:00
|
|
|
ini.GetOrCreateSection(section)->Get(SettingName[i], &iNbAffiliation[i], 0);
|
2010-07-26 03:46:14 +00:00
|
|
|
|
|
|
|
// Get floating setting
|
2014-12-21 01:36:26 +00:00
|
|
|
for (int i = 0; i <= IDM_CODE_WINDOW - IDM_LOG_WINDOW; i++)
|
2014-06-16 05:12:43 +00:00
|
|
|
ini.GetOrCreateSection("Float")->Get(SettingName[i], &Parent->bFloatWindow[i], false);
|
2009-09-03 06:54:46 +00:00
|
|
|
}
|
2010-07-19 02:09:34 +00:00
|
|
|
|
2009-09-03 06:54:46 +00:00
|
|
|
void CCodeWindow::Save()
|
|
|
|
{
|
|
|
|
IniFile ini;
|
2010-02-02 21:56:29 +00:00
|
|
|
ini.Load(File::GetUserPath(F_DEBUGGERCONFIG_IDX));
|
2009-09-03 06:54:46 +00:00
|
|
|
|
2014-06-16 05:12:43 +00:00
|
|
|
IniFile::Section* general = ini.GetOrCreateSection("General");
|
|
|
|
general->Set("DebuggerFont", WxStrToStr(DebuggerFont.GetNativeFontInfoUserDesc()));
|
2014-12-21 01:36:26 +00:00
|
|
|
general->Set("AutomaticStart", GetMenuBar()->IsChecked(IDM_AUTOMATIC_START));
|
|
|
|
general->Set("BootToPause", GetMenuBar()->IsChecked(IDM_BOOT_TO_PAUSE));
|
2010-07-26 03:46:14 +00:00
|
|
|
|
|
|
|
const char* SettingName[] = {
|
|
|
|
"Log",
|
2011-02-21 15:01:00 +00:00
|
|
|
"LogConfig",
|
2010-07-26 03:46:14 +00:00
|
|
|
"Console",
|
|
|
|
"Registers",
|
|
|
|
"Breakpoints",
|
|
|
|
"Memory",
|
2013-10-29 05:23:17 +00:00
|
|
|
"JIT",
|
2010-07-26 03:46:14 +00:00
|
|
|
"Sound",
|
|
|
|
"Video",
|
|
|
|
"Code"
|
|
|
|
};
|
2009-09-03 06:54:46 +00:00
|
|
|
|
2010-07-19 02:09:34 +00:00
|
|
|
// Save windows settings
|
2014-12-21 01:36:26 +00:00
|
|
|
for (int i = IDM_LOG_WINDOW; i <= IDM_VIDEO_WINDOW; i++)
|
|
|
|
ini.GetOrCreateSection("ShowOnStart")->Set(SettingName[i - IDM_LOG_WINDOW], GetMenuBar()->IsChecked(i));
|
2010-07-26 03:46:14 +00:00
|
|
|
|
|
|
|
// Save notebook affiliations
|
2014-06-16 05:12:43 +00:00
|
|
|
std::string section = "P - " + Parent->Perspectives[Parent->ActivePerspective].Name;
|
2014-12-21 01:36:26 +00:00
|
|
|
for (int i = 0; i <= IDM_CODE_WINDOW - IDM_LOG_WINDOW; i++)
|
2014-06-16 05:12:43 +00:00
|
|
|
ini.GetOrCreateSection(section)->Set(SettingName[i], iNbAffiliation[i]);
|
2010-07-26 03:46:14 +00:00
|
|
|
|
2009-09-06 18:45:22 +00:00
|
|
|
// Save floating setting
|
2014-12-21 01:36:26 +00:00
|
|
|
for (int i = IDM_LOG_WINDOW_PARENT; i <= IDM_CODE_WINDOW_PARENT; i++)
|
|
|
|
ini.GetOrCreateSection("Float")->Set(SettingName[i - IDM_LOG_WINDOW_PARENT], !!FindWindowById(i));
|
2009-09-03 06:54:46 +00:00
|
|
|
|
2010-02-02 21:56:29 +00:00
|
|
|
ini.Save(File::GetUserPath(F_DEBUGGERCONFIG_IDX));
|
2009-09-03 06:54:46 +00:00
|
|
|
}
|
2009-09-02 21:00:45 +00:00
|
|
|
|
2009-08-27 16:08:43 +00:00
|
|
|
// Symbols, JIT, Profiler
|
2009-09-08 16:07:13 +00:00
|
|
|
// ----------------
|
2010-07-26 03:46:14 +00:00
|
|
|
void CCodeWindow::CreateMenuSymbols(wxMenuBar *pMenuBar)
|
2009-02-23 06:15:48 +00:00
|
|
|
{
|
|
|
|
wxMenu *pSymbolsMenu = new wxMenu;
|
2014-12-21 01:36:26 +00:00
|
|
|
pSymbolsMenu->Append(IDM_CLEAR_SYMBOLS, _("&Clear symbols"),
|
2014-12-14 22:17:36 +00:00
|
|
|
_("Remove names from all functions and variables."));
|
2014-12-21 01:36:26 +00:00
|
|
|
pSymbolsMenu->Append(IDM_SCAN_FUNCTIONS, _("&Generate symbol map"),
|
2014-12-14 22:17:36 +00:00
|
|
|
_("Recognise standard functions from sys\\totaldb.dsy, and use generic zz_ names for other functions."));
|
2009-02-23 06:15:48 +00:00
|
|
|
pSymbolsMenu->AppendSeparator();
|
2014-12-21 01:36:26 +00:00
|
|
|
pSymbolsMenu->Append(IDM_LOAD_MAP_FILE, _("&Load symbol map"),
|
2014-12-14 22:17:36 +00:00
|
|
|
_("Try to load this game's function names automatically - but doesn't check .map files stored on the disc image yet."));
|
|
|
|
pSymbolsMenu->Append(IDM_SAVEMAPFILE, _("&Save symbol map"),
|
|
|
|
_("Save the function names for each address to a .map file in your user settings map folder, named after the title id."));
|
2014-12-14 23:43:45 +00:00
|
|
|
pSymbolsMenu->AppendSeparator();
|
2014-12-21 01:36:26 +00:00
|
|
|
pSymbolsMenu->Append(IDM_LOAD_MAP_FILE_AS, _("Load &other map file..."),
|
2014-12-14 22:17:36 +00:00
|
|
|
_("Load any .map file containing the function names and addresses for this game."));
|
2014-12-21 01:36:26 +00:00
|
|
|
pSymbolsMenu->Append(IDM_LOAD_BAD_MAP_FILE, _("Load &bad map file..."),
|
2014-12-14 23:43:45 +00:00
|
|
|
_("Try to load a .map file that might be from a slightly different version."));
|
2014-12-21 01:36:26 +00:00
|
|
|
pSymbolsMenu->Append(IDM_SAVE_MAP_FILE_AS, _("Save symbol map &as..."),
|
2014-12-14 22:17:36 +00:00
|
|
|
_("Save the function names and addresses for this game as a .map file. If you want to open it in IDA pro, use the .idc script."));
|
2009-02-23 06:15:48 +00:00
|
|
|
pSymbolsMenu->AppendSeparator();
|
2014-12-21 01:36:26 +00:00
|
|
|
pSymbolsMenu->Append(IDM_SAVE_MAP_FILE_WITH_CODES, _("Save code"),
|
2014-05-17 17:17:28 +00:00
|
|
|
_("Save the entire disassembled code. This may take a several seconds"
|
2009-02-23 06:15:48 +00:00
|
|
|
" and may require between 50 and 100 MB of hard drive space. It will only save code"
|
|
|
|
" that are in the first 4 MB of memory, if you are debugging a game that load .rel"
|
|
|
|
" files with code to memory you may want to increase that to perhaps 8 MB, you can do"
|
|
|
|
" that from SymbolDB::SaveMap().")
|
|
|
|
);
|
|
|
|
|
|
|
|
pSymbolsMenu->AppendSeparator();
|
2014-12-21 01:36:26 +00:00
|
|
|
pSymbolsMenu->Append(IDM_CREATE_SIGNATURE_FILE, _("&Create signature file..."),
|
2014-12-14 22:17:36 +00:00
|
|
|
_("Create a .dsy file that can be used to recognise these same functions in other games."));
|
2014-12-21 01:36:26 +00:00
|
|
|
pSymbolsMenu->Append(IDM_APPEND_SIGNATURE_FILE, _("Append to &existing signature file..."),
|
2014-12-14 22:17:36 +00:00
|
|
|
_("Add any named functions missing from a .dsy file, so it can also recognise these additional functions in other games."));
|
2014-12-21 01:36:26 +00:00
|
|
|
pSymbolsMenu->Append(IDM_COMBINE_SIGNATURE_FILES, _("Combine two signature files..."),
|
2014-12-14 22:17:36 +00:00
|
|
|
_("Make a new .dsy file which can recognise more functions, by combining two existing files. The first input file has priority."));
|
2014-12-21 01:36:26 +00:00
|
|
|
pSymbolsMenu->Append(IDM_USE_SIGNATURE_FILE, _("Apply signat&ure file..."),
|
2014-12-14 22:17:36 +00:00
|
|
|
_("Must use Generate symbol map first! Recognise names of any standard library functions used in multiple games, by loading them from a .dsy file."));
|
2009-02-23 06:15:48 +00:00
|
|
|
pSymbolsMenu->AppendSeparator();
|
2014-12-21 01:36:26 +00:00
|
|
|
pSymbolsMenu->Append(IDM_PATCH_HLE_FUNCTIONS, _("&Patch HLE functions"));
|
2011-01-05 04:35:46 +00:00
|
|
|
pSymbolsMenu->Append(IDM_RENAME_SYMBOLS, _("&Rename symbols from file..."));
|
|
|
|
pMenuBar->Append(pSymbolsMenu, _("&Symbols"));
|
2009-02-23 06:15:48 +00:00
|
|
|
|
|
|
|
wxMenu *pProfilerMenu = new wxMenu;
|
2014-12-21 01:36:26 +00:00
|
|
|
pProfilerMenu->Append(IDM_PROFILE_BLOCKS, _("&Profile blocks"), wxEmptyString, wxITEM_CHECK);
|
2009-02-23 06:15:48 +00:00
|
|
|
pProfilerMenu->AppendSeparator();
|
2014-12-21 01:36:26 +00:00
|
|
|
pProfilerMenu->Append(IDM_WRITE_PROFILE, _("&Write to profile.txt, show"));
|
2011-01-05 04:35:46 +00:00
|
|
|
pMenuBar->Append(pProfilerMenu, _("&Profiler"));
|
2009-02-23 06:15:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CCodeWindow::OnProfilerMenu(wxCommandEvent& event)
|
|
|
|
{
|
|
|
|
switch (event.GetId())
|
|
|
|
{
|
2014-12-21 01:36:26 +00:00
|
|
|
case IDM_PROFILE_BLOCKS:
|
2012-03-10 05:24:13 +00:00
|
|
|
Core::SetState(Core::CORE_PAUSE);
|
2014-03-09 20:14:26 +00:00
|
|
|
if (jit != nullptr)
|
2012-03-10 05:24:13 +00:00
|
|
|
jit->ClearCache();
|
2014-12-21 01:36:26 +00:00
|
|
|
Profiler::g_ProfileBlocks = GetMenuBar()->IsChecked(IDM_PROFILE_BLOCKS);
|
2012-03-10 05:24:13 +00:00
|
|
|
Core::SetState(Core::CORE_RUN);
|
2009-02-23 06:15:48 +00:00
|
|
|
break;
|
2014-12-21 01:36:26 +00:00
|
|
|
case IDM_WRITE_PROFILE:
|
2012-03-10 05:24:13 +00:00
|
|
|
if (Core::GetState() == Core::CORE_RUN)
|
|
|
|
Core::SetState(Core::CORE_PAUSE);
|
2011-02-28 20:40:15 +00:00
|
|
|
|
2012-03-10 05:24:13 +00:00
|
|
|
if (Core::GetState() == Core::CORE_PAUSE && PowerPC::GetMode() == PowerPC::MODE_JIT)
|
|
|
|
{
|
2014-03-09 20:14:26 +00:00
|
|
|
if (jit != nullptr)
|
2011-02-28 20:40:15 +00:00
|
|
|
{
|
2012-03-10 05:24:13 +00:00
|
|
|
std::string filename = File::GetUserPath(D_DUMP_IDX) + "Debug/profiler.txt";
|
|
|
|
File::CreateFullPath(filename);
|
2014-03-12 19:33:41 +00:00
|
|
|
Profiler::WriteProfileResults(filename);
|
2012-03-10 05:24:13 +00:00
|
|
|
|
2014-03-09 20:14:26 +00:00
|
|
|
wxFileType* filetype = nullptr;
|
2014-05-17 17:17:28 +00:00
|
|
|
if (!(filetype = wxTheMimeTypesManager->GetFileTypeFromExtension("txt")))
|
2012-03-10 05:24:13 +00:00
|
|
|
{
|
|
|
|
// From extension failed, trying with MIME type now
|
2014-05-17 17:17:28 +00:00
|
|
|
if (!(filetype = wxTheMimeTypesManager->GetFileTypeFromMimeType("text/plain")))
|
2012-03-10 05:24:13 +00:00
|
|
|
// MIME type failed, aborting mission
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
wxString OpenCommand;
|
2013-03-03 02:34:53 +00:00
|
|
|
OpenCommand = filetype->GetOpenCommand(StrToWxStr(filename));
|
2014-03-10 11:30:55 +00:00
|
|
|
if (!OpenCommand.IsEmpty())
|
2012-03-10 05:24:13 +00:00
|
|
|
wxExecute(OpenCommand, wxEXEC_SYNC);
|
2011-02-28 20:40:15 +00:00
|
|
|
}
|
|
|
|
}
|
2009-02-23 06:15:48 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event)
|
|
|
|
{
|
2009-09-03 07:59:24 +00:00
|
|
|
Parent->ClearStatusBar();
|
|
|
|
|
2014-07-07 22:47:57 +00:00
|
|
|
if (!Core::IsRunning()) return;
|
2009-09-03 09:13:41 +00:00
|
|
|
|
2014-12-14 22:17:36 +00:00
|
|
|
std::string existing_map_file, writable_map_file, title_id_str;
|
2013-09-11 23:02:41 +00:00
|
|
|
bool map_exists = CBoot::FindMapFile(&existing_map_file,
|
2014-12-14 22:17:36 +00:00
|
|
|
&writable_map_file,
|
|
|
|
&title_id_str);
|
2009-02-23 06:15:48 +00:00
|
|
|
switch (event.GetId())
|
|
|
|
{
|
2014-12-21 01:36:26 +00:00
|
|
|
case IDM_CLEAR_SYMBOLS:
|
2014-05-17 17:17:28 +00:00
|
|
|
if (!AskYesNoT("Do you want to clear the list of symbol names?")) return;
|
2009-02-23 06:15:48 +00:00
|
|
|
g_symbolDB.Clear();
|
|
|
|
Host_NotifyMapLoaded();
|
|
|
|
break;
|
2014-12-21 01:36:26 +00:00
|
|
|
case IDM_SCAN_FUNCTIONS:
|
2009-02-23 06:15:48 +00:00
|
|
|
{
|
2009-10-11 16:17:08 +00:00
|
|
|
PPCAnalyst::FindFunctions(0x80000000, 0x81800000, &g_symbolDB);
|
2009-02-23 06:15:48 +00:00
|
|
|
SignatureDB db;
|
2014-03-12 19:33:41 +00:00
|
|
|
if (db.Load(File::GetSysDirectory() + TOTALDB))
|
2009-09-03 09:13:41 +00:00
|
|
|
{
|
2009-02-23 06:15:48 +00:00
|
|
|
db.Apply(&g_symbolDB);
|
2010-07-19 02:09:34 +00:00
|
|
|
Parent->StatusBarMessage("Generated symbol names from '%s'", TOTALDB);
|
2014-12-14 22:17:36 +00:00
|
|
|
db.List();
|
2009-09-03 09:13:41 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Parent->StatusBarMessage("'%s' not found, no symbol names generated", TOTALDB);
|
|
|
|
}
|
2009-02-23 06:15:48 +00:00
|
|
|
// HLE::PatchFunctions();
|
2009-09-03 09:13:41 +00:00
|
|
|
// Update GUI
|
2009-02-23 06:15:48 +00:00
|
|
|
NotifyMapLoaded();
|
|
|
|
break;
|
|
|
|
}
|
2014-12-21 01:36:26 +00:00
|
|
|
case IDM_LOAD_MAP_FILE:
|
2013-09-11 23:02:41 +00:00
|
|
|
if (!map_exists)
|
2009-02-23 06:15:48 +00:00
|
|
|
{
|
|
|
|
g_symbolDB.Clear();
|
2009-03-02 21:10:46 +00:00
|
|
|
PPCAnalyst::FindFunctions(0x81300000, 0x81800000, &g_symbolDB);
|
2009-02-23 06:15:48 +00:00
|
|
|
SignatureDB db;
|
2014-03-12 19:33:41 +00:00
|
|
|
if (db.Load(File::GetSysDirectory() + TOTALDB))
|
2009-02-23 06:15:48 +00:00
|
|
|
db.Apply(&g_symbolDB);
|
2013-09-11 23:02:41 +00:00
|
|
|
Parent->StatusBarMessage("'%s' not found, scanning for common functions instead", writable_map_file.c_str());
|
2009-09-03 07:59:24 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-03-12 19:33:41 +00:00
|
|
|
g_symbolDB.LoadMap(existing_map_file);
|
2013-09-11 23:02:41 +00:00
|
|
|
Parent->StatusBarMessage("Loaded symbols from '%s'", existing_map_file.c_str());
|
2009-02-23 06:15:48 +00:00
|
|
|
}
|
2010-07-19 02:09:34 +00:00
|
|
|
HLE::PatchFunctions();
|
2009-02-23 06:15:48 +00:00
|
|
|
NotifyMapLoaded();
|
|
|
|
break;
|
2014-12-21 01:36:26 +00:00
|
|
|
case IDM_LOAD_MAP_FILE_AS:
|
2014-12-14 22:17:36 +00:00
|
|
|
{
|
|
|
|
const wxString path = wxFileSelector(
|
|
|
|
_("Load map file"), File::GetUserPath(D_MAPS_IDX),
|
|
|
|
title_id_str + ".map", ".map",
|
|
|
|
"Dolphin Map File (*.map)|*.map|All files (*.*)|*.*",
|
|
|
|
wxFD_OPEN | wxFD_FILE_MUST_EXIST, this);
|
|
|
|
|
|
|
|
if (!path.IsEmpty())
|
|
|
|
{
|
|
|
|
g_symbolDB.LoadMap(WxStrToStr(path));
|
2014-12-15 01:04:18 +00:00
|
|
|
Parent->StatusBarMessage("Loaded symbols from '%s'", WxStrToStr(path).c_str());
|
2014-12-14 22:17:36 +00:00
|
|
|
}
|
|
|
|
HLE::PatchFunctions();
|
|
|
|
NotifyMapLoaded();
|
|
|
|
}
|
|
|
|
break;
|
2014-12-21 01:36:26 +00:00
|
|
|
case IDM_LOAD_BAD_MAP_FILE:
|
2014-12-14 23:43:45 +00:00
|
|
|
{
|
|
|
|
const wxString path = wxFileSelector(
|
|
|
|
_("Load bad map file"), File::GetUserPath(D_MAPS_IDX),
|
|
|
|
title_id_str + ".map", ".map",
|
|
|
|
"Dolphin Map File (*.map)|*.map|All files (*.*)|*.*",
|
|
|
|
wxFD_OPEN | wxFD_FILE_MUST_EXIST, this);
|
|
|
|
|
|
|
|
if (!path.IsEmpty())
|
|
|
|
{
|
2014-12-15 08:12:07 +00:00
|
|
|
g_symbolDB.LoadMap(WxStrToStr(path), true);
|
2014-12-15 01:04:18 +00:00
|
|
|
Parent->StatusBarMessage("Loaded symbols from '%s'", WxStrToStr(path).c_str());
|
2014-12-14 23:43:45 +00:00
|
|
|
}
|
|
|
|
HLE::PatchFunctions();
|
|
|
|
NotifyMapLoaded();
|
|
|
|
}
|
|
|
|
break;
|
2009-02-23 06:15:48 +00:00
|
|
|
case IDM_SAVEMAPFILE:
|
2014-03-12 19:33:41 +00:00
|
|
|
g_symbolDB.SaveMap(writable_map_file);
|
2009-02-23 06:15:48 +00:00
|
|
|
break;
|
2014-12-21 01:36:26 +00:00
|
|
|
case IDM_SAVE_MAP_FILE_AS:
|
2014-12-14 22:17:36 +00:00
|
|
|
{
|
|
|
|
const wxString path = wxFileSelector(
|
|
|
|
_("Save map file as"), File::GetUserPath(D_MAPS_IDX),
|
|
|
|
title_id_str + ".map", ".map",
|
|
|
|
"Dolphin Map File (*.map)|*.map|All files (*.*)|*.*",
|
|
|
|
wxFD_SAVE | wxFD_OVERWRITE_PROMPT, this);
|
|
|
|
|
|
|
|
if (!path.IsEmpty())
|
|
|
|
g_symbolDB.SaveMap(WxStrToStr(path));
|
|
|
|
}
|
|
|
|
break;
|
2014-12-21 01:36:26 +00:00
|
|
|
case IDM_SAVE_MAP_FILE_WITH_CODES:
|
2014-03-12 19:33:41 +00:00
|
|
|
g_symbolDB.SaveMap(writable_map_file, true);
|
2009-02-23 06:15:48 +00:00
|
|
|
break;
|
2009-03-02 21:10:46 +00:00
|
|
|
|
2010-07-19 02:09:34 +00:00
|
|
|
case IDM_RENAME_SYMBOLS:
|
|
|
|
{
|
2011-03-11 10:21:46 +00:00
|
|
|
const wxString path = wxFileSelector(
|
2011-01-05 04:35:46 +00:00
|
|
|
_("Apply signature file"), wxEmptyString,
|
2010-07-23 23:50:09 +00:00
|
|
|
wxEmptyString, wxEmptyString,
|
2014-05-17 17:17:28 +00:00
|
|
|
"Dolphin Symbol Rename File (*.sym)|*.sym",
|
2010-07-23 23:50:09 +00:00
|
|
|
wxFD_OPEN | wxFD_FILE_MUST_EXIST, this);
|
2011-03-11 10:21:46 +00:00
|
|
|
|
|
|
|
if (!path.IsEmpty())
|
2010-07-19 02:09:34 +00:00
|
|
|
{
|
2013-03-01 01:33:39 +00:00
|
|
|
std::ifstream f;
|
|
|
|
OpenFStream(f, WxStrToStr(path), std::ios_base::in);
|
2010-07-19 02:09:34 +00:00
|
|
|
|
2011-03-11 10:21:46 +00:00
|
|
|
std::string line;
|
|
|
|
while (std::getline(f, line))
|
2010-07-19 02:09:34 +00:00
|
|
|
{
|
2011-03-11 10:21:46 +00:00
|
|
|
if (line.length() < 12)
|
2010-07-19 02:09:34 +00:00
|
|
|
continue;
|
|
|
|
|
|
|
|
u32 address, type;
|
2011-03-11 10:21:46 +00:00
|
|
|
std::string name;
|
|
|
|
|
|
|
|
std::istringstream ss(line);
|
|
|
|
ss >> std::hex >> address >> std::dec >> type >> name;
|
2010-07-19 02:09:34 +00:00
|
|
|
|
|
|
|
Symbol *symbol = g_symbolDB.GetSymbolFromAddr(address);
|
2011-03-11 10:21:46 +00:00
|
|
|
if (symbol)
|
|
|
|
symbol->name = line.substr(12);
|
2010-07-19 02:09:34 +00:00
|
|
|
}
|
2011-03-11 10:21:46 +00:00
|
|
|
|
2010-07-19 02:09:34 +00:00
|
|
|
Host_NotifyMapLoaded();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
2009-03-02 21:10:46 +00:00
|
|
|
|
2014-12-21 01:36:26 +00:00
|
|
|
case IDM_CREATE_SIGNATURE_FILE:
|
2009-02-23 06:15:48 +00:00
|
|
|
{
|
2009-11-18 21:11:05 +00:00
|
|
|
wxTextEntryDialog input_prefix(
|
|
|
|
this,
|
2014-05-17 17:17:28 +00:00
|
|
|
_("Only export symbols with prefix:\n(Blank for all symbols)"),
|
2009-11-18 21:11:05 +00:00
|
|
|
wxGetTextFromUserPromptStr,
|
|
|
|
wxEmptyString);
|
2009-02-23 06:15:48 +00:00
|
|
|
|
2009-11-18 21:11:05 +00:00
|
|
|
if (input_prefix.ShowModal() == wxID_OK)
|
|
|
|
{
|
2013-02-28 04:37:38 +00:00
|
|
|
std::string prefix(WxStrToStr(input_prefix.GetValue()));
|
2009-11-18 21:11:05 +00:00
|
|
|
|
|
|
|
wxString path = wxFileSelector(
|
2014-12-14 22:17:36 +00:00
|
|
|
_("Save signature as"), File::GetSysDirectory(), wxEmptyString, wxEmptyString,
|
|
|
|
"Dolphin Signature File (*.dsy)|*.dsy;", wxFD_SAVE | wxFD_OVERWRITE_PROMPT,
|
|
|
|
this);
|
|
|
|
if (!path.IsEmpty())
|
|
|
|
{
|
|
|
|
SignatureDB db;
|
|
|
|
db.Initialize(&g_symbolDB, prefix);
|
|
|
|
db.Save(WxStrToStr(path));
|
|
|
|
db.List();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
2014-12-21 01:36:26 +00:00
|
|
|
case IDM_APPEND_SIGNATURE_FILE:
|
2014-12-14 22:17:36 +00:00
|
|
|
{
|
|
|
|
wxTextEntryDialog input_prefix(
|
|
|
|
this,
|
|
|
|
_("Only export symbols with prefix:\n(Blank for all symbols)"),
|
|
|
|
wxGetTextFromUserPromptStr,
|
|
|
|
wxEmptyString);
|
|
|
|
|
|
|
|
if (input_prefix.ShowModal() == wxID_OK)
|
|
|
|
{
|
|
|
|
std::string prefix(WxStrToStr(input_prefix.GetValue()));
|
|
|
|
|
|
|
|
wxString path = wxFileSelector(
|
|
|
|
_("Append signature to"), File::GetSysDirectory(), wxEmptyString, wxEmptyString,
|
2014-05-17 17:17:28 +00:00
|
|
|
"Dolphin Signature File (*.dsy)|*.dsy;", wxFD_SAVE,
|
2009-02-23 06:15:48 +00:00
|
|
|
this);
|
2009-11-18 21:11:05 +00:00
|
|
|
if (!path.IsEmpty())
|
|
|
|
{
|
|
|
|
SignatureDB db;
|
2014-03-12 19:33:41 +00:00
|
|
|
db.Initialize(&g_symbolDB, prefix);
|
2014-12-14 22:17:36 +00:00
|
|
|
db.List();
|
|
|
|
db.Load(WxStrToStr(path));
|
2014-03-12 19:33:41 +00:00
|
|
|
db.Save(WxStrToStr(path));
|
2014-12-14 22:17:36 +00:00
|
|
|
db.List();
|
2009-11-18 21:11:05 +00:00
|
|
|
}
|
2009-02-23 06:15:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
2014-12-21 01:36:26 +00:00
|
|
|
case IDM_USE_SIGNATURE_FILE:
|
2009-02-23 06:15:48 +00:00
|
|
|
{
|
2009-11-18 21:11:05 +00:00
|
|
|
wxString path = wxFileSelector(
|
2014-12-14 22:17:36 +00:00
|
|
|
_("Apply signature file"), File::GetSysDirectory(), wxEmptyString, wxEmptyString,
|
2014-05-17 17:17:28 +00:00
|
|
|
"Dolphin Signature File (*.dsy)|*.dsy;", wxFD_OPEN | wxFD_FILE_MUST_EXIST,
|
2009-02-23 06:15:48 +00:00
|
|
|
this);
|
2009-11-18 21:11:05 +00:00
|
|
|
if (!path.IsEmpty())
|
|
|
|
{
|
|
|
|
SignatureDB db;
|
2014-03-12 19:33:41 +00:00
|
|
|
db.Load(WxStrToStr(path));
|
2009-11-18 21:11:05 +00:00
|
|
|
db.Apply(&g_symbolDB);
|
2014-12-14 22:17:36 +00:00
|
|
|
db.List();
|
|
|
|
NotifyMapLoaded();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
2014-12-21 01:36:26 +00:00
|
|
|
case IDM_COMBINE_SIGNATURE_FILES:
|
2014-12-14 22:17:36 +00:00
|
|
|
{
|
|
|
|
wxString path1 = wxFileSelector(
|
|
|
|
_("Choose priority input file"), File::GetSysDirectory(), wxEmptyString, wxEmptyString,
|
|
|
|
"Dolphin Signature File (*.dsy)|*.dsy;", wxFD_OPEN | wxFD_FILE_MUST_EXIST,
|
|
|
|
this);
|
|
|
|
if (!path1.IsEmpty())
|
|
|
|
{
|
|
|
|
SignatureDB db;
|
|
|
|
wxString path2 = wxFileSelector(
|
|
|
|
_("Choose secondary input file"), File::GetSysDirectory(), wxEmptyString, wxEmptyString,
|
|
|
|
"Dolphin Signature File (*.dsy)|*.dsy;", wxFD_OPEN | wxFD_FILE_MUST_EXIST,
|
|
|
|
this);
|
|
|
|
if (!path2.IsEmpty())
|
|
|
|
{
|
|
|
|
db.Load(WxStrToStr(path2));
|
|
|
|
db.Load(WxStrToStr(path1));
|
|
|
|
|
|
|
|
path2 = wxFileSelector(
|
|
|
|
_("Save combined output file as"), File::GetSysDirectory(), wxEmptyString, ".dsy",
|
|
|
|
"Dolphin Signature File (*.dsy)|*.dsy;", wxFD_SAVE | wxFD_OVERWRITE_PROMPT,
|
|
|
|
this);
|
|
|
|
db.Save(WxStrToStr(path2));
|
|
|
|
db.List();
|
|
|
|
}
|
2009-11-18 21:11:05 +00:00
|
|
|
}
|
2009-02-23 06:15:48 +00:00
|
|
|
}
|
|
|
|
break;
|
2014-12-21 01:36:26 +00:00
|
|
|
case IDM_PATCH_HLE_FUNCTIONS:
|
2009-02-23 06:15:48 +00:00
|
|
|
HLE::PatchFunctions();
|
|
|
|
Update();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void CCodeWindow::NotifyMapLoaded()
|
|
|
|
{
|
2009-09-07 12:40:43 +00:00
|
|
|
if (!codeview) return;
|
|
|
|
|
2009-02-23 06:15:48 +00:00
|
|
|
g_symbolDB.FillInCallers();
|
|
|
|
//symbols->Show(false); // hide it for faster filling
|
2014-02-17 04:51:41 +00:00
|
|
|
symbols->Freeze(); // HyperIris: wx style fast filling
|
2009-02-23 06:15:48 +00:00
|
|
|
symbols->Clear();
|
2014-02-12 15:00:34 +00:00
|
|
|
for (const auto& symbol : g_symbolDB.Symbols())
|
2009-02-23 06:15:48 +00:00
|
|
|
{
|
2014-02-12 15:00:34 +00:00
|
|
|
int idx = symbols->Append(StrToWxStr(symbol.second.name));
|
|
|
|
symbols->SetClientData(idx, (void*)&symbol.second);
|
2009-02-23 06:15:48 +00:00
|
|
|
}
|
|
|
|
symbols->Thaw();
|
|
|
|
//symbols->Show(true);
|
|
|
|
Update();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CCodeWindow::OnSymbolListChange(wxCommandEvent& event)
|
|
|
|
{
|
|
|
|
int index = symbols->GetSelection();
|
2014-08-30 21:01:19 +00:00
|
|
|
if (index >= 0)
|
|
|
|
{
|
2009-02-23 06:15:48 +00:00
|
|
|
Symbol* pSymbol = static_cast<Symbol *>(symbols->GetClientData(index));
|
2014-03-09 20:14:26 +00:00
|
|
|
if (pSymbol != nullptr)
|
2009-02-23 06:15:48 +00:00
|
|
|
{
|
2014-03-10 11:30:55 +00:00
|
|
|
if (pSymbol->type == Symbol::SYMBOL_DATA)
|
2009-02-23 06:15:48 +00:00
|
|
|
{
|
2014-03-10 11:30:55 +00:00
|
|
|
if (m_MemoryWindow)// && m_MemoryWindow->IsVisible())
|
2009-02-23 06:15:48 +00:00
|
|
|
m_MemoryWindow->JumpToAddress(pSymbol->address);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
JumpToAddress(pSymbol->address);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void CCodeWindow::OnSymbolListContextMenu(wxContextMenuEvent& event)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2009-08-26 09:19:15 +00:00
|
|
|
// Change the global DebuggerFont
|
|
|
|
void CCodeWindow::OnChangeFont(wxCommandEvent& event)
|
|
|
|
{
|
|
|
|
wxFontData data;
|
2010-07-26 03:46:14 +00:00
|
|
|
data.SetInitialFont(DebuggerFont);
|
2009-08-26 09:19:15 +00:00
|
|
|
|
|
|
|
wxFontDialog dialog(this, data);
|
|
|
|
if ( dialog.ShowModal() == wxID_OK )
|
|
|
|
DebuggerFont = dialog.GetFontData().GetChosenFont();
|
|
|
|
}
|
|
|
|
|
2013-04-19 13:21:45 +00:00
|
|
|
// Toggle windows
|
2009-08-31 05:56:30 +00:00
|
|
|
|
2009-08-27 01:30:08 +00:00
|
|
|
void CCodeWindow::OpenPages()
|
2010-07-19 02:09:34 +00:00
|
|
|
{
|
|
|
|
ToggleCodeWindow(true);
|
2010-07-26 03:46:14 +00:00
|
|
|
if (bShowOnStart[0])
|
|
|
|
Parent->ToggleLogWindow(true);
|
2014-12-21 01:36:26 +00:00
|
|
|
if (bShowOnStart[IDM_LOG_CONFIG_WINDOW - IDM_LOG_WINDOW])
|
2011-02-21 15:01:00 +00:00
|
|
|
Parent->ToggleLogConfigWindow(true);
|
2014-12-21 01:36:26 +00:00
|
|
|
if (bShowOnStart[IDM_REGISTER_WINDOW - IDM_LOG_WINDOW])
|
2010-07-19 02:09:34 +00:00
|
|
|
ToggleRegisterWindow(true);
|
2014-12-21 01:36:26 +00:00
|
|
|
if (bShowOnStart[IDM_WATCH_WINDOW - IDM_LOG_WINDOW])
|
2014-10-19 10:45:40 +00:00
|
|
|
ToggleWatchWindow(true);
|
2014-12-21 01:36:26 +00:00
|
|
|
if (bShowOnStart[IDM_BREAKPOINT_WINDOW - IDM_LOG_WINDOW])
|
2010-07-19 02:09:34 +00:00
|
|
|
ToggleBreakPointWindow(true);
|
2014-12-21 01:36:26 +00:00
|
|
|
if (bShowOnStart[IDM_MEMORY_WINDOW - IDM_LOG_WINDOW])
|
2010-07-19 02:09:34 +00:00
|
|
|
ToggleMemoryWindow(true);
|
2014-12-21 01:36:26 +00:00
|
|
|
if (bShowOnStart[IDM_JIT_WINDOW - IDM_LOG_WINDOW])
|
2010-07-19 02:09:34 +00:00
|
|
|
ToggleJitWindow(true);
|
2014-12-21 01:36:26 +00:00
|
|
|
if (bShowOnStart[IDM_SOUND_WINDOW - IDM_LOG_WINDOW])
|
2011-01-30 17:04:12 +00:00
|
|
|
ToggleSoundWindow(true);
|
2014-12-21 01:36:26 +00:00
|
|
|
if (bShowOnStart[IDM_VIDEO_WINDOW - IDM_LOG_WINDOW])
|
2011-01-31 02:39:25 +00:00
|
|
|
ToggleVideoWindow(true);
|
2009-08-27 01:30:08 +00:00
|
|
|
}
|
2010-07-19 02:09:34 +00:00
|
|
|
|
|
|
|
void CCodeWindow::ToggleCodeWindow(bool bShow)
|
2009-08-30 19:44:42 +00:00
|
|
|
{
|
2010-07-19 02:09:34 +00:00
|
|
|
if (bShow)
|
2010-07-26 03:46:14 +00:00
|
|
|
Parent->DoAddPage(this,
|
2014-12-21 01:36:26 +00:00
|
|
|
iNbAffiliation[IDM_CODE_WINDOW - IDM_LOG_WINDOW],
|
|
|
|
Parent->bFloatWindow[IDM_CODE_WINDOW - IDM_LOG_WINDOW]);
|
2010-07-24 02:36:22 +00:00
|
|
|
else // Hide
|
2010-07-19 02:09:34 +00:00
|
|
|
Parent->DoRemovePage(this);
|
2009-08-30 19:44:42 +00:00
|
|
|
}
|
2010-07-19 02:09:34 +00:00
|
|
|
|
|
|
|
void CCodeWindow::ToggleRegisterWindow(bool bShow)
|
2009-08-26 09:19:15 +00:00
|
|
|
{
|
2014-12-21 01:36:26 +00:00
|
|
|
GetMenuBar()->FindItem(IDM_REGISTER_WINDOW)->Check(bShow);
|
2010-07-19 02:09:34 +00:00
|
|
|
if (bShow)
|
2009-02-23 06:15:48 +00:00
|
|
|
{
|
2010-07-19 02:09:34 +00:00
|
|
|
if (!m_RegisterWindow)
|
2014-12-21 01:36:26 +00:00
|
|
|
m_RegisterWindow = new CRegisterWindow(Parent, IDM_REGISTER_WINDOW);
|
2010-07-26 03:46:14 +00:00
|
|
|
Parent->DoAddPage(m_RegisterWindow,
|
2014-12-21 01:36:26 +00:00
|
|
|
iNbAffiliation[IDM_REGISTER_WINDOW - IDM_LOG_WINDOW],
|
|
|
|
Parent->bFloatWindow[IDM_REGISTER_WINDOW - IDM_LOG_WINDOW]);
|
2009-02-23 06:15:48 +00:00
|
|
|
}
|
2010-07-24 02:36:22 +00:00
|
|
|
else // Close
|
2010-07-26 03:46:14 +00:00
|
|
|
{
|
2010-07-24 02:36:22 +00:00
|
|
|
Parent->DoRemovePage(m_RegisterWindow, false);
|
2014-03-09 20:14:26 +00:00
|
|
|
m_RegisterWindow = nullptr;
|
2010-07-26 03:46:14 +00:00
|
|
|
}
|
2009-02-23 06:15:48 +00:00
|
|
|
}
|
|
|
|
|
2014-10-19 10:45:40 +00:00
|
|
|
void CCodeWindow::ToggleWatchWindow(bool bShow)
|
|
|
|
{
|
2014-12-21 01:36:26 +00:00
|
|
|
GetMenuBar()->FindItem(IDM_WATCH_WINDOW)->Check(bShow);
|
2014-10-19 10:45:40 +00:00
|
|
|
if (bShow)
|
|
|
|
{
|
|
|
|
if (!m_WatchWindow)
|
2014-12-21 01:36:26 +00:00
|
|
|
m_WatchWindow = new CWatchWindow(Parent, IDM_WATCH_WINDOW);
|
2014-10-19 10:45:40 +00:00
|
|
|
Parent->DoAddPage(m_WatchWindow,
|
2014-12-21 01:36:26 +00:00
|
|
|
iNbAffiliation[IDM_WATCH_WINDOW - IDM_LOG_WINDOW],
|
|
|
|
Parent->bFloatWindow[IDM_WATCH_WINDOW - IDM_LOG_WINDOW]);
|
2014-10-19 10:45:40 +00:00
|
|
|
}
|
|
|
|
else // Close
|
|
|
|
{
|
|
|
|
Parent->DoRemovePage(m_WatchWindow, false);
|
|
|
|
m_WatchWindow = nullptr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-07-19 02:09:34 +00:00
|
|
|
void CCodeWindow::ToggleBreakPointWindow(bool bShow)
|
2009-02-23 06:15:48 +00:00
|
|
|
{
|
2014-12-21 01:36:26 +00:00
|
|
|
GetMenuBar()->FindItem(IDM_BREAKPOINT_WINDOW)->Check(bShow);
|
2010-07-19 02:09:34 +00:00
|
|
|
if (bShow)
|
2009-02-23 06:15:48 +00:00
|
|
|
{
|
2010-07-19 02:09:34 +00:00
|
|
|
if (!m_BreakpointWindow)
|
2014-12-21 01:36:26 +00:00
|
|
|
m_BreakpointWindow = new CBreakPointWindow(this, Parent, IDM_BREAKPOINT_WINDOW);
|
2010-07-26 03:46:14 +00:00
|
|
|
Parent->DoAddPage(m_BreakpointWindow,
|
2014-12-21 01:36:26 +00:00
|
|
|
iNbAffiliation[IDM_BREAKPOINT_WINDOW - IDM_LOG_WINDOW],
|
|
|
|
Parent->bFloatWindow[IDM_BREAKPOINT_WINDOW - IDM_LOG_WINDOW]);
|
2009-02-23 06:15:48 +00:00
|
|
|
}
|
2010-07-24 02:36:22 +00:00
|
|
|
else // Close
|
2010-07-26 03:46:14 +00:00
|
|
|
{
|
2010-07-24 02:36:22 +00:00
|
|
|
Parent->DoRemovePage(m_BreakpointWindow, false);
|
2014-03-09 20:14:26 +00:00
|
|
|
m_BreakpointWindow = nullptr;
|
2010-07-26 03:46:14 +00:00
|
|
|
}
|
2009-02-23 06:15:48 +00:00
|
|
|
}
|
|
|
|
|
2010-07-19 02:09:34 +00:00
|
|
|
void CCodeWindow::ToggleMemoryWindow(bool bShow)
|
2009-02-23 06:15:48 +00:00
|
|
|
{
|
2014-12-21 01:36:26 +00:00
|
|
|
GetMenuBar()->FindItem(IDM_MEMORY_WINDOW)->Check(bShow);
|
2010-07-19 02:09:34 +00:00
|
|
|
if (bShow)
|
2009-02-23 06:15:48 +00:00
|
|
|
{
|
2010-07-19 02:09:34 +00:00
|
|
|
if (!m_MemoryWindow)
|
2014-12-21 01:36:26 +00:00
|
|
|
m_MemoryWindow = new CMemoryWindow(Parent, IDM_MEMORY_WINDOW);
|
2010-07-26 03:46:14 +00:00
|
|
|
Parent->DoAddPage(m_MemoryWindow,
|
2014-12-21 01:36:26 +00:00
|
|
|
iNbAffiliation[IDM_MEMORY_WINDOW - IDM_LOG_WINDOW],
|
|
|
|
Parent->bFloatWindow[IDM_MEMORY_WINDOW - IDM_LOG_WINDOW]);
|
2009-02-23 06:15:48 +00:00
|
|
|
}
|
2010-07-24 02:36:22 +00:00
|
|
|
else // Close
|
2010-07-26 03:46:14 +00:00
|
|
|
{
|
2010-07-24 02:36:22 +00:00
|
|
|
Parent->DoRemovePage(m_MemoryWindow, false);
|
2014-03-09 20:14:26 +00:00
|
|
|
m_MemoryWindow = nullptr;
|
2010-07-26 03:46:14 +00:00
|
|
|
}
|
2009-02-23 06:15:48 +00:00
|
|
|
}
|
|
|
|
|
2010-07-19 02:09:34 +00:00
|
|
|
void CCodeWindow::ToggleJitWindow(bool bShow)
|
2009-02-23 06:15:48 +00:00
|
|
|
{
|
2014-12-21 01:36:26 +00:00
|
|
|
GetMenuBar()->FindItem(IDM_JIT_WINDOW)->Check(bShow);
|
2010-07-19 02:09:34 +00:00
|
|
|
if (bShow)
|
2009-02-23 06:15:48 +00:00
|
|
|
{
|
2010-07-19 02:09:34 +00:00
|
|
|
if (!m_JitWindow)
|
2014-12-21 01:36:26 +00:00
|
|
|
m_JitWindow = new CJitWindow(Parent, IDM_JIT_WINDOW);
|
2010-07-26 03:46:14 +00:00
|
|
|
Parent->DoAddPage(m_JitWindow,
|
2014-12-21 01:36:26 +00:00
|
|
|
iNbAffiliation[IDM_JIT_WINDOW - IDM_LOG_WINDOW],
|
|
|
|
Parent->bFloatWindow[IDM_JIT_WINDOW - IDM_LOG_WINDOW]);
|
2009-02-23 06:15:48 +00:00
|
|
|
}
|
2010-07-24 02:36:22 +00:00
|
|
|
else // Close
|
2010-07-26 03:46:14 +00:00
|
|
|
{
|
2010-07-24 02:36:22 +00:00
|
|
|
Parent->DoRemovePage(m_JitWindow, false);
|
2014-03-09 20:14:26 +00:00
|
|
|
m_JitWindow = nullptr;
|
2010-07-26 03:46:14 +00:00
|
|
|
}
|
2009-02-23 06:15:48 +00:00
|
|
|
}
|
|
|
|
|
2011-01-28 18:39:30 +00:00
|
|
|
|
|
|
|
void CCodeWindow::ToggleSoundWindow(bool bShow)
|
|
|
|
{
|
2014-12-21 01:36:26 +00:00
|
|
|
GetMenuBar()->FindItem(IDM_SOUND_WINDOW)->Check(bShow);
|
2011-01-28 18:39:30 +00:00
|
|
|
if (bShow)
|
|
|
|
{
|
2011-01-30 17:04:12 +00:00
|
|
|
if (!m_SoundWindow)
|
2014-12-21 01:36:26 +00:00
|
|
|
m_SoundWindow = new DSPDebuggerLLE(Parent, IDM_SOUND_WINDOW);
|
2011-01-30 17:04:12 +00:00
|
|
|
Parent->DoAddPage(m_SoundWindow,
|
2014-12-21 01:36:26 +00:00
|
|
|
iNbAffiliation[IDM_SOUND_WINDOW - IDM_LOG_WINDOW],
|
|
|
|
Parent->bFloatWindow[IDM_SOUND_WINDOW - IDM_LOG_WINDOW]);
|
2011-01-28 18:39:30 +00:00
|
|
|
}
|
|
|
|
else // Close
|
|
|
|
{
|
2011-01-30 17:04:12 +00:00
|
|
|
Parent->DoRemovePage(m_SoundWindow, false);
|
2014-03-09 20:14:26 +00:00
|
|
|
m_SoundWindow = nullptr;
|
2011-01-28 18:39:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-01-31 02:39:25 +00:00
|
|
|
void CCodeWindow::ToggleVideoWindow(bool bShow)
|
2009-08-26 09:19:15 +00:00
|
|
|
{
|
2014-12-21 01:36:26 +00:00
|
|
|
GetMenuBar()->FindItem(IDM_VIDEO_WINDOW)->Check(bShow);
|
2010-07-19 02:09:34 +00:00
|
|
|
if (bShow)
|
|
|
|
{
|
2011-01-31 02:39:25 +00:00
|
|
|
if (!m_VideoWindow)
|
2014-12-21 01:36:26 +00:00
|
|
|
m_VideoWindow = new GFXDebuggerPanel(Parent, IDM_VIDEO_WINDOW);
|
2011-01-31 02:39:25 +00:00
|
|
|
Parent->DoAddPage(m_VideoWindow,
|
2014-12-21 01:36:26 +00:00
|
|
|
iNbAffiliation[IDM_VIDEO_WINDOW - IDM_LOG_WINDOW],
|
|
|
|
Parent->bFloatWindow[IDM_VIDEO_WINDOW - IDM_LOG_WINDOW]);
|
2009-08-26 09:19:15 +00:00
|
|
|
}
|
2011-01-31 02:39:25 +00:00
|
|
|
else // Close
|
2010-07-19 02:09:34 +00:00
|
|
|
{
|
2011-01-31 02:39:25 +00:00
|
|
|
Parent->DoRemovePage(m_VideoWindow, false);
|
2014-03-09 20:14:26 +00:00
|
|
|
m_VideoWindow = nullptr;
|
2009-09-07 12:40:43 +00:00
|
|
|
}
|
2009-09-07 20:51:02 +00:00
|
|
|
}
|