--- tester/covoar/TraceWriterQEMU.cc | 47 +++++++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 18 deletions(-)
diff --git a/tester/covoar/TraceWriterQEMU.cc b/tester/covoar/TraceWriterQEMU.cc index d14260f..1f0e719 100644 --- a/tester/covoar/TraceWriterQEMU.cc +++ b/tester/covoar/TraceWriterQEMU.cc @@ -60,9 +60,9 @@ namespace Trace { } bool TraceWriterQEMU::writeFile( - const std::string& file, - Trace::TraceReaderBase *log, - bool verbose + const std::string& file, + Trace::TraceReaderBase* log, + bool verbose ) { struct trace_header header; @@ -96,13 +96,13 @@ namespace Trace { // // Write the Header to the file // - strncpy( header.magic, QEMU_TRACE_MAGIC, sizeof(header.magic) ); - header.version = QEMU_TRACE_VERSION; - header.kind = QEMU_TRACE_KIND_RAW; // XXX ?? + strncpy( header.magic, QEMU_TRACE_MAGIC, sizeof( header.magic ) ); + header.version = QEMU_TRACE_VERSION; + header.kind = QEMU_TRACE_KIND_RAW; // XXX ?? header.sizeof_target_pc = 32; - header.big_endian = false; - header.machine[0] = 0; // XXX ?? - header.machine[1] = 0; // XXX ?? + header.big_endian = false; + header.machine[0] = 0; // XXX ?? + header.machine[1] = 0; // XXX ?? traceFile.write( (char *) &header, sizeof( trace_header ) ); if ( traceFile.fail() ) { @@ -110,35 +110,42 @@ namespace Trace { return false; } - if (verbose) + if ( verbose ) { std::cerr << "magic = " << QEMU_TRACE_MAGIC << std::endl << "version = " << header.version << std::endl << "kind = " << header.kind << std::endl << "sizeof_target_pc = " << header.sizeof_target_pc << std::endl << "big_endian = " << header.big_endian << std::endl - << std::hex << std::setfill('0') - << "machine = " << std::setw(2) << header.machine[0] + << std::hex << std::setfill( '0' ) + << "machine = " << std::setw( 2 ) << header.machine[0] << ':' << header.machine[1] - << std::dec << std::setfill(' ') + << std::dec << std::setfill( ' ' ) << std::endl; + } // // Loop through log and write each entry. // <<<<<<< HEAD +<<<<<<< HEAD for (const auto & itr : log->Trace.set) { struct trace_entry32 entry; ======= for ( const auto& itr : log->Trace.set ) { struct trace_entry32 entry; >>>>>>> cdf7855... TraceWriterQEMU.cc: Fix +======= + for ( const auto & itr : log->Trace.set ) { + struct trace_entry32 entry; +>>>>>>> 4d16457... TraceWriterQEMU.cc: Fix formatting entry._pad[0] = 0; entry.pc = itr.lowAddress; entry.size = itr.length; entry.op = TRACE_OP_BLOCK; - switch (itr.exitReason) { + + switch ( itr.exitReason ) { case TraceList::EXIT_REASON_BRANCH_TAKEN: entry.op |= taken; break; @@ -148,15 +155,19 @@ namespace Trace { case TraceList::EXIT_REASON_OTHER: break; default: - throw rld::error( "Unknown exit Reason", "TraceWriterQEMU::writeFile" ); + throw rld::error( + "Unknown exit Reason", + "TraceWriterQEMU::writeFile" + ); break; } - if ( verbose ) - std::cerr << std::hex << std::setfill('0') + if ( verbose ) { + std::cerr << std::hex << std::setfill( '0' ) << entry.pc << ' ' << entry.size << ' ' << entry.op - << std::dec << std::setfill(' ') + << std::dec << std::setfill( ' ' ) << std::endl; + } traceFile.write( (char *) &entry, sizeof( entry ) ); if ( traceFile.fail() ) { -- 1.8.3.1 _______________________________________________ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel