2017-08-18 05:08:22 +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 *
|
|
|
|
* *
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include "stdafx.h"
|
|
|
|
|
|
|
|
#include "DebuggerUI.h"
|
|
|
|
|
2019-12-25 00:41:20 +00:00
|
|
|
LRESULT CAddBreakpointDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
|
2017-08-18 05:08:22 +00:00
|
|
|
{
|
2018-01-08 07:20:56 +00:00
|
|
|
CenterWindow();
|
|
|
|
m_AddressEdit.Attach(GetDlgItem(IDC_ADDR_EDIT));
|
|
|
|
m_ReadCheck.Attach(GetDlgItem(IDC_CHK_READ));
|
|
|
|
m_WriteCheck.Attach(GetDlgItem(IDC_CHK_WRITE));
|
|
|
|
m_ExecuteCheck.Attach(GetDlgItem(IDC_CHK_EXEC));
|
|
|
|
return FALSE;
|
2017-08-18 05:08:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
LRESULT CAddBreakpointDlg::OnClicked(WORD /*wNotifyCode*/, WORD wID, HWND, BOOL& /*bHandled*/)
|
|
|
|
{
|
2018-01-08 07:20:56 +00:00
|
|
|
switch (wID)
|
|
|
|
{
|
|
|
|
case IDOK:
|
|
|
|
{
|
|
|
|
char addrStr[9];
|
|
|
|
m_AddressEdit.GetWindowTextA(addrStr, 9);
|
|
|
|
uint32_t address = strtoul(addrStr, NULL, 16);
|
2017-08-18 05:08:22 +00:00
|
|
|
|
2018-01-08 07:20:56 +00:00
|
|
|
CBreakpoints* breakpoints = m_Debugger->Breakpoints();
|
|
|
|
|
|
|
|
if (m_ReadCheck.GetCheck())
|
|
|
|
{
|
|
|
|
breakpoints->RBPAdd(address);
|
|
|
|
}
|
|
|
|
if (m_WriteCheck.GetCheck())
|
|
|
|
{
|
|
|
|
breakpoints->WBPAdd(address);
|
|
|
|
}
|
|
|
|
if (m_ExecuteCheck.GetCheck())
|
|
|
|
{
|
|
|
|
breakpoints->AddExecution(address);
|
|
|
|
}
|
|
|
|
EndDialog(0);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case IDCANCEL:
|
|
|
|
EndDialog(0);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return FALSE;
|
2017-08-18 05:08:22 +00:00
|
|
|
}
|