[Deugger] Remove CDebugCommandsView::OnClicked

This commit is contained in:
zilmar 2017-12-12 21:14:49 +11:00
parent 44172b5936
commit f6dc66ce69
2 changed files with 207 additions and 107 deletions

View File

@ -726,6 +726,10 @@ LRESULT CDebugCommandsView::OnCustomDrawList(NMHDR* pNMHDR)
{
g_MMU->LW_VAddr(pc, pcOpcode.Hex);
}
else
{
pcOpcode.Hex = 0;
}
if (nSubItem == CCommandList::COL_ARROWS)
{
@ -1104,103 +1108,158 @@ void CDebugCommandsView::CPUResume()
ShowAddress(m_StartAddress, TRUE);
}
LRESULT CDebugCommandsView::OnClicked(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
LRESULT CDebugCommandsView::OnBackButton(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hwnd*/, BOOL& /*bHandled*/)
{
switch (wID)
{
case IDC_BACK_BTN:
if (m_HistoryIndex > 0)
{
m_HistoryIndex--;
m_AddressEdit.SetValue(m_History[m_HistoryIndex], false, true);
ToggleHistoryButtons();
}
break;
case IDC_FORWARD_BTN:
return FALSE;
}
LRESULT CDebugCommandsView::OnForwardButton(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hwnd*/, BOOL& /*bHandled*/)
{
if (m_History.size() > 0 && m_HistoryIndex < (int)m_History.size() - 1)
{
m_HistoryIndex++;
m_AddressEdit.SetValue(m_History[m_HistoryIndex], false, true);
ToggleHistoryButtons();
}
break;
case IDC_VIEWPC_BTN:
return FALSE;
}
LRESULT CDebugCommandsView::OnViewPCButton(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hwnd*/, BOOL& /*bHandled*/)
{
if (g_Reg != NULL && m_Breakpoints->isDebugging())
{
ShowAddress(g_Reg->m_PROGRAM_COUNTER, TRUE);
}
break;
case IDC_SYMBOLS_BTN:
return FALSE;
}
LRESULT CDebugCommandsView::OnSymbolsButton(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hwnd*/, BOOL& /*bHandled*/)
{
m_Debugger->Debug_ShowSymbolsWindow();
break;
case ID_POPUPMENU_RUNTO:
return FALSE;
}
LRESULT CDebugCommandsView::OnPopupmenuRunTo(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hwnd*/, BOOL& /*bHandled*/)
{
// Add temp bp and resume
m_Breakpoints->AddExecution(m_SelectedAddress, true);
case IDC_GO_BTN:
return FALSE;
}
LRESULT CDebugCommandsView::OnGoButton(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hwnd*/, BOOL& /*bHandled*/)
{
CPUResume();
m_AddressEdit.SetFocus();
break;
case IDC_STEP_BTN:
return FALSE;
}
LRESULT CDebugCommandsView::OnStepButton(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hwnd*/, BOOL& /*bHandled*/)
{
CPUStepInto();
m_AddressEdit.SetFocus();
break;
case IDC_SKIP_BTN:
return FALSE;
}
LRESULT CDebugCommandsView::OnSkipButton(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hwnd*/, BOOL& /*bHandled*/)
{
CPUSkip();
m_AddressEdit.SetFocus();
break;
case IDC_CLEARBP_BTN:
return FALSE;
}
LRESULT CDebugCommandsView::OnClearBPButton(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hwnd*/, BOOL& /*bHandled*/)
{
m_Breakpoints->BPClear();
RefreshBreakpointList();
ShowAddress(m_StartAddress, TRUE);
break;
case IDC_ADDBP_BTN:
return FALSE;
}
LRESULT CDebugCommandsView::OnAddBPButton(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hwnd*/, BOOL& /*bHandled*/)
{
m_AddBreakpointDlg.DoModal(m_Debugger);
RefreshBreakpointList();
ShowAddress(m_StartAddress, TRUE);
break;
case IDC_RMBP_BTN:
return FALSE;
}
LRESULT CDebugCommandsView::OnRemoveBPButton(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hwnd*/, BOOL& /*bHandled*/)
{
RemoveSelectedBreakpoints();
ShowAddress(m_StartAddress, TRUE);
break;
case IDCANCEL:
return FALSE;
}
LRESULT CDebugCommandsView::OnCancel(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hwnd*/, BOOL& /*bHandled*/)
{
EndDialog(0);
break;
//popup
case ID_POPUPMENU_EDIT:
return FALSE;
}
LRESULT CDebugCommandsView::OnPopupmenuEdit(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hwnd*/, BOOL& /*bHandled*/)
{
BeginOpEdit(m_SelectedAddress);
break;
case ID_POPUPMENU_INSERTNOP:
return FALSE;
}
LRESULT CDebugCommandsView::OnPopupmenuInsertNOP(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hwnd*/, BOOL& /*bHandled*/)
{
EditOp(m_SelectedAddress, 0x00000000);
ShowAddress(m_StartAddress, TRUE);
break;
case ID_POPUPMENU_RESTORE:
return FALSE;
}
LRESULT CDebugCommandsView::OnPopupmenuRestore(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hwnd*/, BOOL& /*bHandled*/)
{
RestoreOp(m_SelectedAddress);
ShowAddress(m_StartAddress, TRUE);
break;
case ID_POPUPMENU_RESTOREALL:
return FALSE;
}
LRESULT CDebugCommandsView::OnPopupmenuRestoreAll(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hwnd*/, BOOL& /*bHandled*/)
{
RestoreAllOps();
ShowAddress(m_StartAddress, TRUE);
break;
case ID_POPUPMENU_ADDSYMBOL:
return FALSE;
}
LRESULT CDebugCommandsView::OnPopupmenuAddSymbol(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hwnd*/, BOOL& /*bHandled*/)
{
m_AddSymbolDlg.DoModal(m_Debugger, m_SelectedAddress, CSymbols::TYPE_CODE);
break;
case ID_POPUPMENU_FOLLOWJUMP:
return FALSE;
}
LRESULT CDebugCommandsView::OnPopupmenuFollowJump(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hwnd*/, BOOL& /*bHandled*/)
{
HistoryPushState();
ShowAddress(m_FollowAddress, TRUE);
HistoryPushState();
break;
case ID_POPUPMENU_VIEWMEMORY:
return FALSE;
}
LRESULT CDebugCommandsView::OnPopupmenuViewMemory(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hwnd*/, BOOL& /*bHandled*/)
{
m_Debugger->Debug_ShowMemoryLocation(m_FollowAddress, true);
break;
case ID_POPUPMENU_TOGGLEBP:
return FALSE;
}
LRESULT CDebugCommandsView::OnPopupmenuToggleBP(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hwnd*/, BOOL& /*bHandled*/)
{
m_Breakpoints->EBPToggle(m_SelectedAddress);
ShowAddress(m_StartAddress, TRUE);
break;
case ID_POPUPMENU_CLEARBPS:
return FALSE;
}
LRESULT CDebugCommandsView::OnPopupmenuClearBP(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hwnd*/, BOOL& /*bHandled*/)
{
m_Breakpoints->EBPClear();
ShowAddress(m_StartAddress, TRUE);
break;
}
return FALSE;
}
@ -1378,7 +1437,7 @@ LRESULT CDebugCommandsView::OnCommandListRightClicked(NMHDR* pNMHDR)
return 0;
}
LRESULT CDebugCommandsView::OnListBoxClicked(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
LRESULT CDebugCommandsView::OnListBoxClicked(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
if (wID == IDC_BP_LIST)
{
@ -1401,7 +1460,7 @@ LRESULT CDebugCommandsView::OnListBoxClicked(WORD wNotifyCode, WORD wID, HWND hW
return FALSE;
}
LRESULT CDebugCommandsView::OnActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
LRESULT CDebugCommandsView::OnActivate(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
WORD type = LOWORD(wParam);
@ -1447,7 +1506,7 @@ LRESULT CDebugCommandsView::OnSizing(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*
return FALSE;
}
LRESULT CDebugCommandsView::OnScroll(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
LRESULT CDebugCommandsView::OnScroll(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
WORD type = LOWORD(wParam);
@ -1543,7 +1602,7 @@ void CDebugCommandsView::ShowPIRegTab()
m_RegisterTabs.ShowTab(2);
}
LRESULT CDebugCommandsView::OnRegisterTabChange(NMHDR* pNMHDR)
LRESULT CDebugCommandsView::OnRegisterTabChange(NMHDR* /*pNMHDR*/)
{
int nPage = m_RegisterTabs.GetCurSel();
m_RegisterTabs.ShowTab(nPage);
@ -1561,7 +1620,7 @@ void CDebugCommandsView::ToggleHistoryButtons()
if (m_ForwardButton.m_hWnd != NULL)
{
m_ForwardButton.EnableWindow(m_History.size() != 0 && m_HistoryIndex < m_History.size() - 1 ? TRUE : FALSE);
m_ForwardButton.EnableWindow(m_History.size() != 0 && m_HistoryIndex < (int)m_History.size() - 1 ? TRUE : FALSE);
}
}

View File

@ -96,7 +96,27 @@ private:
COMMAND_HANDLER(IDC_ADDR_EDIT, EN_CHANGE, OnAddrChanged)
COMMAND_HANDLER(IDC_PC_EDIT, EN_CHANGE, OnPCChanged)
COMMAND_CODE_HANDLER(LBN_DBLCLK, OnListBoxClicked)
COMMAND_CODE_HANDLER(BN_CLICKED, OnClicked)
COMMAND_HANDLER(IDC_BACK_BTN, BN_CLICKED, OnBackButton)
COMMAND_HANDLER(IDC_FORWARD_BTN, BN_CLICKED, OnForwardButton)
COMMAND_HANDLER(IDC_VIEWPC_BTN, BN_CLICKED, OnViewPCButton)
COMMAND_HANDLER(IDC_SYMBOLS_BTN, BN_CLICKED, OnSymbolsButton)
COMMAND_HANDLER(ID_POPUPMENU_RUNTO, BN_CLICKED, OnPopupmenuRunTo)
COMMAND_HANDLER(IDC_GO_BTN, BN_CLICKED, OnGoButton)
COMMAND_HANDLER(IDC_STEP_BTN, BN_CLICKED, OnStepButton)
COMMAND_HANDLER(IDC_SKIP_BTN, BN_CLICKED, OnSkipButton)
COMMAND_HANDLER(IDC_CLEARBP_BTN, BN_CLICKED, OnClearBPButton)
COMMAND_HANDLER(IDC_ADDBP_BTN, BN_CLICKED, OnAddBPButton)
COMMAND_HANDLER(IDC_RMBP_BTN, BN_CLICKED, OnRemoveBPButton)
COMMAND_HANDLER(IDCANCEL, BN_CLICKED, OnCancel)
COMMAND_HANDLER(ID_POPUPMENU_EDIT, BN_CLICKED, OnPopupmenuEdit)
COMMAND_HANDLER(ID_POPUPMENU_INSERTNOP, BN_CLICKED, OnPopupmenuInsertNOP)
COMMAND_HANDLER(ID_POPUPMENU_RESTORE, BN_CLICKED, OnPopupmenuRestore)
COMMAND_HANDLER(ID_POPUPMENU_RESTOREALL, BN_CLICKED, OnPopupmenuRestoreAll)
COMMAND_HANDLER(ID_POPUPMENU_ADDSYMBOL, BN_CLICKED, OnPopupmenuAddSymbol)
COMMAND_HANDLER(ID_POPUPMENU_FOLLOWJUMP, BN_CLICKED, OnPopupmenuFollowJump)
COMMAND_HANDLER(ID_POPUPMENU_VIEWMEMORY, BN_CLICKED, OnPopupmenuViewMemory)
COMMAND_HANDLER(ID_POPUPMENU_TOGGLEBP, BN_CLICKED, OnPopupmenuToggleBP)
COMMAND_HANDLER(ID_POPUPMENU_CLEARBPS, BN_CLICKED, OnPopupmenuClearBP )
NOTIFY_HANDLER_EX(IDC_CMD_LIST, NM_CLICK, OnCommandListClicked)
NOTIFY_HANDLER_EX(IDC_CMD_LIST, NM_DBLCLK, OnCommandListDblClicked)
NOTIFY_HANDLER_EX(IDC_CMD_LIST, NM_RCLICK, OnCommandListRightClicked)
@ -147,6 +167,27 @@ private:
LRESULT OnAddrChanged(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
LRESULT OnPCChanged(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
LRESULT OnListBoxClicked(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
LRESULT OnBackButton(WORD wNotifyCode, WORD wID, HWND hwnd, BOOL& bHandled);
LRESULT OnForwardButton(WORD wNotifyCode, WORD wID, HWND hwnd, BOOL& bHandled);
LRESULT OnViewPCButton(WORD wNotifyCode, WORD wID, HWND hwnd, BOOL& bHandled);
LRESULT OnSymbolsButton(WORD wNotifyCode, WORD wID, HWND hwnd, BOOL& bHandled);
LRESULT OnPopupmenuRunTo(WORD wNotifyCode, WORD wID, HWND hwnd, BOOL& bHandled);
LRESULT OnGoButton(WORD wNotifyCode, WORD wID, HWND hwnd, BOOL& bHandled);
LRESULT OnStepButton(WORD wNotifyCode, WORD wID, HWND hwnd, BOOL& bHandled);
LRESULT OnSkipButton(WORD wNotifyCode, WORD wID, HWND hwnd, BOOL& bHandled);
LRESULT OnClearBPButton(WORD wNotifyCode, WORD wID, HWND hwnd, BOOL& bHandled);
LRESULT OnAddBPButton(WORD wNotifyCode, WORD wID, HWND hwnd, BOOL& bHandled);
LRESULT OnRemoveBPButton(WORD wNotifyCode, WORD wID, HWND hwnd, BOOL& bHandled);
LRESULT OnCancel(WORD wNotifyCode, WORD wID, HWND hwnd, BOOL& bHandled);
LRESULT OnPopupmenuEdit(WORD wNotifyCode, WORD wID, HWND hwnd, BOOL& bHandled);
LRESULT OnPopupmenuInsertNOP(WORD wNotifyCode, WORD wID, HWND hwnd, BOOL& bHandled);
LRESULT OnPopupmenuRestore(WORD wNotifyCode, WORD wID, HWND hwnd, BOOL& bHandled);
LRESULT OnPopupmenuRestoreAll(WORD wNotifyCode, WORD wID, HWND hwnd, BOOL& bHandled);
LRESULT OnPopupmenuAddSymbol(WORD wNotifyCode, WORD wID, HWND hwnd, BOOL& bHandled);
LRESULT OnPopupmenuFollowJump(WORD wNotifyCode, WORD wID, HWND hwnd, BOOL& bHandled);
LRESULT OnPopupmenuViewMemory(WORD wNotifyCode, WORD wID, HWND hwnd, BOOL& bHandled);
LRESULT OnPopupmenuToggleBP(WORD wNotifyCode, WORD wID, HWND hwnd, BOOL& bHandled);
LRESULT OnPopupmenuClearBP(WORD wNotifyCode, WORD wID, HWND hwnd, BOOL& bHandled);
LRESULT OnClicked(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
LRESULT OnOpKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
@ -251,6 +292,6 @@ private:
int margin;
} BRANCHARROW;
vector<BRANCHARROW> m_BranchArrows;
std::vector<BRANCHARROW> m_BranchArrows;
vector<bool> m_bvAnnotatedLines;
};