Skip to content
  • Borislav Petkov's avatar
    scripts/decodecode: make faulting insn ptr more robust · 18ff44b1
    Borislav Petkov authored
    It can accidentally happen that the faulting insn (the exact instruction
    bytes) is repeated a little further on in the trace.  This causes that
    same instruction to be tagged twice, see example below.
    
    What we want to do, however, is to track back from the end of the whole
    disassembly so many lines as the slice which starts with the faulting
    instruction is long.  This leads us to the actual faulting instruction
    and *then* we tag it.
    
    While we're at it, we can drop the sed "g" flag because we address only
    this one line.
    
    Also, if we point to an instruction which changes decoding depending on
    the slice being objdumped, like a Jcc insn, for example, we do not even
    tag it as a faulting instruction because the instruction decode changes
    in the second slice but we use that second format as a regex on the
    fsrst disassembled buffer and more often than not that instruction
    doesn't match.
    
    Again, simply tag the line which is deduced from the original "<>"
    markin...
    18ff44b1