OpenASIP
2.0
|
#include <ProximDisassemblyWindow.hh>
Public Member Functions | |
ProximDisassemblyWindow (ProximMainFrame *parent, int id) | |
virtual | ~ProximDisassemblyWindow () |
virtual void | reset () |
void | loadProgram (const TTAProgram::Program &program) |
void | showAddress (unsigned address) |
void | setMoveAttrProvider (ProximDisasmAttrProvider *attrProvider) |
Private Types | |
enum | { MENU_ID_SET_BP = 10000, MENU_ID_SET_TEMP_BP, MENU_ID_RUN_UNTIL, MENU_ID_FIRST_MAPPED } |
Context menu command IDs. More... | |
Private Member Functions | |
void | initialize () |
void | resetGrid () |
void | onProgramLoaded (const SimulatorEvent &event) |
void | onSimulatorStop (const SimulatorEvent &event) |
void | onSimulatorCommand (SimulatorEvent &event) |
void | onRightClick (wxGridEvent &event) |
void | onSetBreakpoint (wxCommandEvent &event) |
void | onSetTempBp (wxCommandEvent &event) |
void | onRunUntil (wxCommandEvent &event) |
void | onMappedMenuCommand (wxCommandEvent &event) |
Private Attributes | |
wxGrid * | codeGrid_ |
The grid disapleying the disassembly. More... | |
ProximDisassemblyGridTable * | codeTable_ |
Grid table which handles on-the-fly disassembly of the loaded program. More... | |
std::map< unsigned, std::string > | menuCommand_ |
A map which contains command strings for context menu items. More... | |
Static Private Attributes | |
static const unsigned | INFO_COLUMN_WIDTH = 30 |
Width of the column displaying the arrow pointign current instruction. More... | |
static const unsigned | ADDRESS_COLUMN_WIDTH = 60 |
Width of the instruction address column. More... | |
static const unsigned | BP_COLUMN_WIDTH = 80 |
Width of the breakpoint info column. More... | |
static const unsigned | DISASSEMBLY_COLUMN_WIDTH = 400 |
Width of the instruction disassembly column. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from ProximSimulatorWindow | |
ProximSimulatorWindow (ProximMainFrame *mainFrame, wxWindowID id=-1, wxPoint pos=wxDefaultPosition, wxSize size=wxDefaultSize, long style=wxTAB_TRAVERSAL) | |
virtual | ~ProximSimulatorWindow () |
A window which can be utilized to display disassembly of a program object model.
This class listens to SimulatorEvents and updates the window information automatically.
Definition at line 58 of file ProximDisassemblyWindow.hh.
|
private |
Context menu command IDs.
Enumerator | |
---|---|
MENU_ID_SET_BP | |
MENU_ID_SET_TEMP_BP | |
MENU_ID_RUN_UNTIL | |
MENU_ID_FIRST_MAPPED |
Definition at line 97 of file ProximDisassemblyWindow.hh.
ProximDisassemblyWindow::ProximDisassemblyWindow | ( | ProximMainFrame * | parent, |
int | id | ||
) |
Constructor.
parent | Parent window of the window. |
id | Window identifier. |
Definition at line 84 of file ProximDisassemblyWindow.cc.
|
virtual |
|
private |
Creates the window contents.
Definition at line 105 of file ProximDisassemblyWindow.cc.
void ProximDisassemblyWindow::loadProgram | ( | const TTAProgram::Program & | program | ) |
Loads a program model to the window.
program | Program to load. |
Definition at line 179 of file ProximDisassemblyWindow.cc.
References assert, ProximToolbox::frontend(), program, and SimulatorFrontend::stopPointManager().
|
private |
Event handler for breakpoint submenus of the context menu.
event | Menu event to handle. |
Definition at line 373 of file ProximDisassemblyWindow.cc.
References AssocTools::containsKey().
|
private |
Updates disassembly window when a program is loaded to the simulator.
Definition at line 198 of file ProximDisassemblyWindow.cc.
References ProximToolbox::program().
|
private |
Handles RMB clicks on the disassembly window.
A context menu is displayed at the cursor location.
Definition at line 209 of file ProximDisassemblyWindow.cc.
References Breakpoint::address(), ProximToolbox::frontend(), StopPoint::isEnabled(), MENU_ID_FIRST_MAPPED, StopPointManager::stopPointCount(), StopPointManager::stopPointHandle(), SimulatorFrontend::stopPointManager(), StopPointManager::stopPointWithHandleConst(), Conversion::toString(), and WxConversion::toWxString().
|
private |
Handles the context menu "run until" clicks.
Definition at line 314 of file ProximDisassemblyWindow.cc.
References ProximConstants::SCL_RUN_UNTIL, and Conversion::toString().
|
private |
Handles the event of adding new breakpoint with the context menu.
Definition at line 286 of file ProximDisassemblyWindow.cc.
References ProximConstants::SCL_SET_BREAKPOINT, and Conversion::toString().
|
private |
Handles the event of adding new temporary breakpoint with the context menu.
Definition at line 300 of file ProximDisassemblyWindow.cc.
References ProximConstants::SCL_SET_TEMP_BP, and Conversion::toString().
|
private |
Updates the disassembly window when a command is executed.
event | Event of a command execution. |
Definition at line 346 of file ProximDisassemblyWindow.cc.
|
private |
Updates the arrow displaying the current instruction when the simulation stops.
Definition at line 328 of file ProximDisassemblyWindow.cc.
|
virtual |
Called when the simulator program, machine and memory models are deleted.
Reimplemented from ProximSimulatorWindow.
Definition at line 155 of file ProximDisassemblyWindow.cc.
|
private |
Resets the grid. This function has to be called if a new program is loaded to the window.
Definition at line 117 of file ProximDisassemblyWindow.cc.
void ProximDisassemblyWindow::setMoveAttrProvider | ( | ProximDisasmAttrProvider * | attrProvider | ) |
Sets the move cell attribute provider.
attrProvider | New attribute provider. |
Definition at line 391 of file ProximDisassemblyWindow.cc.
Referenced by ClearDisassemblyHighlightCmd::Do(), HighlightExecPercentageCmd::Do(), and HighlightTopExecCountsCmd::Do().
void ProximDisassemblyWindow::showAddress | ( | unsigned | address | ) |
Selects the instruction at given address.
address | Address of the isntruction to show. |
Definition at line 359 of file ProximDisassemblyWindow.cc.
Referenced by ProximBreakpointWindow::onBreakpointLookup(), FindWindow::onFindNext(), FindWindow::onFindPrev(), FindWindow::onInputText(), and DisasmExecCountFrame::onSelection().
|
staticprivate |
Width of the instruction address column.
Definition at line 90 of file ProximDisassemblyWindow.hh.
|
staticprivate |
Width of the breakpoint info column.
Definition at line 92 of file ProximDisassemblyWindow.hh.
|
private |
The grid disapleying the disassembly.
Definition at line 80 of file ProximDisassemblyWindow.hh.
|
private |
Grid table which handles on-the-fly disassembly of the loaded program.
Definition at line 82 of file ProximDisassemblyWindow.hh.
|
staticprivate |
Width of the instruction disassembly column.
Definition at line 94 of file ProximDisassemblyWindow.hh.
|
staticprivate |
Width of the column displaying the arrow pointign current instruction.
Definition at line 88 of file ProximDisassemblyWindow.hh.
|
private |
A map which contains command strings for context menu items.
Definition at line 85 of file ProximDisassemblyWindow.hh.