From 3dc703cc3cf95270bebceb8ea69e4aff6b30efc6 Mon Sep 17 00:00:00 2001 From: ansstuff Date: Fri, 10 Aug 2012 14:19:57 +0000 Subject: [PATCH] Debugger: "Address Bookmark Add" field follows disassembly window scrolling position (#532) --- changelog.txt | 17 ++++++++ src/drivers/win/debugger.cpp | 26 +++++++++--- src/drivers/win/res.rc | 80 ++++++++++++++++++------------------ 3 files changed, 79 insertions(+), 44 deletions(-) diff --git a/changelog.txt b/changelog.txt index f4be6669..481dc5ee 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,6 +1,23 @@ + +10-Aug-2012 - AnS - Debugger: "Address Bookmark Add" field follows disassembly window scrolling position +08-Aug-2012 - AnS - Taseditor: frame counter display is auto-on when Taseditor launches +08-Aug-2012 - AnS - Debugger: improved stack display +08-Aug-2012 - AnS - Debugger: doubleclick on the disassembly prompts "Add Execute breakpoint" dialog +08-Aug-2012 - AnS - Debugger: fixed RAM peek by a rightclick on left pane +08-Aug-2012 - AnS - Debugger: ">" shows current line in disassembly +08-Aug-2012 - AnS - Debugger: show the number of breakpoints (enabled and total) above the breakpoints list +06-Aug-2012 - CaH4e3 - fixed bug when loading UNF games (#525 ) +06-Aug-2012 - AnS - Tracer also updates its window when user pauses the game, not just when Debugger snaps +06-Aug-2012 - AnS - Tracer: added "Use Stack Pointer for lines tabbing" option and added "To the left from disassembly text" option +05-Aug-2012 - AnS - Debugger: .DEB file now also stores the state of "Break on Bad Opcode" and "Break when exceed" checkboxes/editfields +05-Aug-2012 - AnS - Debugger: added "CPU cycles" and "Instructions" counters (request #527) and added "Break when exceed" breakpoints +05-Aug-2012 - AnS - Debugger: window layout cleanup 06-Aug-2012 - prg - gtk: added hotkey gui config 04-Aug-2012 - prg - all: updated FSF address 04-Aug-2012 - prg - sdl: added SDL.Input.EnableOppositeDirectional option. allows/disallows simultaneous right+left / up+down. +03-Aug-2012 - AnS - Debugger: highlighting breakpoint item in BPs list when it's triggered +03-Aug-2012 - AnS - Debugger: allow Frame Advancing when Debugger is in breakpoint state +03-Aug-2012 - AnS - Debugger: don't update Debugger window at the beginning of Step command (it will update at at the end of Step) - fixes #528 25-Jul-2012 - AnS - Taseditor: auto-starting Note editing when creating Marker by double-click 19-Jul-2012 - AnS - Taseditor: Lua registermanual allows changing the "Run function" button caption; Markers are always restored when deploying Bookmarks 01-Jul-2012 - AnS - new hotkey "Run Manual Lua function" diff --git a/src/drivers/win/debugger.cpp b/src/drivers/win/debugger.cpp index b59c12df..62d82576 100644 --- a/src/drivers/win/debugger.cpp +++ b/src/drivers/win/debugger.cpp @@ -101,10 +101,9 @@ void UpdateOtherDebuggingDialogs() void RestoreSize(HWND hwndDlg) { - //As of the writing of this function (revision 1137) the Debugger default width = 821 and height of 523 //If the dialog dimensions are changed those changes need to be reflected here. - adelikat - const int DEFAULT_WIDTH = 821; //Original width - const int DEFAULT_HEIGHT = 549; //Original height + const int DEFAULT_WIDTH = 816; //Original width + const int DEFAULT_HEIGHT = 554; //Original height SetWindowPos(hwndDlg,HWND_TOP,DbgPosX,DbgPosY,DEFAULT_WIDTH,DEFAULT_HEIGHT,SWP_SHOWWINDOW); } @@ -609,6 +608,9 @@ void UpdateDebugger() int tmp,ret,i; Disassemble(hDebug, IDC_DEBUGGER_DISASSEMBLY, IDC_DEBUGGER_DISASSEMBLY_VSCR, X.PC); + // "Address Bookmark Add" follows the address + sprintf(str,"%04X", X.PC); + SetDlgItemText(hDebug, IDC_DEBUGGER_BOOKMARK, str); sprintf(str, "%02X", X.A); SetDlgItemText(hDebug, IDC_DEBUGGER_VAL_A, str); @@ -730,7 +732,6 @@ void UpdateDebugger() if (tmp & C_FLAG) CheckDlgButton(hDebug, IDC_DEBUGGER_FLAG_C, BST_CHECKED); DebuggerWasUpdated = true; - } char *BreakToText(unsigned int num) { @@ -1069,17 +1070,23 @@ BOOL CALLBACK DebuggerEnumWindowsProc(HWND hwnd, LPARAM lParam) HWND addrline = GetDlgItem(hDebug,IDC_DEBUGGER_ADDR_LINE); //Get handle of address line (text area under the disassembly HWND vscr = GetDlgItem(hDebug,IDC_DEBUGGER_DISASSEMBLY_VSCR); //Get handle for disassembly Vertical Scrollbar + char str[8] = {0}; + RECT crect; GetWindowRect(hwnd,&crect); //Get rect of current child to be resized ScreenToClient(hDebug,(LPPOINT)&crect); //Convert rect coordinates to client area coordinates ScreenToClient(hDebug,((LPPOINT)&crect)+1); - if(hwnd == editbox) { + if(hwnd == editbox) + { crect.right += dx; crect.bottom += dy; SetWindowPos(hwnd,0,0,0,crect.right-crect.left,crect.bottom-crect.top,SWP_NOZORDER | SWP_NOMOVE); GetScrollInfo(GetDlgItem(hDebug,IDC_DEBUGGER_DISASSEMBLY_VSCR),SB_CTL,&si); Disassemble(hDebug, IDC_DEBUGGER_DISASSEMBLY, IDC_DEBUGGER_DISASSEMBLY_VSCR, si.nPos); + // "Address Bookmark Add" follows the address + sprintf(str,"%04X", si.nPos); + SetDlgItemText(hDebug, IDC_DEBUGGER_BOOKMARK, str); } else if(hwnd == icontray) { crect.bottom += dy; SetWindowPos(hwnd,0,0,0,crect.right-crect.left,crect.bottom-crect.top,SWP_NOZORDER | SWP_NOMOVE); @@ -1384,6 +1391,9 @@ BOOL CALLBACK DebuggerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara if ((si.nPos+(int)si.nPage) > si.nMax) si.nPos = si.nMax-si.nPage; //mbg merge 7/18/06 added cast SetScrollInfo((HWND)lParam,SB_CTL,&si,TRUE); Disassemble(hDebug, IDC_DEBUGGER_DISASSEMBLY, IDC_DEBUGGER_DISASSEMBLY_VSCR, si.nPos); + // "Address Bookmark Add" follows the address + sprintf(str,"%04X", si.nPos); + SetDlgItemText(hDebug, IDC_DEBUGGER_BOOKMARK, str); } break; @@ -1419,6 +1429,9 @@ BOOL CALLBACK DebuggerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara if ((si.nPos+(int)si.nPage) > si.nMax) si.nPos = si.nMax-si.nPage; //mbg merge 7/18/06 added cast SetScrollInfo((HWND)lParam,SB_CTL,&si,TRUE); Disassemble(hDebug, IDC_DEBUGGER_DISASSEMBLY, IDC_DEBUGGER_DISASSEMBLY_VSCR, si.nPos); + // "Address Bookmark Add" follows the address + sprintf(str,"%04X", si.nPos); + SetDlgItemText(hDebug, IDC_DEBUGGER_BOOKMARK, str); break; case WM_KEYDOWN: @@ -1667,6 +1680,9 @@ BOOL CALLBACK DebuggerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara sprintf(str,"%04X",tmp); SetDlgItemText(hwndDlg,IDC_DEBUGGER_VAL_PCSEEK,str); Disassemble(hDebug, IDC_DEBUGGER_DISASSEMBLY, IDC_DEBUGGER_DISASSEMBLY_VSCR, tmp); + // "Address Bookmark Add" follows the address + sprintf(str,"%04X", si.nPos); + SetDlgItemText(hDebug, IDC_DEBUGGER_BOOKMARK, str); break; case IDC_DEBUGGER_BREAK_ON_BAD_OP: //Break on bad opcode diff --git a/src/drivers/win/res.rc b/src/drivers/win/res.rc index da82633d..d080547e 100644 --- a/src/drivers/win/res.rc +++ b/src/drivers/win/res.rc @@ -1070,27 +1070,27 @@ BEGIN PUSHBUTTON "<",MEMW_EXPANDCOLLAPSE,1,259,11,10 END -DEBUGGER DIALOGEX 54, 74, 539, 319 +DEBUGGER DIALOGEX 54, 74, 540, 321 STYLE DS_SETFONT | DS_3DLOOK | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME CAPTION "6502 Debugger" FONT 8, "MS Sans Serif", 0, 0, 0x0 BEGIN - EDITTEXT IDC_DEBUGGER_DISASSEMBLY,15,5,318,299,ES_MULTILINE | ES_NOHIDESEL | ES_READONLY | WS_HSCROLL - SCROLLBAR IDC_DEBUGGER_DISASSEMBLY_VSCR,334,5,11,299,SBS_VERT - GROUPBOX "Status Flags",401,433,139,99,35,WS_TABSTOP + EDITTEXT IDC_DEBUGGER_DISASSEMBLY,15,5,318,300,ES_MULTILINE | ES_NOHIDESEL | ES_READONLY | WS_HSCROLL + SCROLLBAR IDC_DEBUGGER_DISASSEMBLY_VSCR,334,5,11,300,SBS_VERT + GROUPBOX "Status Flags",401,433,139,101,35,WS_TABSTOP CONTROL "N",IDC_DEBUGGER_FLAG_N,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,439,148,18,12 CONTROL "V",IDC_DEBUGGER_FLAG_V,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,463,148,18,12 - CONTROL "U",IDC_DEBUGGER_FLAG_U,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,486,148,18,12 - CONTROL "B",IDC_DEBUGGER_FLAG_B,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,509,148,18,12 + CONTROL "U",IDC_DEBUGGER_FLAG_U,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,487,148,18,12 + CONTROL "B",IDC_DEBUGGER_FLAG_B,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,510,148,18,12 CONTROL "D",IDC_DEBUGGER_FLAG_D,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,439,160,18,12 CONTROL "I",IDC_DEBUGGER_FLAG_I,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,463,160,18,12 - CONTROL "Z",IDC_DEBUGGER_FLAG_Z,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,486,160,18,12 - CONTROL "C",IDC_DEBUGGER_FLAG_C,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,509,160,18,12 - GROUPBOX "Breakpoints",IDC_DEBUGGER_BREAKPOINTS,433,3,100,135,WS_TABSTOP - LISTBOX IDC_DEBUGGER_BP_LIST,437,13,92,91,LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_VSCROLL + CONTROL "Z",IDC_DEBUGGER_FLAG_Z,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,487,160,18,12 + CONTROL "C",IDC_DEBUGGER_FLAG_C,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,510,160,18,12 + GROUPBOX "Breakpoints",IDC_DEBUGGER_BREAKPOINTS,433,3,101,135,WS_TABSTOP + LISTBOX IDC_DEBUGGER_BP_LIST,437,13,93,91,LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_VSCROLL PUSHBUTTON "Add",IDC_DEBUGGER_BP_ADD,437,107,30,15 - PUSHBUTTON "Delete",IDC_DEBUGGER_BP_DEL,469,107,29,15,WS_DISABLED - PUSHBUTTON "Edit",IDC_DEBUGGER_BP_EDIT,500,107,29,15,WS_DISABLED + PUSHBUTTON "Delete",IDC_DEBUGGER_BP_DEL,469,107,30,15,WS_DISABLED + PUSHBUTTON "Edit",IDC_DEBUGGER_BP_EDIT,501,107,29,15,WS_DISABLED PUSHBUTTON "Run",IDC_DEBUGGER_RUN,350,5,38,14 PUSHBUTTON "Step Into",IDC_DEBUGGER_STEP_IN,391,5,39,14 PUSHBUTTON "Step Out",IDC_DEBUGGER_STEP_OUT,350,21,38,14 @@ -1108,45 +1108,46 @@ BEGIN PUSHBUTTON "Seek PC",IDC_DEBUGGER_SEEK_PC,391,71,39,14 PUSHBUTTON "Seek To:",IDC_DEBUGGER_SEEK_TO,350,54,38,14 EDITTEXT IDC_DEBUGGER_VAL_PCSEEK,391,55,38,12,ES_UPPERCASE | ES_WANTRETURN - EDITTEXT IDC_DEBUGGER_VAL_SLINE,383,203,14,11,ES_UPPERCASE | ES_READONLY | ES_WANTRETURN | NOT WS_BORDER,WS_EX_TRANSPARENT - EDITTEXT IDC_DEBUGGER_VAL_PPUPIXEL,372,216,14,11,ES_UPPERCASE | ES_READONLY | ES_WANTRETURN | NOT WS_BORDER,WS_EX_TRANSPARENT + EDITTEXT IDC_DEBUGGER_VAL_SLINE,383,203,14,10,ES_UPPERCASE | ES_READONLY | ES_WANTRETURN | NOT WS_BORDER,WS_EX_TRANSPARENT + EDITTEXT IDC_DEBUGGER_VAL_PPUPIXEL,372,216,14,10,ES_UPPERCASE | ES_READONLY | ES_WANTRETURN | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_TRANSPARENT GROUPBOX "",IDC_DEBUGGER_VAL_S2,349,174,50,53,WS_TABSTOP - EDITTEXT IDC_DEBUGGER_VAL_CYCLES_COUNT,442,178,46,11,ES_UPPERCASE | ES_NOHIDESEL | ES_READONLY | ES_WANTRETURN | NOT WS_BORDER,WS_EX_TRANSPARENT - EDITTEXT IDC_DEBUGGER_VAL_CYCLES_COUNT2,488,178,51,11,ES_UPPERCASE | ES_READONLY | ES_WANTRETURN | NOT WS_BORDER,WS_EX_TRANSPARENT - EDITTEXT IDC_DEBUGGER_VAL_INSTRUCTIONS_COUNT,441,204,46,11,ES_UPPERCASE | ES_NOHIDESEL | ES_READONLY | ES_WANTRETURN | NOT WS_BORDER,WS_EX_TRANSPARENT - EDITTEXT IDC_DEBUGGER_VAL_INSTRUCTIONS_COUNT2,488,204,51,11,ES_UPPERCASE | ES_READONLY | ES_WANTRETURN | NOT WS_BORDER,WS_EX_TRANSPARENT + EDITTEXT IDC_DEBUGGER_VAL_CYCLES_COUNT,442,179,46,10,ES_NOHIDESEL | ES_READONLY | ES_WANTRETURN | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_TRANSPARENT + EDITTEXT IDC_DEBUGGER_VAL_CYCLES_COUNT2,489,179,51,10,ES_READONLY | ES_WANTRETURN | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_TRANSPARENT + EDITTEXT IDC_DEBUGGER_VAL_INSTRUCTIONS_COUNT,441,204,46,10,ES_NOHIDESEL | ES_READONLY | ES_WANTRETURN | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_TRANSPARENT + EDITTEXT IDC_DEBUGGER_VAL_INSTRUCTIONS_COUNT2,489,204,51,10,ES_READONLY | ES_WANTRETURN | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_TRANSPARENT LTEXT "PPU:",65531,352,179,17,10 LTEXT "Sprite:",65530,352,191,20,10 EDITTEXT IDC_DEBUGGER_VAL_PPU,371,179,25,12,ES_UPPERCASE | ES_READONLY | ES_WANTRETURN | NOT WS_BORDER,WS_EX_TRANSPARENT EDITTEXT IDC_DEBUGGER_VAL_SPR,374,191,15,12,ES_UPPERCASE | ES_READONLY | ES_WANTRETURN | NOT WS_BORDER,WS_EX_TRANSPARENT - CONTROL "",IDC_DEBUGGER_ADDR_LINE,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,4,306,341,10 + CONTROL "",IDC_DEBUGGER_ADDR_LINE,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,4,308,341,11 CONTROL "Break on Bad Opcode",IDC_DEBUGGER_BREAK_ON_BAD_OP, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,438,125,90,10 - CONTROL "Symbolic debugging",IDC_DEBUGGER_ENABLE_SYMBOLIC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,448,260,77,10 - PUSHBUTTON "Reload Symbols",IDC_DEBUGGER_RELOAD_SYMS,447,272,62,14 - GROUPBOX "Address Bookmarks",45535,349,227,94,75 - LISTBOX LIST_DEBUGGER_BOOKMARKS,353,236,50,62,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP - EDITTEXT IDC_DEBUGGER_BOOKMARK,407,236,32,14,ES_AUTOHSCROLL - PUSHBUTTON "Add",IDC_DEBUGGER_BOOKMARK_ADD,406,252,34,14 - PUSHBUTTON "Delete",IDC_DEBUGGER_BOOKMARK_DEL,406,268,34,14 - PUSHBUTTON "Rom Patcher",IDC_DEBUGGER_ROM_PATCHER,447,288,62,14 - CONTROL "",IDC_DEBUGGER_ICONTRAY,"Static",SS_BLACKFRAME,4,5,11,299 - PUSHBUTTON "-",IDC_DEBUGGER_RESTORESIZE,349,305,13,9 - LTEXT "Default window size",IDC_STATIC,364,306,68,9 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,438,125,89,10 + CONTROL "Symbolic debugging",IDC_DEBUGGER_ENABLE_SYMBOLIC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,442,259,77,10 + PUSHBUTTON "Reload Symbols",IDC_DEBUGGER_RELOAD_SYMS,441,271,62,14 + GROUPBOX "Address Bookmarks",45535,349,228,84,76 + LISTBOX LIST_DEBUGGER_BOOKMARKS,353,238,44,63,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + EDITTEXT IDC_DEBUGGER_BOOKMARK,400,238,29,14,ES_AUTOHSCROLL + PUSHBUTTON "Add",IDC_DEBUGGER_BOOKMARK_ADD,399,254,31,14 + PUSHBUTTON "Delete",IDC_DEBUGGER_BOOKMARK_DEL,399,270,31,14 + PUSHBUTTON "Rom Patcher",IDC_DEBUGGER_ROM_PATCHER,441,287,62,14 + CONTROL "",IDC_DEBUGGER_ICONTRAY,"Static",SS_BLACKFRAME,4,5,11,300 + PUSHBUTTON "",IDC_DEBUGGER_RESTORESIZE,349,307,13,10 + LTEXT "Default window size",IDC_STATIC,364,308,68,9 PUSHBUTTON "Run Line",IDC_DEBUGGER_RUN_LINE,350,37,38,14 PUSHBUTTON "128 Lines",IDC_DEBUGGER_RUN_FRAME2,391,37,39,14 LTEXT "Scanline:",IDC_STATIC,352,203,31,8 - CONTROL "Load .DEB",DEBUGLOADDEB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,488,305,48,10 - CONTROL "Auto-open",DEBUGAUTOLOAD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,438,305,46,10 - LTEXT "CPU cycles:",IDC_STATIC,402,178,39,8 - PUSHBUTTON "Reset counters",IDC_DEBUGGER_RESET_COUNTERS,447,230,62,14 - CONTROL "Break when exceed",IDC_DEBUGGER_BREAK_ON_CYCLES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,405,190,77,10 + CONTROL "Load .DEB",DEBUGLOADDEB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,488,306,48,13 + CONTROL "Auto-open",DEBUGAUTOLOAD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,438,306,46,13 + LTEXT "CPU cycles:",IDC_STATIC,402,179,39,8 + PUSHBUTTON "Reset counters",IDC_DEBUGGER_RESET_COUNTERS,471,230,64,14 + CONTROL "Break when exceed",IDC_DEBUGGER_BREAK_ON_CYCLES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,403,191,77,10 LTEXT "Pixel:",IDC_STATIC,352,216,17,8 - EDITTEXT IDC_DEBUGGER_CYCLES_EXCEED,483,189,50,12,ES_UPPERCASE | ES_NOHIDESEL | ES_WANTRETURN | ES_NUMBER + EDITTEXT IDC_DEBUGGER_CYCLES_EXCEED,481,190,53,12,ES_UPPERCASE | ES_NOHIDESEL | ES_WANTRETURN | ES_NUMBER LTEXT "Instructions:",IDC_STATIC,402,204,40,8 CONTROL "Break when exceed",IDC_DEBUGGER_BREAK_ON_INSTRUCTIONS, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,405,217,77,10 - EDITTEXT IDC_DEBUGGER_INSTRUCTIONS_EXCEED,483,216,50,12,ES_UPPERCASE | ES_NOHIDESEL | ES_WANTRETURN | ES_NUMBER + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,403,216,77,10 + EDITTEXT IDC_DEBUGGER_INSTRUCTIONS_EXCEED,481,215,53,12,ES_UPPERCASE | ES_NOHIDESEL | ES_WANTRETURN | ES_NUMBER + GROUPBOX "",IDC_STATIC,437,252,97,52 END TRACER DIALOGEX 65527, 65513, 383, 316 @@ -1969,6 +1970,7 @@ BEGIN "DEBUGGER", DIALOG BEGIN + BOTTOMMARGIN, 320 END "TRACER", DIALOG