OpenASIP 2.2
Loading...
Searching...
No Matches
TPEFDumper.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 TPEFDumper.cc
26 *
27 * Class for outputting TPEF sections in textual format.
28 *
29 * @author Mikael Lepistö 2005 (tmlepist-no.spam-tut.fi)
30 * @rating red
31 */
32
33#include <ostream>
34
35#include "Binary.hh"
36#include "SymbolElement.hh"
37#include "RelocElement.hh"
38#include "ResourceElement.hh"
39#include "DebugElement.hh"
40
41namespace TPEF {
42 class SectionElement;
43 class Section;
44 class SectionElement;
45 class ASpaceElement;
46}
47
48/**
49 * Outputs TPEF hierarchy in textual form.
50 */
52
53public:
54 TPEFDumper(TPEF::Binary& tpef, std::ostream& out);
55 virtual ~TPEFDumper();
56
57 void setOnlyLogical(bool flag);
58 bool onlyLogical() const;
59
60 void fileHeaders();
61 void sectionHeaders();
62 void memoryInfo();
63 void relocationTables();
64 void symbolTables();
65 void section(Word sectionIndex);
66
67private:
69 Word actualIndex(Word logicalIndex) const;
70
71 std::string sectionHeader();
72 std::string sectionHeader(TPEF::Section &sect, bool noIndex = false);
73 void section(TPEF::Section &sect);
74
77
78 std::string sectionString(TPEF::Section &sect, bool shortForm = false);
79 std::string addressSpaceString(TPEF::ASpaceElement& aSpace);
80 std::string symbolString(TPEF::Section& sect, TPEF::SymbolElement& sym);
81
82 std::string sectionTypeString(
83 TPEF::Section::SectionType type, bool shortForm = false);
84
86
88
89 std::string fileTypeString(TPEF::Binary::FileType type);
90
92
94
96
98
99 std::string resourceIdString(
100 HalfWord id, TPEF::ResourceElement::ResourceType type);
101
102 void dumpStringSet(std::set<std::string> &aSet) const;
103
104 std::vector<Word> actualIndexes_;
105
107 std::ostream &out_;
108
110};
void section(Word sectionIndex)
void createLogicalIndexes()
virtual ~TPEFDumper()
std::string sectionString(TPEF::Section &sect, bool shortForm=false)
void fileHeaders()
std::vector< Word > actualIndexes_
std::string resourceIdString(HalfWord id, TPEF::ResourceElement::ResourceType type)
std::string debugElementTypeString(TPEF::DebugElement::ElementType type)
std::string addressSpaceString(TPEF::ASpaceElement &aSpace)
std::string symbolString(TPEF::Section &sect, TPEF::SymbolElement &sym)
std::string fileTypeString(TPEF::Binary::FileType type)
void sectionHeaders()
int findElementIndex(TPEF::Section &sect, TPEF::SectionElement &elem)
std::string symbolTypeString(TPEF::SymbolElement::SymbolType type)
void symbolTables()
std::string resourceTypeString(TPEF::ResourceElement::ResourceType type)
std::string relocTypeString(TPEF::RelocElement::RelocType type)
std::string sectionHeader()
bool onlyLogicalInfo_
void setOnlyLogical(bool flag)
int findSectionIndex(TPEF::Section &sect)
TPEF::Binary & tpef_
std::string sectionTypeString(TPEF::Section::SectionType type, bool shortForm=false)
bool onlyLogical() const
void relocationTables()
Word actualIndex(Word logicalIndex) const
std::ostream & out_
void dumpStringSet(std::set< std::string > &aSet) const
std::string fileArchString(TPEF::Binary::FileArchitecture arch)
void memoryInfo()
std::string symbolBindString(TPEF::SymbolElement::SymbolBinding bind)
ResourceType
Resource types.
SymbolType
Type of symbol element.
SymbolBinding
Binding types of symbol.