From 0e341371ef7568246e7bf124b6d4e0f5400f3267 Mon Sep 17 00:00:00 2001 From: Dave Marples Date: Fri, 29 Nov 2024 12:17:34 +0000 Subject: [PATCH] Prettyprint fixups --- Inc/traceDecoder.h | 2 +- Src/loadelf.c | 13 +++++++------ Src/traceDecoder_etm4.c | 3 ++- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Inc/traceDecoder.h b/Inc/traceDecoder.h index 1940d94..9063540 100644 --- a/Inc/traceDecoder.h +++ b/Inc/traceDecoder.h @@ -145,7 +145,7 @@ struct TRACECPUState genericsReportCB report; // Debugging - uint64_t overflows; + uint64_t overflows; }; // ============================================================================ diff --git a/Src/loadelf.c b/Src/loadelf.c index fc9e7c1..e10652c 100644 --- a/Src/loadelf.c +++ b/Src/loadelf.c @@ -369,7 +369,8 @@ static void _processFunctionDie( struct symbol *p, Dwarf_Debug dbg, Dwarf_Die di attr_tag = DW_AT_abstract_origin; dwarf_attr( die, attr_tag, &attr_data, 0 ); dwarf_global_formref( attr_data, &abstract_origin_offset, 0 ); - if (DW_DLV_OK == dwarf_offdie_b( dbg, abstract_origin_offset, IS_INFO, &abstract_origin_die, 0 )) + + if ( DW_DLV_OK == dwarf_offdie_b( dbg, abstract_origin_offset, IS_INFO, &abstract_origin_die, 0 ) ) { isinline = true; } @@ -1045,13 +1046,13 @@ char *symbolDisassembleLine( struct symbol *p, enum instructionClass *ic, symbol ) ? LE_IC_JUMP : 0; /* create a copy to check if load in pc */ - char *copy = strdup(insn->op_str); + char *copy = strdup( insn->op_str ); *ic |= ( ( ( ( insn->id == ARM_INS_LDR ) ) - && strstr(strtok(copy,","), "pc" ) ) + && strstr( strtok( copy, "," ), "pc" ) ) ) ? LE_IC_JUMP : 0; - free(copy); - + free( copy ); + /* Was it an exception return? */ *ic |= ( ( insn->id == ARM_INS_ERET ) ) ? LE_IC_JUMP | LE_IC_IRET : 0; @@ -1080,7 +1081,7 @@ char *symbolDisassembleLine( struct symbol *p, enum instructionClass *ic, symbol if ( newaddr ) { - *newaddr = detail->arm.operands[n].imm; + *newaddr = detail->arm.operands[n].imm; } break; diff --git a/Src/traceDecoder_etm4.c b/Src/traceDecoder_etm4.c index 90caa9a..99811f8 100644 --- a/Src/traceDecoder_etm4.c +++ b/Src/traceDecoder_etm4.c @@ -185,11 +185,12 @@ static bool _pumpAction( struct TRACEDecoderEngine *e, struct TRACECPUState *cpu } else { - if( c == 0x05 && j->asyncCount == 1) + if ( c == 0x05 && j->asyncCount == 1 ) { cpu->overflows++; DEBUG( "Overflow Detected. ReSync Trace Stream:" EOL ); } + j->asyncCount = c ? 0 : j->asyncCount + 1; switch ( j->p )