OpenASIP 2.2
Loading...
Searching...
No Matches
ProximDisassemblyWindow.hh
Go to the documentation of this file.
1/*
2 Copyright (c) 2002-2009 Tampere University.
3
4 This file is part of TTA-Based Codesign Environment (TCE).
5
6 Permission is hereby granted, free of charge, to any person obtaining a
7 copy of this software and associated documentation files (the "Software"),
8 to deal in the Software without restriction, including without limitation
9 the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 and/or sell copies of the Software, and to permit persons to whom the
11 Software is furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 DEALINGS IN THE SOFTWARE.
23 */
24/**
25 * @file ProximDisassemblyWindow.cc
26 *
27 * Declaration of ProximDisassemblyWindow class.
28 *
29 * @author Veli-Pekka Jääskeläinen 2005 (vjaaskel-no.spam-cs.tut.fi)
30 * @note rating: red
31 */
32
33
34#ifndef TTA_PROXIM_DISASSEMBLY_WINDOW_HH
35#define TTA_PROXIM_DISASSEMBLY_WINDOW_HH
36
37#include <map>
38#include <wx/wx.h>
39#include <wx/grid.h>
40#include "SimulatorEvent.hh"
42
43class ProximMainFrame;
46
47namespace TTAProgram {
48 class Program;
49}
50
51/**
52 * A window which can be utilized to display disassembly of a program object
53 * model.
54 *
55 * This class listens to SimulatorEvents and updates the window information
56 * automatically.
57 */
59public:
62 virtual void reset();
64 void showAddress(unsigned address);
66
67private:
68 void initialize();
69 void resetGrid();
70 void onProgramLoaded(const SimulatorEvent& event);
71 void onSimulatorStop(const SimulatorEvent& event);
73 void onRightClick(wxGridEvent& event);
74 void onSetBreakpoint(wxCommandEvent& event);
75 void onSetTempBp(wxCommandEvent& event);
76 void onRunUntil(wxCommandEvent& event);
77 void onMappedMenuCommand(wxCommandEvent& event);
78
79 /// The grid disapleying the disassembly.
80 wxGrid* codeGrid_;
81 /// Grid table which handles on-the-fly disassembly of the loaded program.
83
84 /// A map which contains command strings for context menu items.
85 std::map<unsigned, std::string> menuCommand_;
86
87 /// Width of the column displaying the arrow pointign current instruction.
88 static const unsigned INFO_COLUMN_WIDTH;
89 /// Width of the instruction address column.
90 static const unsigned ADDRESS_COLUMN_WIDTH;
91 /// Width of the breakpoint info column.
92 static const unsigned BP_COLUMN_WIDTH;
93 /// Width of the instruction disassembly column.
94 static const unsigned DISASSEMBLY_COLUMN_WIDTH;
95
96 /// Context menu command IDs.
97 enum {
101 MENU_ID_FIRST_MAPPED // Keep this as the last menu item.
102 };
103
104 DECLARE_EVENT_TABLE()
105};
106
107#endif
find Finds info of the inner loops in the program
void onSimulatorStop(const SimulatorEvent &event)
std::map< unsigned, std::string > menuCommand_
A map which contains command strings for context menu items.
void onSimulatorCommand(SimulatorEvent &event)
static const unsigned DISASSEMBLY_COLUMN_WIDTH
Width of the instruction disassembly column.
void loadProgram(const TTAProgram::Program &program)
ProximDisassemblyGridTable * codeTable_
Grid table which handles on-the-fly disassembly of the loaded program.
void setMoveAttrProvider(ProximDisasmAttrProvider *attrProvider)
void showAddress(unsigned address)
static const unsigned INFO_COLUMN_WIDTH
Width of the column displaying the arrow pointign current instruction.
void onRunUntil(wxCommandEvent &event)
void onSetTempBp(wxCommandEvent &event)
wxGrid * codeGrid_
The grid disapleying the disassembly.
static const unsigned ADDRESS_COLUMN_WIDTH
Width of the instruction address column.
void onMappedMenuCommand(wxCommandEvent &event)
void onRightClick(wxGridEvent &event)
void onSetBreakpoint(wxCommandEvent &event)
void onProgramLoaded(const SimulatorEvent &event)
static const unsigned BP_COLUMN_WIDTH
Width of the breakpoint info column.