Hi Mike,
The issue seems to be that the decoder->packet_buffer contains twice the same start and end address in two consecutive entries:
(gdb) p etmq->decoder->packet_buffer[etmq->decoder->head] $300 = {sample_type = CS_ETM_RANGE, start_addr = 4196520, end_addr = 4196532, last_instruction_is_branch = true, exc = false, exc_ret = false, cpu = 1} (gdb) p etmq->decoder->packet_buffer[etmq->decoder->head - 1] $301 = {sample_type = CS_ETM_RANGE, start_addr = 4196520, end_addr = 4196532, last_instruction_is_branch = true, exc = false, exc_ret = false, cpu = 1} (gdb) p etmq->decoder->head $302 = 550
This leads to the wrong jump computed as follows: from prev_packet(at head - 1)->end_addr - 4 to current_packet(at head)->start_addr i.e., 4196532 - 4 to 4196520 in hex: 0x4008b0 to 0x4008a8
I will try to understand why decoder->packet_buffer contains the duplicate entries.
Sebastian