2016-01-27 09:11:59 +00:00
|
|
|
/****************************************************************************
|
|
|
|
* *
|
|
|
|
* Project64 - A Nintendo 64 emulator. *
|
|
|
|
* http://www.pj64-emu.com/ *
|
|
|
|
* Copyright (C) 2012 Project64. All rights reserved. *
|
|
|
|
* *
|
|
|
|
* License: *
|
|
|
|
* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html *
|
|
|
|
* *
|
|
|
|
****************************************************************************/
|
|
|
|
#pragma once
|
2018-01-10 07:05:57 +00:00
|
|
|
#include <Project64-core/Debugger.h>
|
2018-01-16 21:26:54 +00:00
|
|
|
#include <Common/SyncEvent.h>
|
2018-01-15 21:14:15 +00:00
|
|
|
#include <Project64-core/Settings/DebugSettings.h>
|
2019-11-30 17:48:46 +00:00
|
|
|
#include "DebugMMU.h"
|
2016-01-27 09:11:59 +00:00
|
|
|
|
|
|
|
class CDumpMemory;
|
|
|
|
class CDebugMemoryView;
|
|
|
|
class CDebugMemorySearch;
|
|
|
|
class CDebugTlb;
|
2017-08-18 05:08:22 +00:00
|
|
|
class CDebugCommandsView;
|
|
|
|
class CDebugScripts;
|
|
|
|
class CDebugSymbols;
|
|
|
|
class CDebugDMALogView;
|
2019-01-14 09:18:43 +00:00
|
|
|
class CDebugCPULogView;
|
2017-08-18 05:08:22 +00:00
|
|
|
class CDebugStackView;
|
|
|
|
class CDebugStackTrace;
|
2019-01-17 09:34:24 +00:00
|
|
|
class CDebugExcBreakpoints;
|
2017-08-18 05:08:22 +00:00
|
|
|
|
2019-01-14 09:18:43 +00:00
|
|
|
class CCPULog;
|
2017-08-18 05:08:22 +00:00
|
|
|
class CDMALog;
|
|
|
|
class CBreakpoints;
|
|
|
|
class CScriptSystem;
|
2016-01-27 09:11:59 +00:00
|
|
|
|
|
|
|
class CDebuggerUI :
|
2018-01-15 21:14:15 +00:00
|
|
|
public CDebugger,
|
2019-11-30 17:48:46 +00:00
|
|
|
public CDebugSettings,
|
|
|
|
public CDebugMMU
|
2016-01-27 09:11:59 +00:00
|
|
|
{
|
2018-01-10 07:05:57 +00:00
|
|
|
public:
|
|
|
|
CDebuggerUI();
|
|
|
|
~CDebuggerUI();
|
|
|
|
|
2016-01-27 09:11:59 +00:00
|
|
|
public:
|
2017-09-13 10:36:03 +00:00
|
|
|
void Debug_Reset(void);
|
2018-01-10 07:05:57 +00:00
|
|
|
void OpenMemoryDump(void);
|
|
|
|
void OpenMemoryWindow(void);
|
2017-09-13 10:36:03 +00:00
|
|
|
void Debug_ShowMemoryLocation(uint32_t Address, bool VAddr);
|
2018-01-10 07:05:57 +00:00
|
|
|
void OpenMemorySearch(void);
|
|
|
|
void OpenTLBWindow(void);
|
2017-09-13 10:36:03 +00:00
|
|
|
void Debug_RefreshTLBWindow(void);
|
2018-01-10 07:05:57 +00:00
|
|
|
void OpenCommandWindow(void);
|
2017-09-13 10:36:03 +00:00
|
|
|
void Debug_ShowCommandsLocation(uint32_t address, bool top);
|
2018-01-10 07:05:57 +00:00
|
|
|
void OpenScriptsWindow(void);
|
2017-09-13 10:36:03 +00:00
|
|
|
void Debug_LogScriptsWindow(const char* text);
|
|
|
|
void Debug_ClearScriptsWindow(void);
|
|
|
|
void Debug_RefreshScriptsWindow(void);
|
|
|
|
void Debug_RefreshSymbolsWindow(void);
|
2018-01-10 07:05:57 +00:00
|
|
|
void OpenSymbolsWindow(void);
|
|
|
|
void OpenStackTraceWindow(void);
|
|
|
|
void OpenStackViewWindow(void);
|
2017-09-13 10:36:03 +00:00
|
|
|
void Debug_RefreshStackWindow(void);
|
|
|
|
void Debug_RefreshStackTraceWindow(void);
|
2018-01-10 07:05:57 +00:00
|
|
|
void OpenDMALogWindow(void);
|
2019-04-02 18:28:46 +00:00
|
|
|
void Debug_RefreshDMALogWindow(void);
|
2019-01-14 09:18:43 +00:00
|
|
|
void OpenCPULogWindow(void);
|
|
|
|
void Debug_RefreshCPULogWindow(void);
|
2019-01-17 09:34:24 +00:00
|
|
|
void OpenExcBreakpointsWindow(void);
|
2017-08-18 05:08:22 +00:00
|
|
|
|
2018-01-16 21:26:54 +00:00
|
|
|
bool ExecutionBP(uint32_t address);
|
2018-02-05 20:25:53 +00:00
|
|
|
bool ReadBP8(uint32_t address);
|
|
|
|
bool ReadBP16(uint32_t address);
|
|
|
|
bool ReadBP32(uint32_t address);
|
|
|
|
bool ReadBP64(uint32_t address);
|
2018-02-01 17:28:08 +00:00
|
|
|
bool WriteBP8(uint32_t address);
|
|
|
|
bool WriteBP16(uint32_t address);
|
|
|
|
bool WriteBP32(uint32_t address);
|
|
|
|
bool WriteBP64(uint32_t address);
|
2018-01-16 21:26:54 +00:00
|
|
|
void WaitForStep(void);
|
|
|
|
|
2017-09-13 10:36:03 +00:00
|
|
|
CBreakpoints* Breakpoints();
|
|
|
|
CDebugSymbols* Symbols();
|
|
|
|
CScriptSystem* ScriptSystem();
|
|
|
|
CDebugScripts* ScriptConsole();
|
|
|
|
CDMALog* DMALog();
|
2019-01-14 09:18:43 +00:00
|
|
|
CCPULog* CPULog();
|
2017-08-18 05:08:22 +00:00
|
|
|
|
2017-09-13 10:36:03 +00:00
|
|
|
static void GameReset(CDebuggerUI * _this);
|
2019-04-03 18:56:45 +00:00
|
|
|
static void GameCpuRunningChanged(CDebuggerUI * _this);
|
|
|
|
static void GameNameChanged(CDebuggerUI * _this);
|
2018-01-18 12:25:36 +00:00
|
|
|
static void SteppingOpsChanged(CDebuggerUI * _this);
|
2018-01-18 06:53:07 +00:00
|
|
|
|
2019-11-30 17:48:46 +00:00
|
|
|
//bool DebugLW_PAddr(uint32_t vaddr, uint32_t& value);
|
|
|
|
//bool DebugLW_VAddr(uint32_t vaddr, uint32_t& value);
|
2018-12-09 04:26:11 +00:00
|
|
|
|
2018-01-18 06:53:07 +00:00
|
|
|
protected:
|
|
|
|
void TLBChanged(void);
|
|
|
|
void CPUStepStarted(void);
|
|
|
|
void CPUStep(void);
|
2019-01-17 09:34:24 +00:00
|
|
|
void CPUStepEnded(void);
|
2018-01-18 06:53:07 +00:00
|
|
|
void FrameDrawn(void);
|
|
|
|
|
|
|
|
private:
|
2019-01-14 09:18:43 +00:00
|
|
|
CDebuggerUI(const CDebuggerUI&); // Disable copy constructor
|
|
|
|
CDebuggerUI& operator=(const CDebuggerUI&); // Disable assignment
|
2018-01-18 06:53:07 +00:00
|
|
|
|
2019-04-29 06:28:12 +00:00
|
|
|
CRITICAL_SECTION m_CriticalSection;
|
2019-01-17 09:34:24 +00:00
|
|
|
CDumpMemory * m_MemoryDump;
|
|
|
|
CDebugMemoryView * m_MemoryView;
|
|
|
|
CDebugMemorySearch * m_MemorySearch;
|
|
|
|
CDebugTlb * m_DebugTLB;
|
|
|
|
CDebugCommandsView * m_CommandsView;
|
|
|
|
CDebugScripts * m_Scripts;
|
|
|
|
CDebugSymbols * m_Symbols;
|
|
|
|
CDebugDMALogView * m_DMALogView;
|
|
|
|
CDebugCPULogView * m_CPULogView;
|
|
|
|
CDebugStackTrace * m_StackTrace;
|
|
|
|
CDebugStackView * m_StackView;
|
|
|
|
CDebugExcBreakpoints * m_ExcBreakpoints;
|
2018-01-18 06:53:07 +00:00
|
|
|
|
|
|
|
CBreakpoints * m_Breakpoints;
|
|
|
|
CScriptSystem * m_ScriptSystem;
|
|
|
|
CDMALog * m_DMALog;
|
2019-01-14 09:18:43 +00:00
|
|
|
CCPULog * m_CPULog;
|
2018-01-18 06:53:07 +00:00
|
|
|
|
|
|
|
SyncEvent m_StepEvent;
|
|
|
|
|
2019-01-14 09:18:43 +00:00
|
|
|
void HandleCPUException(void);
|
|
|
|
void HandleCartToRamDMA(void);
|
2016-01-27 09:11:59 +00:00
|
|
|
};
|