diff --git a/Windows/Debugger/Debugger_Disasm.cpp b/Windows/Debugger/Debugger_Disasm.cpp index 20a3035cf5..a8952c3906 100644 --- a/Windows/Debugger/Debugger_Disasm.cpp +++ b/Windows/Debugger/Debugger_Disasm.cpp @@ -46,6 +46,8 @@ enum { BPL_TYPE, BPL_OFFSET, BPL_SIZELABEL, BPL_OPCODE, BPL_HITS, BPL_ENABLED, B // How long (max) to wait for Core to pause before clearing temp breakpoints. const int TEMP_BREAKPOINT_WAIT_MS = 100; +const int POPUP_SUBMENU_ID_BREAKPOINTLIST = 5; + static FAR WNDPROC DefBreakpointListProc; static LRESULT CALLBACK BreakpointListProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) @@ -332,20 +334,64 @@ void CDisasm::gotoBreakpointAddress(int itemIndex) } } +void CDisasm::showBreakpointMenu(int itemIndex, const POINT &pt) +{ + bool isMemory; + int index = getBreakpointIndex(itemIndex, isMemory); + if (index == -1) return; + + MemCheck mcPrev; + BreakPoint bpPrev; + if (isMemory) { + mcPrev = displayedMemChecks_[index]; + } else { + bpPrev = displayedBreakPoints_[index]; + } + + HWND wnd = GetDlgItem(m_hDlg, IDC_BREAKPOINTLIST); + POINT screenPt(pt); + ClientToScreen(wnd, &screenPt); + + HMENU subMenu = GetSubMenu(g_hPopupMenus, POPUP_SUBMENU_ID_BREAKPOINTLIST); + if (isMemory) { + CheckMenuItem(subMenu, ID_DISASM_DISABLEBREAKPOINT, mcPrev.result & MEMCHECK_BREAK ? MF_CHECKED : MF_UNCHECKED); + } else { + CheckMenuItem(subMenu, ID_DISASM_DISABLEBREAKPOINT, bpPrev.enabled ? MF_CHECKED : MF_UNCHECKED); + } + + switch (TrackPopupMenuEx(subMenu, TPM_RIGHTBUTTON | TPM_RETURNCMD, screenPt.x, screenPt.y, wnd, 0)) + { + case ID_DISASM_DISABLEBREAKPOINT: + if (isMemory) { + CBreakPoints::ChangeMemCheck(mcPrev.start, mcPrev.end, mcPrev.cond, MemCheckResult(mcPrev.result ^ MEMCHECK_BREAK)); + } else { + CBreakPoints::ChangeBreakPoint(bpPrev.addr, !bpPrev.enabled); + } + break; + } +} + static char breakpointText[256]; void CDisasm::handleBreakpointNotify(LPARAM lParam) { - if (((LPNMHDR)lParam)->code == NM_DBLCLK) + const LPNMHDR header = (LPNMHDR)lParam; + if (header->code == NM_DBLCLK) { - LPNMITEMACTIVATE item = (LPNMITEMACTIVATE) lParam; + const LPNMITEMACTIVATE item = (LPNMITEMACTIVATE) lParam; gotoBreakpointAddress(item->iItem); return; } - - if (((LPNMHDR)lParam)->code == LVN_GETDISPINFO) + if (header->code == NM_RCLICK) { - NMLVDISPINFO* dispInfo = (NMLVDISPINFO*)lParam; + const LPNMITEMACTIVATE item = (LPNMITEMACTIVATE)lParam; + showBreakpointMenu(item->iItem, item->ptAction); + return; + } + + if (header->code == LVN_GETDISPINFO) + { + NMLVDISPINFO *dispInfo = (NMLVDISPINFO *)lParam; bool isMemory; int index = getBreakpointIndex(dispInfo->item.iItem,isMemory); diff --git a/Windows/Debugger/Debugger_Disasm.h b/Windows/Debugger/Debugger_Disasm.h index a984068a7f..3f26731400 100644 --- a/Windows/Debugger/Debugger_Disasm.h +++ b/Windows/Debugger/Debugger_Disasm.h @@ -42,6 +42,7 @@ private: int getTotalBreakpointCount(); int getBreakpointIndex(int itemIndex, bool& isMemory); void updateThreadLabel(bool clear); + void showBreakpointMenu(int itemIndex, const POINT &pt); public: int index; //helper diff --git a/Windows/ppsspp.rc b/Windows/ppsspp.rc index 062cb7aa71..28e751a457 100644 Binary files a/Windows/ppsspp.rc and b/Windows/ppsspp.rc differ diff --git a/Windows/resource.h b/Windows/resource.h index bed8c55149..47c921cb77 100644 Binary files a/Windows/resource.h and b/Windows/resource.h differ