DebuggerForm.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. #ifndef DEBUGGERFORM_H
  2. #define DEBUGGERFORM_H
  3. #include "DockManager.h"
  4. #include "DebugSession.h"
  5. #include <QMainWindow>
  6. #include <QMap>
  7. class DockableWidgetArea;
  8. class DisasmViewer;
  9. class MainMemoryViewer;
  10. class CPURegsViewer;
  11. class FlagsViewer;
  12. class StackViewer;
  13. class SlotViewer;
  14. class CommClient;
  15. class QAction;
  16. class QMenu;
  17. class QToolBar;
  18. class VDPStatusRegViewer;
  19. class VDPRegViewer;
  20. class VDPCommandRegViewer;
  21. class DebuggerForm : public QMainWindow
  22. {
  23. Q_OBJECT;
  24. public:
  25. DebuggerForm(QWidget* parent = 0);
  26. ~DebuggerForm();
  27. public slots:
  28. void showAbout();
  29. private:
  30. void closeEvent(QCloseEvent* e);
  31. void createActions();
  32. void createMenus();
  33. void createToolbars();
  34. void createStatusbar();
  35. void createForm();
  36. void openSession(const QString& file);
  37. void updateRecentFiles();
  38. void addRecentFile(const QString& file);
  39. void removeRecentFile(const QString& file);
  40. void finalizeConnection(bool halted);
  41. void pauseStatusChanged(bool isPaused);
  42. void breakOccured();
  43. void setBreakMode();
  44. void setRunMode();
  45. void updateData();
  46. void refreshBreakpoints();
  47. void addressSlot(int addr, int& ps, int& ss, int& segment);
  48. QMenu* fileMenu;
  49. QMenu* systemMenu;
  50. QMenu* searchMenu;
  51. QMenu* viewMenu;
  52. QMenu* viewVDPDialogsMenu;
  53. QMenu* executeMenu;
  54. QMenu* breakpointMenu;
  55. QMenu* helpMenu;
  56. QToolBar* systemToolbar;
  57. QToolBar* executeToolbar;
  58. QAction* fileNewSessionAction;
  59. QAction* fileOpenSessionAction;
  60. QAction* fileSaveSessionAction;
  61. QAction* fileSaveSessionAsAction;
  62. QAction* fileQuitAction;
  63. enum { MaxRecentFiles = 5 };
  64. QAction *recentFileActions[MaxRecentFiles];
  65. QAction *recentFileSeparator;
  66. QAction* systemConnectAction;
  67. QAction* systemDisconnectAction;
  68. QAction* systemPauseAction;
  69. QAction* systemRebootAction;
  70. QAction* systemSymbolManagerAction;
  71. QAction* systemPreferencesAction;
  72. QAction* searchGotoAction;
  73. QAction* viewRegistersAction;
  74. QAction* viewFlagsAction;
  75. QAction* viewStackAction;
  76. QAction* viewSlotsAction;
  77. QAction* viewMemoryAction;
  78. QAction* viewDebuggableViewerAction;
  79. QAction* viewBitMappedAction;
  80. QAction* viewVDPStatusRegsAction;
  81. QAction* viewVDPRegsAction;
  82. QAction* viewVDPCommandRegsAction;
  83. QAction* executeBreakAction;
  84. QAction* executeRunAction;
  85. QAction* executeStepAction;
  86. QAction* executeStepOverAction;
  87. QAction* executeRunToAction;
  88. QAction* executeStepOutAction;
  89. QAction* executeStepBackAction;
  90. QAction* breakpointToggleAction;
  91. QAction* breakpointAddAction;
  92. QAction* helpAboutAction;
  93. DockManager dockMan;
  94. DockableWidgetArea* mainArea;
  95. QStringList recentFiles;
  96. DisasmViewer* disasmView;
  97. MainMemoryViewer* mainMemoryView;
  98. CPURegsViewer* regsView;
  99. FlagsViewer* flagsView;
  100. StackViewer* stackView;
  101. SlotViewer* slotView;
  102. VDPStatusRegViewer* VDPStatusRegView;
  103. VDPRegViewer* VDPRegView;
  104. VDPCommandRegViewer* VDPCommandRegView;
  105. CommClient& comm;
  106. DebugSession session;
  107. MemoryLayout memLayout;
  108. unsigned char* mainMemory;
  109. bool mergeBreakpoints;
  110. QMap<QString, int> debuggables;
  111. private slots:
  112. void fileNewSession();
  113. void fileOpenSession();
  114. void fileSaveSession();
  115. void fileSaveSessionAs();
  116. void fileRecentOpen();
  117. void systemConnect();
  118. void systemDisconnect();
  119. void systemPause();
  120. void systemReboot();
  121. void systemSymbolManager();
  122. void systemPreferences();
  123. void searchGoto();
  124. void toggleRegisterDisplay();
  125. void toggleFlagsDisplay();
  126. void toggleStackDisplay();
  127. void toggleSlotsDisplay();
  128. void toggleMemoryDisplay();
  129. void toggleBitMappedDisplay();
  130. void toggleVDPRegsDisplay();
  131. void toggleVDPStatusRegsDisplay();
  132. void toggleVDPCommandRegsDisplay();
  133. void addDebuggableViewer();
  134. void executeBreak();
  135. void executeRun();
  136. void executeStep();
  137. void executeStepOver();
  138. void executeRunTo();
  139. void executeStepOut();
  140. void executeStepBack();
  141. void breakpointToggle(int addr = -1);
  142. void breakpointAdd();
  143. void handleCommandReplyStatus(bool status);
  144. void toggleView(DockableWidget* widget);
  145. void initConnection();
  146. void handleUpdate(const QString& type, const QString& name,
  147. const QString& message);
  148. void setDebuggables(const QString& list);
  149. void setDebuggableSize(const QString& debuggable, int size);
  150. void connectionClosed();
  151. void dockWidgetVisibilityChanged(DockableWidget* w);
  152. void updateViewMenu();
  153. void updateVDPViewMenu();
  154. void updateWindowTitle();
  155. void symbolFileChanged();
  156. friend class QueryPauseHandler;
  157. friend class QueryBreakedHandler;
  158. friend class ListBreakPointsHandler;
  159. friend class CPURegRequest;
  160. friend class ListDebuggablesHandler;
  161. friend class DebuggableSizeHandler;
  162. signals:
  163. void settingsChanged();
  164. void symbolsChanged();
  165. void debuggablesChanged(const QMap<QString, int>& list);
  166. void emulationChanged();
  167. };
  168. #endif // DEBUGGERFORM_H