From 832df18c0f2069f6cb5a4ffe2e62413a651ed70b Mon Sep 17 00:00:00 2001 From: Shawn Hoffman Date: Fri, 25 Feb 2011 11:03:49 +0000 Subject: [PATCH] more memcheck stuff git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7242 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Common/Src/BreakPoints.cpp | 8 +++--- .../DolphinWX/Src/Debugger/BreakpointView.cpp | 6 ++--- .../DolphinWX/Src/Debugger/MemoryCheckDlg.cpp | 25 +++++++++++++------ .../DolphinWX/Src/Debugger/MemoryCheckDlg.h | 4 ++- 4 files changed, 27 insertions(+), 16 deletions(-) diff --git a/Source/Core/Common/Src/BreakPoints.cpp b/Source/Core/Common/Src/BreakPoints.cpp index aa68d2ebca..8ecde13965 100644 --- a/Source/Core/Common/Src/BreakPoints.cpp +++ b/Source/Core/Common/Src/BreakPoints.cpp @@ -179,10 +179,10 @@ void TMemCheck::Action(DebugInterface *debug_interface, u32 iValue, u32 addr, { if (Log) { - INFO_LOG(MEMMAP, "CHK %08x %s%i %08x at %08x (%s)", - debug_interface->getPC(), - write ? "Write" : "Read", size*8, iValue, addr, // address - debug_interface->getDescription(addr).c_str() // symbol map description + INFO_LOG(MEMMAP, "CHK %08x (%s) %s%i %0*x at %08x (%s)", + pc, debug_interface->getDescription(pc).c_str(), + write ? "Write" : "Read", size*8, size*2, iValue, addr, + debug_interface->getDescription(addr).c_str() ); } if (Break) diff --git a/Source/Core/DolphinWX/Src/Debugger/BreakpointView.cpp b/Source/Core/DolphinWX/Src/Debugger/BreakpointView.cpp index 9f1663aad3..6ea2fe478b 100644 --- a/Source/Core/DolphinWX/Src/Debugger/BreakpointView.cpp +++ b/Source/Core/DolphinWX/Src/Debugger/BreakpointView.cpp @@ -72,7 +72,7 @@ void CBreakPointView::Update() SetItem(Item, 2, temp); } - sprintf(szBuffer, "0x%08x", rBP.iAddress); + sprintf(szBuffer, "%08x", rBP.iAddress); temp = wxString::FromAscii(szBuffer); SetItem(Item, 3, temp); @@ -86,7 +86,7 @@ void CBreakPointView::Update() const TMemCheck& rMemCheck = rMemChecks[i]; wxString temp; - temp = wxString::FromAscii(rMemCheck.Break ? "on" : " "); + temp = wxString::FromAscii((rMemCheck.Break || rMemCheck.Log) ? "on" : " "); int Item = InsertItem(0, temp); temp = wxString::FromAscii("MC"); SetItem(Item, 1, temp); @@ -98,7 +98,7 @@ void CBreakPointView::Update() SetItem(Item, 2, temp); } - sprintf(szBuffer, "0x%08x to 0%08x", rMemCheck.StartAddress, rMemCheck.EndAddress); + sprintf(szBuffer, "%08x to %08x", rMemCheck.StartAddress, rMemCheck.EndAddress); temp = wxString::FromAscii(szBuffer); SetItem(Item, 3, temp); diff --git a/Source/Core/DolphinWX/Src/Debugger/MemoryCheckDlg.cpp b/Source/Core/DolphinWX/Src/Debugger/MemoryCheckDlg.cpp index 79643b5b41..847c66e1b7 100644 --- a/Source/Core/DolphinWX/Src/Debugger/MemoryCheckDlg.cpp +++ b/Source/Core/DolphinWX/Src/Debugger/MemoryCheckDlg.cpp @@ -51,10 +51,12 @@ void MemoryCheckDlg::CreateGUIControls() m_pReadFlag = new wxCheckBox(this, ID_READ_FLAG, _("Read"), wxPoint(336,33), wxSize(57,15), 0, wxDefaultValidator, _("Read")); m_pWriteFlag = new wxCheckBox(this, ID_WRITE_FLAG, _("Write"), wxPoint(336,16), wxSize(57,17), 0, wxDefaultValidator, wxT("WxCheckBox1")); + m_pWriteFlag->SetValue(true); + m_log_flag = new wxCheckBox(this, ID_LOG_FLAG, _("Log"), wxPoint(420,16), wxSize(57,17), 0, wxDefaultValidator, wxT("WxCheckBox2")); + m_log_flag->SetValue(true); + m_break_flag = new wxCheckBox(this, ID_BREAK_FLAG, _("Break"), wxPoint(420,33), wxSize(57,15), 0, wxDefaultValidator, wxT("WxCheckBox2")); - m_log_flag = new wxCheckBox(this, ID_LOG_FLAG, _("Log"), wxPoint(420,33), wxSize(57,13), 0, wxDefaultValidator, wxT("WxCheckBox2")); - - new wxStaticBox(this, ID_WXSTATICBOX2, _("Break On"), wxPoint(328,0), wxSize(73,57)); + new wxStaticBox(this, ID_WXSTATICBOX2, _("Action"), wxPoint(328,0), wxSize(73,57)); new wxStaticText(this, ID_WXSTATICTEXT2, _("End"), wxPoint(168,24), wxDefaultSize, 0, wxT("WxStaticText2")); @@ -78,21 +80,28 @@ void MemoryCheckDlg::OnOK(wxCommandEvent& /*event*/) wxString EndAddressString = m_pEditEndAddress->GetLineText(0); bool OnRead = m_pReadFlag->GetValue(); bool OnWrite = m_pWriteFlag->GetValue(); - bool OnLog = m_log_flag->GetValue(); + bool Log = m_log_flag->GetValue(); + bool Break = m_break_flag->GetValue();; u32 StartAddress, EndAddress; + bool EndAddressOK = EndAddressString.Len() && + AsciiToHex(EndAddressString.mb_str(), EndAddress); + if (AsciiToHex(StartAddressString.mb_str(), StartAddress) && - AsciiToHex(EndAddressString.mb_str(), EndAddress)) + (OnRead || OnWrite) && (Log || Break)) { TMemCheck MemCheck; + + if (!EndAddressOK) + EndAddress = StartAddress; + MemCheck.StartAddress = StartAddress; MemCheck.EndAddress = EndAddress; MemCheck.bRange = StartAddress != EndAddress; MemCheck.OnRead = OnRead; MemCheck.OnWrite = OnWrite; - - MemCheck.Log = OnLog; - MemCheck.Break = OnRead || OnWrite; + MemCheck.Log = Log; + MemCheck.Break = Break; PowerPC::memchecks.Add(MemCheck); Host_UpdateBreakPointView(); diff --git a/Source/Core/DolphinWX/Src/Debugger/MemoryCheckDlg.h b/Source/Core/DolphinWX/Src/Debugger/MemoryCheckDlg.h index bf595bd0e8..1c0384c482 100644 --- a/Source/Core/DolphinWX/Src/Debugger/MemoryCheckDlg.h +++ b/Source/Core/DolphinWX/Src/Debugger/MemoryCheckDlg.h @@ -45,6 +45,7 @@ class MemoryCheckDlg : public wxDialog wxCheckBox* m_pReadFlag; wxCheckBox* m_pWriteFlag; wxCheckBox* m_log_flag; + wxCheckBox* m_break_flag; wxTextCtrl* m_pEditEndAddress; wxTextCtrl* m_pEditStartAddress; @@ -52,6 +53,8 @@ class MemoryCheckDlg : public wxDialog enum { + ID_BREAK_FLAG = 1018, + ID_LOG_FLAG = 1017, ID_CANCEL = 1016, ID_OK = 1015, ID_READ_FLAG = 1014, @@ -62,7 +65,6 @@ class MemoryCheckDlg : public wxDialog ID_WXSTATICTEXT1 = 1009, ID_EDIT_START_ADDR = 1008, ID_WXSTATICBOX1 = 1007, - ID_LOG_FLAG = 1007, }; private: