summaryrefslogtreecommitdiffstats
path: root/tester/covoar
diff options
context:
space:
mode:
authorRyan Long <ryan.long@oarcorp.com>2021-10-22 15:10:26 -0400
committerJoel Sherrill <joel@rtems.org>2021-12-15 08:04:43 -0600
commit366807c4a99f6f2af5115e08a70713734fdf61f3 (patch)
tree47da530a3fa0b8b06cc52be08cb799cde0ceeea8 /tester/covoar
parentObjdumpProcessor.h: Fix formatting (diff)
downloadrtems-tools-366807c4a99f6f2af5115e08a70713734fdf61f3.tar.bz2
SymbolTable.cc: Fix formatting
Diffstat (limited to 'tester/covoar')
-rw-r--r--tester/covoar/SymbolTable.cc70
1 files changed, 38 insertions, 32 deletions
diff --git a/tester/covoar/SymbolTable.cc b/tester/covoar/SymbolTable.cc
index cfbd7a3..a33a348 100644
--- a/tester/covoar/SymbolTable.cc
+++ b/tester/covoar/SymbolTable.cc
@@ -30,9 +30,9 @@ namespace Coverage {
const uint32_t length
)
{
- uint32_t end = 0;
- symbol_entry_t entry;
- symbolInfo_t symbolData;
+ uint32_t end = 0;
+ symbol_entry_t entry;
+ symbolInfo_t symbolData;
// Add an entry to the address map.
end = start + length - 1;
@@ -45,14 +45,14 @@ namespace Coverage {
symbolData.startingAddress = start;
symbolData.length = length;
- for (auto& symData : info[ symbol ]) {
+ for ( auto& symData : info[ symbol ] ) {
// The starting address could differ since we strip any suffixes beginning
// with a '.'
- if (symData.startingAddress != start) {
+ if ( symData.startingAddress != start ) {
continue;
}
- if (symData.length != length) {
+ if ( symData.length != length ) {
std::ostringstream what;
what << "Different lengths for the symbol "
<< symbol
@@ -66,39 +66,36 @@ namespace Coverage {
info[ symbol ].push_back( symbolData );
}
- SymbolTable::symbolInfo* SymbolTable::getInfo(
- const std::string& symbol
- )
+ SymbolTable::symbolInfo* SymbolTable::getInfo( const std::string& symbol )
{
info_t::iterator it = info.find( symbol );
- if (it == info.end())
+ if ( it == info.end() ) {
return NULL;
- else
- return (&(it->second));
+ } else {
+ return ( &(it->second) );
+ }
}
- uint32_t SymbolTable::getLength(
- const std::string& symbol
- )
+ uint32_t SymbolTable::getLength( const std::string& symbol )
{
info_t::iterator it = info.find( symbol );
- if (it == info.end())
+ if ( it == info.end() ) {
return 0;
- else
- return ((*it).second.front().length);
+ } else {
+ return ( (*it).second.front().length );
+ }
}
- std::string SymbolTable::getSymbol(
- uint32_t address
- )
+ std::string SymbolTable::getSymbol( uint32_t address )
{
contents_t::iterator it;
// Ensure that the symbol table is not empty.
- if ( contents.size() == 0 )
+ if ( contents.size() == 0 ) {
return "";
+ }
// Find the first entry whose end address is greater
// than the specified address.
@@ -106,23 +103,32 @@ namespace Coverage {
// If an entry was found and its low address is less than or
// equal to the specified address, then return the symbol.
- if ((it != contents.end()) && ((it->second).low <= address ))
+ if ( ( it != contents.end() ) && ( ( it->second ).low <= address ) ) {
return (it->second).symbol;
+ }
return "";
}
void SymbolTable::dumpSymbolTable( void )
{
- symbolInfo symbolTable;
- symbolInfoIterator_t symbolIterator;
- infoIterator_t infoIterator;
-
- for (infoIterator = info.begin() ; infoIterator != info.end(); infoIterator++)
- {
- for (symbolIterator = infoIterator->second.begin() ; symbolIterator != infoIterator->second.end(); symbolIterator++)
- {
- fprintf( stdout, "%s:\tStarting address = %#x\tLength = %u\n", infoIterator->first.c_str(), symbolIterator->startingAddress, symbolIterator->length );
+ symbolInfo symbolTable;
+ symbolInfoIterator_t symbolIterator;
+ infoIterator_t infoIterator;
+
+ for (
+ infoIterator = info.begin();
+ infoIterator != info.end();
+ infoIterator++
+ ) {
+ for (
+ symbolIterator = infoIterator->second.begin();
+ symbolIterator != infoIterator->second.end();
+ symbolIterator++
+ ) {
+ std::cerr << infoIterator->first << ":\tStarting address = 0x"
+ << std::hex << symbolIterator->startingAddress << std::dec
+ << "\tLength = " << symbolIterator->length << std::endl;
}
}
}