Depends on D87589.
In D87589 I added the basic instruction decoding functionality and the Dump action was printing the raw strings. I'm now pretty printing the instructions, with an output like the following:
pid: '1234', tid: '1981309' a.out`main  0x400549 <+13>: movl %eax, -0x4(%rbp) a.out`bar()  0x40053b <+46>: retq  0x40053a <+45>: leave  0x400537 <+42>: movl -0x4(%rbp), %eax  0x400535 <+40>: jle 0x400525 ; <+24> at main.cpp:7  0x400531 <+36>: cmpl $0x3, -0x8(%rbp)  0x40052d <+32>: addl $0x1, -0x8(%rbp)  0x40052a <+29>: addl %eax, -0x4(%rbp) a.out`foo()  0x400567 <+15>: retq  0x400566 <+14>: popq %rbp  0x400563 <+11>: movl -0x4(%rbp), %eax  0x40055c <+4>: movl $0x2a, -0x4(%rbp)  0x400559 <+1>: movq %rsp, %rbp  0x400558 <+0>: pushq %rbp
There's also a --raw flag that prints simply the instructions addresses.
An important remark is that the decoder can fail to decode some instructions, which we are printing, for example:
pid: '1234', tid: '3842849'
 0x400529 <+28>: cmpl $0x3, -0x8(%rbp)  error -13. 'no memory mapped at this address'  0x40052d <+32>: jle 0x400521
As an implementation note, I'm using lldb's Disassembler. I couldn't move the entire printing logic to the disassembler because it assumes that all instuctions printed are valid, which conflicts with what the intel-pt decoder outputs.
Finally, the instruction dumping command is as follows:
trace dump -i [-rv] [-c <count>] [-o <offset>] [-t <thread-id>]