Merge pull request #4131 from aldelaro5/memoryViewer-memChecks-improvements
Add the configuration of how a memory check is added via the memory window
This commit is contained in:
commit
4c004b6dc9
|
@ -28,7 +28,9 @@ public:
|
||||||
virtual void AddWatch(unsigned int /*address*/) {}
|
virtual void AddWatch(unsigned int /*address*/) {}
|
||||||
virtual void ClearAllMemChecks() {}
|
virtual void ClearAllMemChecks() {}
|
||||||
virtual bool IsMemCheck(unsigned int /*address*/) { return false; }
|
virtual bool IsMemCheck(unsigned int /*address*/) { return false; }
|
||||||
virtual void ToggleMemCheck(unsigned int /*address*/) {}
|
virtual void ToggleMemCheck(unsigned int /*address*/, bool /*read*/, bool /*write*/, bool /*log*/)
|
||||||
|
{
|
||||||
|
}
|
||||||
virtual unsigned int ReadMemory(unsigned int /*address*/) { return 0; }
|
virtual unsigned int ReadMemory(unsigned int /*address*/) { return 0; }
|
||||||
virtual void WriteExtraMemory(int /*memory*/, unsigned int /*value*/, unsigned int /*address*/) {}
|
virtual void WriteExtraMemory(int /*memory*/, unsigned int /*value*/, unsigned int /*address*/) {}
|
||||||
virtual unsigned int ReadExtraMemory(int /*memory*/, unsigned int /*address*/) { return 0; }
|
virtual unsigned int ReadExtraMemory(int /*memory*/, unsigned int /*address*/) { return 0; }
|
||||||
|
|
|
@ -140,7 +140,7 @@ bool PPCDebugInterface::IsMemCheck(unsigned int address)
|
||||||
return (PowerPC::memchecks.HasAny() && PowerPC::memchecks.GetMemCheck(address));
|
return (PowerPC::memchecks.HasAny() && PowerPC::memchecks.GetMemCheck(address));
|
||||||
}
|
}
|
||||||
|
|
||||||
void PPCDebugInterface::ToggleMemCheck(unsigned int address)
|
void PPCDebugInterface::ToggleMemCheck(unsigned int address, bool read, bool write, bool log)
|
||||||
{
|
{
|
||||||
if (PowerPC::memchecks.HasAny() && !PowerPC::memchecks.GetMemCheck(address))
|
if (PowerPC::memchecks.HasAny() && !PowerPC::memchecks.GetMemCheck(address))
|
||||||
{
|
{
|
||||||
|
@ -148,10 +148,10 @@ void PPCDebugInterface::ToggleMemCheck(unsigned int address)
|
||||||
TMemCheck MemCheck;
|
TMemCheck MemCheck;
|
||||||
MemCheck.StartAddress = address;
|
MemCheck.StartAddress = address;
|
||||||
MemCheck.EndAddress = address;
|
MemCheck.EndAddress = address;
|
||||||
MemCheck.OnRead = true;
|
MemCheck.OnRead = read;
|
||||||
MemCheck.OnWrite = true;
|
MemCheck.OnWrite = write;
|
||||||
|
|
||||||
MemCheck.Log = true;
|
MemCheck.Log = log;
|
||||||
MemCheck.Break = true;
|
MemCheck.Break = true;
|
||||||
|
|
||||||
PowerPC::memchecks.Add(MemCheck);
|
PowerPC::memchecks.Add(MemCheck);
|
||||||
|
|
|
@ -26,7 +26,8 @@ public:
|
||||||
void ToggleBreakpoint(unsigned int address) override;
|
void ToggleBreakpoint(unsigned int address) override;
|
||||||
void ClearAllMemChecks() override;
|
void ClearAllMemChecks() override;
|
||||||
bool IsMemCheck(unsigned int address) override;
|
bool IsMemCheck(unsigned int address) override;
|
||||||
void ToggleMemCheck(unsigned int address) override;
|
void ToggleMemCheck(unsigned int address, bool read = true, bool write = true,
|
||||||
|
bool log = true) override;
|
||||||
unsigned int ReadMemory(unsigned int address) override;
|
unsigned int ReadMemory(unsigned int address) override;
|
||||||
|
|
||||||
enum
|
enum
|
||||||
|
|
|
@ -132,7 +132,7 @@ void DSPDebugInterface::ClearAllMemChecks()
|
||||||
PanicAlert("MemCheck functionality not supported in DSP module.");
|
PanicAlert("MemCheck functionality not supported in DSP module.");
|
||||||
}
|
}
|
||||||
|
|
||||||
void DSPDebugInterface::ToggleMemCheck(unsigned int address)
|
void DSPDebugInterface::ToggleMemCheck(unsigned int address, bool read, bool write, bool log)
|
||||||
{
|
{
|
||||||
PanicAlert("MemCheck functionality not supported in DSP module.");
|
PanicAlert("MemCheck functionality not supported in DSP module.");
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,8 @@ public:
|
||||||
void ToggleBreakpoint(unsigned int address) override;
|
void ToggleBreakpoint(unsigned int address) override;
|
||||||
void ClearAllMemChecks() override;
|
void ClearAllMemChecks() override;
|
||||||
bool IsMemCheck(unsigned int address) override;
|
bool IsMemCheck(unsigned int address) override;
|
||||||
void ToggleMemCheck(unsigned int address) override;
|
void ToggleMemCheck(unsigned int address, bool read = true, bool write = true,
|
||||||
|
bool log = true) override;
|
||||||
unsigned int ReadMemory(unsigned int address) override;
|
unsigned int ReadMemory(unsigned int address) override;
|
||||||
unsigned int ReadInstruction(unsigned int address) override;
|
unsigned int ReadInstruction(unsigned int address) override;
|
||||||
unsigned int GetPC() override;
|
unsigned int GetPC() override;
|
||||||
|
|
|
@ -82,7 +82,7 @@ void CMemoryView::OnMouseDownL(wxMouseEvent& event)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
debugger->ToggleMemCheck(YToAddress(y));
|
debugger->ToggleMemCheck(YToAddress(y), memCheckRead, memCheckWrite, memCheckLog);
|
||||||
|
|
||||||
Refresh();
|
Refresh();
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,13 @@ public:
|
||||||
Refresh();
|
Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SetMemCheckOptions(bool read, bool write, bool log)
|
||||||
|
{
|
||||||
|
memCheckRead = read;
|
||||||
|
memCheckWrite = write;
|
||||||
|
memCheckLog = log;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void OnPaint(wxPaintEvent& event);
|
void OnPaint(wxPaintEvent& event);
|
||||||
void OnMouseDownL(wxMouseEvent& event);
|
void OnMouseDownL(wxMouseEvent& event);
|
||||||
|
@ -60,6 +67,10 @@ private:
|
||||||
int curAddress;
|
int curAddress;
|
||||||
MemoryDataType dataType;
|
MemoryDataType dataType;
|
||||||
|
|
||||||
|
bool memCheckRead;
|
||||||
|
bool memCheckWrite;
|
||||||
|
bool memCheckLog;
|
||||||
|
|
||||||
enum EViewAsType
|
enum EViewAsType
|
||||||
{
|
{
|
||||||
VIEWAS_ASCII = 0,
|
VIEWAS_ASCII = 0,
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include <wx/listbox.h>
|
#include <wx/listbox.h>
|
||||||
#include <wx/msgdlg.h>
|
#include <wx/msgdlg.h>
|
||||||
#include <wx/panel.h>
|
#include <wx/panel.h>
|
||||||
|
#include <wx/radiobut.h>
|
||||||
#include <wx/sizer.h>
|
#include <wx/sizer.h>
|
||||||
#include <wx/srchctrl.h>
|
#include <wx/srchctrl.h>
|
||||||
#include <wx/textctrl.h>
|
#include <wx/textctrl.h>
|
||||||
|
@ -47,7 +48,8 @@ enum
|
||||||
IDM_U32,
|
IDM_U32,
|
||||||
IDM_SEARCH,
|
IDM_SEARCH,
|
||||||
IDM_ASCII,
|
IDM_ASCII,
|
||||||
IDM_HEX
|
IDM_HEX,
|
||||||
|
IDM_MEMCHECK_OPTIONS_CHANGE
|
||||||
};
|
};
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(CMemoryWindow, wxPanel)
|
BEGIN_EVENT_TABLE(CMemoryWindow, wxPanel)
|
||||||
|
@ -63,6 +65,8 @@ EVT_CHECKBOX(IDM_U32, CMemoryWindow::U32)
|
||||||
EVT_BUTTON(IDM_SEARCH, CMemoryWindow::onSearch)
|
EVT_BUTTON(IDM_SEARCH, CMemoryWindow::onSearch)
|
||||||
EVT_CHECKBOX(IDM_ASCII, CMemoryWindow::onAscii)
|
EVT_CHECKBOX(IDM_ASCII, CMemoryWindow::onAscii)
|
||||||
EVT_CHECKBOX(IDM_HEX, CMemoryWindow::onHex)
|
EVT_CHECKBOX(IDM_HEX, CMemoryWindow::onHex)
|
||||||
|
EVT_RADIOBUTTON(IDM_MEMCHECK_OPTIONS_CHANGE, CMemoryWindow::onMemCheckOptionChange)
|
||||||
|
EVT_CHECKBOX(IDM_MEMCHECK_OPTIONS_CHANGE, CMemoryWindow::onMemCheckOptionChange)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
CMemoryWindow::CMemoryWindow(CCodeWindow* code_window, wxWindow* parent, wxWindowID id,
|
CMemoryWindow::CMemoryWindow(CCodeWindow* code_window, wxWindow* parent, wxWindowID id,
|
||||||
|
@ -104,12 +108,24 @@ CMemoryWindow::CMemoryWindow(CCodeWindow* code_window, wxWindow* parent, wxWindo
|
||||||
sizerDataTypes->Add(chk16 = new wxCheckBox(this, IDM_U16, "U16"));
|
sizerDataTypes->Add(chk16 = new wxCheckBox(this, IDM_U16, "U16"));
|
||||||
sizerDataTypes->Add(chk32 = new wxCheckBox(this, IDM_U32, "U32"));
|
sizerDataTypes->Add(chk32 = new wxCheckBox(this, IDM_U32, "U32"));
|
||||||
|
|
||||||
|
wxStaticBoxSizer* const sizerMemCheckOptions =
|
||||||
|
new wxStaticBoxSizer(wxVERTICAL, this, "Memory check options");
|
||||||
|
sizerMemCheckOptions->Add(rdbReadWrite = new wxRadioButton(this, IDM_MEMCHECK_OPTIONS_CHANGE,
|
||||||
|
"Read and Write", wxDefaultPosition,
|
||||||
|
wxDefaultSize, wxRB_GROUP));
|
||||||
|
sizerMemCheckOptions->Add(rdbRead =
|
||||||
|
new wxRadioButton(this, IDM_MEMCHECK_OPTIONS_CHANGE, "Read only"));
|
||||||
|
sizerMemCheckOptions->Add(rdbWrite =
|
||||||
|
new wxRadioButton(this, IDM_MEMCHECK_OPTIONS_CHANGE, "Write only"));
|
||||||
|
sizerMemCheckOptions->Add(chkLog = new wxCheckBox(this, IDM_MEMCHECK_OPTIONS_CHANGE, "Log"));
|
||||||
|
|
||||||
wxBoxSizer* const sizerRight = new wxBoxSizer(wxVERTICAL);
|
wxBoxSizer* const sizerRight = new wxBoxSizer(wxVERTICAL);
|
||||||
sizerRight->Add(search_sizer);
|
sizerRight->Add(search_sizer);
|
||||||
sizerRight->AddSpacer(5);
|
sizerRight->AddSpacer(5);
|
||||||
sizerRight->Add(dump_sizer);
|
sizerRight->Add(dump_sizer);
|
||||||
sizerRight->Add(sizerSearchType);
|
sizerRight->Add(sizerSearchType);
|
||||||
sizerRight->Add(sizerDataTypes);
|
sizerRight->Add(sizerDataTypes);
|
||||||
|
sizerRight->Add(sizerMemCheckOptions);
|
||||||
|
|
||||||
wxBoxSizer* const sizerBig = new wxBoxSizer(wxHORIZONTAL);
|
wxBoxSizer* const sizerBig = new wxBoxSizer(wxHORIZONTAL);
|
||||||
sizerBig->Add(memview, 20, wxEXPAND);
|
sizerBig->Add(memview, 20, wxEXPAND);
|
||||||
|
@ -118,6 +134,7 @@ CMemoryWindow::CMemoryWindow(CCodeWindow* code_window, wxWindow* parent, wxWindo
|
||||||
SetSizer(sizerBig);
|
SetSizer(sizerBig);
|
||||||
chkHex->SetValue(1); // Set defaults
|
chkHex->SetValue(1); // Set defaults
|
||||||
chk8->SetValue(1);
|
chk8->SetValue(1);
|
||||||
|
chkLog->SetValue(1);
|
||||||
|
|
||||||
sizerRight->Fit(this);
|
sizerRight->Fit(this);
|
||||||
sizerBig->Fit(this);
|
sizerBig->Fit(this);
|
||||||
|
@ -450,3 +467,11 @@ void CMemoryWindow::onHex(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
chkAscii->SetValue(0);
|
chkAscii->SetValue(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CMemoryWindow::onMemCheckOptionChange(wxCommandEvent& event)
|
||||||
|
{
|
||||||
|
if (rdbReadWrite->GetValue())
|
||||||
|
memview->SetMemCheckOptions(true, true, chkLog->GetValue());
|
||||||
|
else
|
||||||
|
memview->SetMemCheckOptions(rdbRead->GetValue(), rdbWrite->GetValue(), chkLog->GetValue());
|
||||||
|
}
|
||||||
|
|
|
@ -15,6 +15,7 @@ class wxCheckBox;
|
||||||
class wxListBox;
|
class wxListBox;
|
||||||
class wxSearchCtrl;
|
class wxSearchCtrl;
|
||||||
class wxTextCtrl;
|
class wxTextCtrl;
|
||||||
|
class wxRadioButton;
|
||||||
|
|
||||||
class CMemoryWindow : public wxPanel
|
class CMemoryWindow : public wxPanel
|
||||||
{
|
{
|
||||||
|
@ -48,6 +49,7 @@ private:
|
||||||
void OnDumpMemory(wxCommandEvent& event);
|
void OnDumpMemory(wxCommandEvent& event);
|
||||||
void OnDumpMem2(wxCommandEvent& event);
|
void OnDumpMem2(wxCommandEvent& event);
|
||||||
void OnDumpFakeVMEM(wxCommandEvent& event);
|
void OnDumpFakeVMEM(wxCommandEvent& event);
|
||||||
|
void onMemCheckOptionChange(wxCommandEvent& event);
|
||||||
|
|
||||||
wxCheckBox* chk8;
|
wxCheckBox* chk8;
|
||||||
wxCheckBox* chk16;
|
wxCheckBox* chk16;
|
||||||
|
@ -55,6 +57,10 @@ private:
|
||||||
wxButton* btnSearch;
|
wxButton* btnSearch;
|
||||||
wxCheckBox* chkAscii;
|
wxCheckBox* chkAscii;
|
||||||
wxCheckBox* chkHex;
|
wxCheckBox* chkHex;
|
||||||
|
wxCheckBox* chkLog;
|
||||||
|
wxRadioButton* rdbRead;
|
||||||
|
wxRadioButton* rdbWrite;
|
||||||
|
wxRadioButton* rdbReadWrite;
|
||||||
|
|
||||||
CCodeWindow* m_code_window;
|
CCodeWindow* m_code_window;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue