|
OpenASIP 2.2
|
#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. | |
| ProximDisassemblyGridTable * | codeTable_ |
| Grid table which handles on-the-fly disassembly of the loaded program. | |
| std::map< unsigned, std::string > | menuCommand_ |
| A map which contains command strings for context menu items. | |
Static Private Attributes | |
| static const unsigned | INFO_COLUMN_WIDTH = 30 |
| Width of the column displaying the arrow pointign current instruction. | |
| static const unsigned | ADDRESS_COLUMN_WIDTH = 60 |
| Width of the instruction address column. | |
| static const unsigned | BP_COLUMN_WIDTH = 80 |
| Width of the breakpoint info column. | |
| static const unsigned | DISASSEMBLY_COLUMN_WIDTH = 400 |
| Width of the instruction disassembly column. | |
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, codeTable_, ProximToolbox::frontend(), DisassemblyGridTable::loadProgram(), program, resetGrid(), ProximDisassemblyGridTable::setCurrentInstruction(), ProximDisassemblyGridTable::setStopPointManager(), ProximDisassemblyGridTable::showPCArrow(), and SimulatorFrontend::stopPointManager().
Referenced by onProgramLoaded().

|
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(), and menuCommand_.

|
private |
Updates disassembly window when a program is loaded to the simulator.
Definition at line 198 of file ProximDisassemblyWindow.cc.
References loadProgram(), and 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(), DisassemblyGridTable::addressOfRow(), codeGrid_, codeTable_, ProximToolbox::frontend(), StopPoint::isEnabled(), MENU_ID_FIRST_MAPPED, MENU_ID_RUN_UNTIL, MENU_ID_SET_BP, MENU_ID_SET_TEMP_BP, menuCommand_, 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 DisassemblyGridTable::addressOfRow(), codeGrid_, codeTable_, 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 DisassemblyGridTable::addressOfRow(), codeGrid_, codeTable_, 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 DisassemblyGridTable::addressOfRow(), codeGrid_, codeTable_, 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.
References codeGrid_.
|
private |
Updates the arrow displaying the current instruction when the simulation stops.
Definition at line 328 of file ProximDisassemblyWindow.cc.
References codeGrid_, codeTable_, ProximDisassemblyGridTable::moveCellAttrProvider(), ProximDisassemblyGridTable::setCurrentInstruction(), and ProximDisasmAttrProvider::update().

|
virtual |
Called when the simulator program, machine and memory models are deleted.
Reimplemented from ProximSimulatorWindow.
Definition at line 155 of file ProximDisassemblyWindow.cc.
References codeGrid_, and codeTable_.
|
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.
References codeGrid_, and codeTable_.
Referenced by loadProgram().
| void ProximDisassemblyWindow::setMoveAttrProvider | ( | ProximDisasmAttrProvider * | attrProvider | ) |
Sets the move cell attribute provider.
| attrProvider | New attribute provider. |
Definition at line 391 of file ProximDisassemblyWindow.cc.
References codeTable_, and ProximDisassemblyGridTable::setMoveCellAttrProvider().
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.
References codeGrid_, codeTable_, and DisassemblyGridTable::rowOfAddress().
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.
Referenced by onRightClick(), onRunUntil(), onSetBreakpoint(), onSetTempBp(), onSimulatorCommand(), onSimulatorStop(), reset(), resetGrid(), and showAddress().
|
private |
Grid table which handles on-the-fly disassembly of the loaded program.
Definition at line 82 of file ProximDisassemblyWindow.hh.
Referenced by loadProgram(), onRightClick(), onRunUntil(), onSetBreakpoint(), onSetTempBp(), onSimulatorStop(), reset(), resetGrid(), setMoveAttrProvider(), and showAddress().
|
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.
Referenced by onMappedMenuCommand(), and onRightClick().