[PATCH rtems-tools v1 4/7] TraceReaderLogQEMU.cc: Fix formatting

Ryan Long ryan.long at oarcorp.com
Tue Sep 21 16:45:00 UTC 2021


---
 tester/covoar/TraceReaderLogQEMU.cc | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/tester/covoar/TraceReaderLogQEMU.cc b/tester/covoar/TraceReaderLogQEMU.cc
index c303d08..91ed5c7 100644
--- a/tester/covoar/TraceReaderLogQEMU.cc
+++ b/tester/covoar/TraceReaderLogQEMU.cc
@@ -53,8 +53,8 @@
 
 bool ReadUntilFound( std::ifstream& file, const char* line )
 {
-  char discardBuff[100];
-  size_t  len = strlen( line );
+  char   discardBuff[100];
+  size_t len = strlen( line );
 
   do {
     file.read( discardBuff, 99 );
@@ -62,9 +62,11 @@ bool ReadUntilFound( std::ifstream& file, const char* line )
       return false;
     }
 
-    if ( strncmp( discardBuff, line, len ) == 0 )
+    if ( strncmp( discardBuff, line, len ) == 0 ) {
       return true;
-  } while (1);
+    }
+
+  } while( 1 );
 }
 
 namespace Trace {
@@ -120,7 +122,7 @@ namespace Trace {
     //
     //  Discard Header section
     //
-    if (! ReadUntilFound( logFile, QEMU_LOG_SECTION_END ) ) {
+    if ( !ReadUntilFound( logFile, QEMU_LOG_SECTION_END ) ) {
       std::cerr << "Unable to locate end of log file header" << std::endl;
       return false;
     }
@@ -128,7 +130,7 @@ namespace Trace {
     //
     //  Find first IN block
     //
-    if (! ReadUntilFound( logFile, QEMU_LOG_IN_KEY )){
+    if ( !ReadUntilFound( logFile, QEMU_LOG_IN_KEY ) ) {
       std::cerr << "Error: Unable to locate first IN: Block in Log file"
                 << std::endl;
       return false;
@@ -143,12 +145,11 @@ namespace Trace {
             >> first.data;
 
     if ( logFile.fail() ) {
-      std::cerr << "Error Unable to Read Initial First Block"
-                << std::endl;
+      std::cerr << "Error Unable to Read Initial First Block" << std::endl;
       done = true;
     }
 
-    while (!done) {
+    while ( !done ) {
 
       last = first;
 
@@ -160,9 +161,9 @@ namespace Trace {
                 >> last.data;
       } while( !logFile.fail() );
 
-      nextlogical = objdumpProcessor.getAddressAfter(last.address);
+      nextlogical = objdumpProcessor.getAddressAfter( last.address );
 
-      if (! ReadUntilFound( logFile, QEMU_LOG_IN_KEY )) {
+      if ( !ReadUntilFound( logFile, QEMU_LOG_IN_KEY ) ) {
         done = true;
         nextExecuted = last;
       } else {
@@ -178,7 +179,7 @@ namespace Trace {
 
       // If the nextlogical was not found we are throwing away
       // the block; otherwise add the block to the trace list.
-      if (nextlogical != 0) {
+      if ( nextlogical != 0 ) {
         TraceList::exitReason_t reason = TraceList::EXIT_REASON_OTHER;
 
         if ( objdumpProcessor.IsBranch( last.instruction ) ) {
-- 
1.8.3.1



More information about the devel mailing list