more memcheck stuff

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7242 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Shawn Hoffman 2011-02-25 11:03:49 +00:00
parent 1ea4b8045e
commit 832df18c0f
4 changed files with 27 additions and 16 deletions

View File

@ -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)

View File

@ -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);

View File

@ -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();

View File

@ -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: