[PATCH rtems-tools 8/8] TraceList.cc: Convert from C to C++

Ryan Long ryan.long at oarcorp.com
Fri Dec 3 14:47:59 UTC 2021


---
 tester/covoar/TraceList.cc | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/tester/covoar/TraceList.cc b/tester/covoar/TraceList.cc
index a4e29e6..51ecfd8 100644
--- a/tester/covoar/TraceList.cc
+++ b/tester/covoar/TraceList.cc
@@ -1,5 +1,6 @@
 #include "TraceList.h"
-#include <stdio.h>
+#include <iostream>
+#include <iomanip>
 
 namespace Trace {
 
@@ -20,7 +21,7 @@ namespace Trace {
       traceRange_t t;
 
       t.lowAddress = lowAddressArg;
-      t.length = highAddressArg - lowAddressArg;
+      t.length     = highAddressArg - lowAddressArg;
       t.exitReason = why;
 
       set.push_back( t );
@@ -28,12 +29,9 @@ namespace Trace {
 
     void TraceList::ShowTrace( traceRange_t *t)
     {
-      printf(
-        "Start 0x%x, length 0x%03x Reason %d\n",
-        t->lowAddress,
-        t->length,
-        t->exitReason
-      );
+      std::cout << std::hex << "Start 0x" << t->lowAddress
+                << ", length 0x" << std::setfill( '0' ) << std::setw( 3 )
+                << t->length << " Reason " << t->exitReason << std::endl;
     }
 
     void  TraceList::ShowList()
-- 
1.8.3.1



More information about the devel mailing list