| 1 | // File: memorytracepane.hcxx . . $ `<file>/memorytracepane.h`/ |
| 2 | /* |
| 3 | Pep8-1 is a virtual machine for writing machine language and assembly |
| 4 | language programs. |
| 5 | |
| 6 | Copyright (C) 2009 J. Stanley Warford, Pepperdine University |
| 7 | |
| 8 | This program is free software: you can redistribute it and/or modify |
| 9 | it under the terms of the GNU General Public License as published by |
| 10 | the Free Software Foundation, either version 3 of the License, or |
| 11 | (at your option) any later version. |
| 12 | |
| 13 | This program is distributed in the hope that it will be useful, |
| 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | GNU General Public License for more details. |
| 17 | |
| 18 | You should have received a copy of the GNU General Public License |
| 19 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 20 | */ |
| 21 | |
| 22 | #ifndef MEMORYTRACEPANE_H |
| 23 | #define MEMORYTRACEPANE_Hcxx . . $ `memorytracepane.h:23:9`! |
| 24 | |
| 25 | #include <QWidget> |
| 26 | #include <QGraphicsScene> |
| 27 | #include <QStack> |
| 28 | #include <QSet> |
| 29 | #include "memorycellgraphicsitem.h"cxx . . $ `<file>/memorycellgraphicsitem.h`/ |
| 30 | #include "enu.h"cxx . . $ `<file>/enu.h`/ |
| 31 | #include "stackframefsm.h"cxx . . $ `<file>/stackframefsm.h`/ |
| 32 | |
| 33 | namespace Uicxx . . $ Ui/ { |
| 34 | class MemoryTracePanecxx . . $ Ui/MemoryTracePane#; |
| 35 | } |
| 36 | |
| 37 | class MemoryTracePanecxx . . $ MemoryTracePane# : public QWidgetcxx . . $ QWidget# { |
| 38 | Q_OBJECTcxx . . $ MemoryTracePane#staticMetaObject. |
| 39 | Q_DISABLE_COPYcxx . . $ MemoryTracePane#MemoryTracePane(443e48847f79752e).(MemoryTracePane) |
| 40 | public: |
| 41 | explicit MemoryTracePanecxx . . $ MemoryTracePane#MemoryTracePane(108f35f7aa7f3cf9).(QWidgetcxx . . $ QWidget# *parent = 0); |
| 42 | virtual ~cxx . . $ MemoryTracePane#`~MemoryTracePane`(ced63f7c635d850d).MemoryTracePanecxx . . $ MemoryTracePane#(); |
| 43 | |
| 44 | void setMemoryTracecxx . . $ MemoryTracePane#setMemoryTrace(49f6e7a06ebc5aa8).(); |
| 45 | // The memory trace is populated (on assembly). |
| 46 | |
| 47 | void updateMemoryTracecxx . . $ MemoryTracePane#updateMemoryTrace(49f6e7a06ebc5aa8).(); |
| 48 | // Post: The memory trace is updated |
| 49 | |
| 50 | void cacheChangescxx . . $ MemoryTracePane#cacheChanges(49f6e7a06ebc5aa8).(); |
| 51 | // Post: Modfied bytes are cached for updating the sim view |
| 52 | |
| 53 | void cacheStackChangescxx . . $ MemoryTracePane#cacheStackChanges(49f6e7a06ebc5aa8).(); |
| 54 | // Post: Stack changes are cached for the next time the simulation view is updated |
| 55 | |
| 56 | void cacheHeapChangescxx . . $ MemoryTracePane#cacheHeapChanges(49f6e7a06ebc5aa8).(); |
| 57 | // Post: Heap changes are cached for the next time the simulation view is updated |
| 58 | |
| 59 | void highlightOnFocuscxx . . $ MemoryTracePane#highlightOnFocus(49f6e7a06ebc5aa8).(); |
| 60 | // Post: Highlights the label based on the label window color saved in the UI file |
| 61 | |
| 62 | bool hasFocuscxx . . $ MemoryTracePane#hasFocus(c9857a73d68e59ba).(); |
| 63 | // Post: returns if the pane has focus |
| 64 | |
| 65 | void setFocuscxx . . $ MemoryTracePane#setFocus(49f6e7a06ebc5aa8).(); |
| 66 | // Post: the graphics item has focus |
| 67 | |
| 68 | public slotscxx . . $ `<external>/1208926524888476972/qobjectdefs.h:88:14`!: |
| 69 | void onFontChangedcxx . . $ MemoryTracePane#onFontChanged(19c44da831d1de49).(QFontcxx . . $ QFont# font); |
| 70 | |
| 71 | private: |
| 72 | Uicxx . . $ Ui/::MemoryTracePanecxx . . $ Ui/MemoryTracePane# *uicxx . . $ MemoryTracePane#ui.; |
| 73 | |
| 74 | QGraphicsScenecxx . . $ QGraphicsScene# *scenecxx . . $ MemoryTracePane#scene.; |
| 75 | QStackcxx . . $ QStack#<MemoryCellGraphicsItemcxx . . $ MemoryCellGraphicsItem# *> globalVarscxx . . $ MemoryTracePane#globalVars.; |
| 76 | // Stack of the global variables |
| 77 | QStackcxx . . $ QStack#<MemoryCellGraphicsItemcxx . . $ MemoryCellGraphicsItem# *> runtimeStackcxx . . $ MemoryTracePane#runtimeStack.; |
| 78 | // Stack of the stack items |
| 79 | QStackcxx . . $ QStack#<MemoryCellGraphicsItemcxx . . $ MemoryCellGraphicsItem# *> heapcxx . . $ MemoryTracePane#heap.; |
| 80 | // Stack of heap items |
| 81 | QStackcxx . . $ QStack#<bool> isRuntimeStackItemAddedStackcxx . . $ MemoryTracePane#isRuntimeStackItemAddedStack.; |
| 82 | // Used to keep track if the item has been added to the scene yet for the runtime stack |
| 83 | QStackcxx . . $ QStack#<bool> isHeapItemAddedStackcxx . . $ MemoryTracePane#isHeapItemAddedStack.; |
| 84 | // Used to keep track if the item has been added to the scene yet for the heap |
| 85 | QStringListcxx . . $ QStringList# lookAheadSymbolListcxx . . $ MemoryTracePane#lookAheadSymbolList.; |
| 86 | // This is used to give us what we're pushing onto the stack before we get there. |
| 87 | // It must be a look-ahead list because of branching and the inability to look behind |
| 88 | |
| 89 | // Stack frame |
| 90 | QMapcxx . . $ QMap#<int, QGraphicsRectItemcxx . . $ QGraphicsRectItem# *> stackHeightToStackFrameMapcxx . . $ MemoryTracePane#stackHeightToStackFrameMap.; |
| 91 | QStackcxx . . $ QStack#<int> numCellsInStackFramecxx . . $ MemoryTracePane#numCellsInStackFrame.; |
| 92 | // This is a stack of ints that each represent how many cells each stack frame encompass |
| 93 | QStackcxx . . $ QStack#<bool> isStackFrameAddedStackcxx . . $ MemoryTracePane#isStackFrameAddedStack.; |
| 94 | // Stack used to determine if a stack frame has been added to the scene yet |
| 95 | QStackcxx . . $ QStack#<QGraphicsRectItemcxx . . $ QGraphicsRectItem# *> graphicItemsInStackFramecxx . . $ MemoryTracePane#graphicItemsInStackFrame.; |
| 96 | // Stack of *items used to access the stack frames |
| 97 | QStackcxx . . $ QStack#<bool> isHeapFrameAddedStackcxx . . $ MemoryTracePane#isHeapFrameAddedStack.; |
| 98 | // Stack used to determine if a heap frame has been added to the scene yet |
| 99 | QStackcxx . . $ QStack#<QGraphicsRectItemcxx . . $ QGraphicsRectItem# *> heapFrameItemStackcxx . . $ MemoryTracePane#heapFrameItemStack.; |
| 100 | // Stack of *items for the heap graphic frames |
| 101 | |
| 102 | QPointFcxx . . $ QPointF# globalLocationcxx . . $ MemoryTracePane#globalLocation.; |
| 103 | // This is the location where the next global item will be added |
| 104 | QPointFcxx . . $ QPointF# stackLocationcxx . . $ MemoryTracePane#stackLocation.; |
| 105 | // This is the location where the next stack item will be added |
| 106 | QPointFcxx . . $ QPointF# heapLocationcxx . . $ MemoryTracePane#heapLocation.; |
| 107 | // This is the location where the next heap item will be added |
| 108 | |
| 109 | QMapcxx . . $ QMap#<int, MemoryCellGraphicsItemcxx . . $ MemoryCellGraphicsItem# *> addressToGlobalItemMapcxx . . $ MemoryTracePane#addressToGlobalItemMap.; |
| 110 | // This map is used to identify if an address is in the globals |
| 111 | QMapcxx . . $ QMap#<int, MemoryCellGraphicsItemcxx . . $ MemoryCellGraphicsItem# *> addressToStackItemMapcxx . . $ MemoryTracePane#addressToStackItemMap.; |
| 112 | // This map is used to identify if an address is part of the stack |
| 113 | QMapcxx . . $ QMap#<int, MemoryCellGraphicsItemcxx . . $ MemoryCellGraphicsItem# *> addressToHeapItemMapcxx . . $ MemoryTracePane#addressToHeapItemMap.; |
| 114 | // Used to identify if an address is part of the heap |
| 115 | QSetcxx . . $ QSet#<int> modifiedBytescxx . . $ MemoryTracePane#modifiedBytes.; |
| 116 | // This set is used to cache modified bytes since the last update |
| 117 | QListcxx . . $ QList#<int> bytesWrittenLastStepcxx . . $ MemoryTracePane#bytesWrittenLastStep.; |
| 118 | // This list is used to keep track of the bytes changed last step for highlighting purposes |
| 119 | bool delayLastStepClearcxx . . $ MemoryTracePane#delayLastStepClear.; |
| 120 | // This is used to delay the clear of the bytesWrittenLastStep list for purposes of highlighting after a trap |
| 121 | |
| 122 | QListcxx . . $ QList#<MemoryCellGraphicsItemcxx . . $ MemoryCellGraphicsItem# *> newestHeapItemsListcxx . . $ MemoryTracePane#newestHeapItemsList.; |
| 123 | // This is used to color the most recently new'd heap items light green |
| 124 | |
| 125 | StackFrameFSMcxx . . $ StackFrameFSM# stackFrameFSMcxx . . $ MemoryTracePane#stackFrameFSM.; |
| 126 | |
| 127 | // Called by the cacheStack/HeapChanges functions to add frames to the respective places. |
| 128 | // They're in their own functions because a fair bit happens there. |
| 129 | void addStackFramecxx . . $ MemoryTracePane#addStackFrame(d4f767463ce0a6b3).(int numCells); |
| 130 | void addHeapFramecxx . . $ MemoryTracePane#addHeapFrame(d4f767463ce0a6b3).(int numCells); |
| 131 | |
| 132 | void moveHeapUpOneCellcxx . . $ MemoryTracePane#moveHeapUpOneCell(49f6e7a06ebc5aa8).(); |
| 133 | // Moves the heap frame up n cells to accomodate for new items being added. |
| 134 | |
| 135 | void popBytescxx . . $ MemoryTracePane#popBytes(d4f767463ce0a6b3).(int bytesToPop); |
| 136 | // This pops bytesToPop bytes off of the runtimeStack |
| 137 | |
| 138 | void mouseReleaseEventcxx . . $ MemoryTracePane#mouseReleaseEvent(702858a82d06265c).(QMouseEventcxx . . $ QMouseEvent# *); |
| 139 | void mouseDoubleClickEventcxx . . $ MemoryTracePane#mouseDoubleClickEvent(702858a82d06265c).(QMouseEventcxx . . $ QMouseEvent# *); |
| 140 | |
| 141 | private slotscxx . . $ `<external>/1208926524888476972/qobjectdefs.h:88:14`!: |
| 142 | void zoomFactorChangedcxx . . $ MemoryTracePane#zoomFactorChanged(d4f767463ce0a6b3).(int factor); |
| 143 | |
| 144 | signalscxx . . $ `<external>/1208926524888476972/qobjectdefs.h:89:14`!: |
| 145 | void labelDoubleClickedcxx . . $ MemoryTracePane#labelDoubleClicked(d9b7ee7ebef3c77).(Enucxx . . $ Enu/::EPanecxx . . $ Enu/EPane# pane); |
| 146 | |
| 147 | }; |
| 148 | |
| 149 | #endif // MEMORYTRACEPANE_H |