1 /* Copyright 2012-2013 Theo Berkau <cwx@cyberwarriorx.com> 2 3 This file is part of Yabause. 4 5 Yabause is free software; you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation; either version 2 of the License, or 8 (at your option) any later version. 9 10 Yabause is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with Yabause; if not, write to the Free Software 17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 */ 19 #ifndef UIDEBUGCPU_H 20 #define UIDEBUGCPU_H 21 22 #include "ui_UIDebugCPU.h" 23 #include "../YabauseThread.h" 24 #include "../QtYabause.h" 25 26 class UIDebugCPU : public QDialog, public Ui::UIDebugCPU 27 { 28 Q_OBJECT 29 30 public: 31 enum PROCTYPE 32 { 33 PROC_MSH2, 34 PROC_SSH2, 35 PROC_SH1, 36 PROC_M68K, 37 PROC_SCSPDSP, 38 PROC_SCUDSP, 39 }; 40 41 UIDebugCPU( PROCTYPE proc, YabauseThread *mYabauseThread, QWidget* parent = 0 ); 42 virtual void updateRegList(); 43 virtual void updateCodeList(u32 addr); 44 virtual u32 getRegister(int index, int *size); 45 virtual void setRegister(int index, u32 value); 46 virtual bool addCodeBreakpoint(u32 addr); 47 virtual bool delCodeBreakpoint(u32 addr); 48 virtual bool addMemoryBreakpoint(u32 addr, u32 flags); 49 virtual bool delMemoryBreakpoint(u32 addr); 50 virtual void stepInto(); 51 virtual void stepOver(); 52 virtual void stepOut(); 53 virtual void reserved1(); 54 virtual void reserved2(); 55 virtual void reserved3(); 56 virtual void reserved4(); 57 virtual void reserved5(); 58 59 protected: 60 YabauseThread *mYabauseThread; 61 enum PROCTYPE context; 62 bool isReadWriteButtonAndTextOK(); 63 64 protected slots: 65 void on_lwRegisters_itemDoubleClicked ( QListWidgetItem * item ); 66 void on_lwBackTrace_itemDoubleClicked ( QListWidgetItem * item ); 67 void on_twTrackInfLoop_itemDoubleClicked ( QTableWidgetItem * item ); 68 void on_leCodeBreakpoint_textChanged( const QString & text); 69 void on_leMemoryBreakpoint_textChanged( const QString & text); 70 void on_lwCodeBreakpoints_itemSelectionChanged (); 71 void on_pbAddCodeBreakpoint_clicked(); 72 void on_pbDelCodeBreakpoint_clicked(); 73 void on_lwMemoryBreakpoints_itemSelectionChanged (); 74 void on_pbAddMemoryBreakpoint_clicked(); 75 void on_pbDelMemoryBreakpoint_clicked(); 76 void on_cbRead_toggled(bool enable); 77 void on_cbWrite_toggled(bool enable); 78 void on_cbReadByte_toggled(bool enable); 79 void on_cbReadWord_toggled(bool enable); 80 void on_cbReadLong_toggled(bool enable); 81 void on_cbWriteByte_toggled(bool enable); 82 void on_cbWriteWord_toggled(bool enable); 83 void on_cbWriteLong_toggled(bool enable); 84 void on_pbStepInto_clicked(); 85 void on_pbStepOver_clicked(); 86 void on_pbStepOut_clicked(); 87 void on_pbMemoryTransfer_clicked(); 88 void on_pbMemoryEditor_clicked(); 89 90 void on_pbReserved1_clicked(); 91 void on_pbReserved2_clicked(); 92 void on_pbReserved3_clicked(); 93 void on_pbReserved4_clicked(); 94 void on_pbReserved5_clicked(); 95 96 void toggleCodeBreakpoint(u32 addr); 97 }; 98 99 #endif // UIDEBUGCPU_H 100