OpenASIP
2.0
|
#include <DisassemblyGridTable.hh>
Public Member Functions | |
DisassemblyGridTable () | |
virtual | ~DisassemblyGridTable () |
virtual int | GetNumberRows () |
virtual int | GetNumberCols () |
virtual bool | IsEmptyCell (int row, int col) |
virtual wxString | GetValue (int row, int col) |
virtual wxString | GetRowLabelValue (int row) |
virtual wxString | GetColLabelValue (int col) |
virtual void | SetValue (int row, int col, const wxString &value) |
virtual bool | CanHaveAttributes () |
int | rowOfAddress (Word address) |
Word | addressOfRow (int row) |
void | loadProgram (const TTAProgram::Program &program) |
Protected Attributes | |
const TTAProgram::Program * | program_ |
Program loaded in the table. More... | |
Private Types | |
typedef std::multimap< int, std::string > | LabelMap |
Type for the labels multimap. More... | |
Private Attributes | |
POMDisassembler * | disassembler_ |
Disassembler for generating instruction disassemblies. More... | |
LabelMap | labels_ |
Program labels. More... | |
Grid table class which allows wxGrid to display disassembly of a tta program by disassembling only the currently visible instructions. Purpose of the 'lazy' disasembling is to conserve memory and processing time when the program is very large.
Definition at line 54 of file DisassemblyGridTable.hh.
|
private |
Type for the labels multimap.
Definition at line 77 of file DisassemblyGridTable.hh.
DisassemblyGridTable::DisassemblyGridTable | ( | ) |
The Constructor.
Definition at line 55 of file DisassemblyGridTable.cc.
|
virtual |
Word DisassemblyGridTable::addressOfRow | ( | int | row | ) |
Returns address of the instruction on a row.
row | Row of the instruction. |
Definition at line 254 of file DisassemblyGridTable.cc.
Referenced by ProximDisassemblyGridTable::GetAttr().
|
virtual |
Returns true if the grid cells can have attributes.
Definition at line 204 of file DisassemblyGridTable.cc.
|
virtual |
Returns column label of a grid column.
col | Column number. |
Reimplemented in ProximDisassemblyGridTable.
Definition at line 180 of file DisassemblyGridTable.cc.
References TTAMachine::Machine::busNavigator(), TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Machine::Navigator< ComponentType >::item(), program_, TTAProgram::Program::targetProcessor(), Conversion::toString(), and WxConversion::toWxString().
Referenced by ProximDisassemblyGridTable::GetColLabelValue().
|
virtual |
Returns column count of the grid.
Reimplemented in ProximDisassemblyGridTable.
Definition at line 92 of file DisassemblyGridTable.cc.
References TTAMachine::Machine::busNavigator(), TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Machine::immediateSlotNavigator(), program_, and TTAProgram::Program::targetProcessor().
Referenced by ProximDisassemblyGridTable::GetNumberCols().
|
virtual |
Returns row count of the grid.
The row count is limited to MAX_ROWS due to limtiations of wxGrid.
Reimplemented in ProximDisassemblyGridTable.
Definition at line 79 of file DisassemblyGridTable.cc.
References TTAProgram::Instruction::address(), TTAProgram::Program::firstInstruction(), TTAProgram::Program::lastInstruction(), TTAProgram::Address::location(), and program_.
Referenced by ProximDisassemblyGridTable::GetNumberRows().
|
virtual |
Returns row label of a grid row.
row | Row number. |
Definition at line 168 of file DisassemblyGridTable.cc.
References WxConversion::toWxString().
|
virtual |
Returns cell value as a wxString.
row | Row of the cell. |
col | Column of the cell. |
Reimplemented in ProximDisassemblyGridTable.
Definition at line 121 of file DisassemblyGridTable.cc.
References TTAMachine::Machine::busNavigator(), TTAMachine::Machine::Navigator< ComponentType >::count(), POMDisassembler::createInstruction(), disassembler_, labels_, DisassemblyInstruction::longImmediate(), DisassemblyInstruction::longImmediateCount(), DisassemblyInstruction::move(), program_, TTAProgram::Program::targetProcessor(), DisassemblyInstructionSlot::toString(), DisassemblyImmediateAssignment::toString(), and WxConversion::toWxString().
Referenced by ProximDisassemblyGridTable::GetValue().
|
virtual |
Returns true, if the given cell is empty, false otherwise.
row | Row of the cell. |
col | Column of the cell. |
Definition at line 108 of file DisassemblyGridTable.cc.
void DisassemblyGridTable::loadProgram | ( | const TTAProgram::Program & | program | ) |
Loads a new program in the grid table.
program | Program to load. |
Definition at line 224 of file DisassemblyGridTable.cc.
References TTAProgram::CodeLabel::address(), disassembler_, TTAProgram::GlobalScope::globalCodeLabel(), TTAProgram::GlobalScope::globalCodeLabelCount(), TTAProgram::Program::globalScopeConst(), labels_, TTAProgram::Address::location(), TTAProgram::Label::name(), program, and program_.
int DisassemblyGridTable::rowOfAddress | ( | Word | address | ) |
Returns row of the instruction with given address.
address | Address of the instruction. |
Definition at line 266 of file DisassemblyGridTable.cc.
|
virtual |
Not implemented, use setCellValue() instead.
Definition at line 213 of file DisassemblyGridTable.cc.
|
private |
Disassembler for generating instruction disassemblies.
Definition at line 74 of file DisassemblyGridTable.hh.
Referenced by GetValue(), loadProgram(), and ~DisassemblyGridTable().
|
private |
Program labels.
Definition at line 80 of file DisassemblyGridTable.hh.
Referenced by GetValue(), and loadProgram().
|
protected |
Program loaded in the table.
Definition at line 71 of file DisassemblyGridTable.hh.
Referenced by GetColLabelValue(), GetNumberCols(), GetNumberRows(), GetValue(), and loadProgram().