clayborg added a comment.

I mean we can not just subtract something, any number, from any address unless 
we have fixed size opcodes. If we do this for x86, you can get complete garbage 
with no hope of ever getting back on track and this disassembly just won't make 
sense at all and will be useless. I thought my x86 example spelled out why it 
is bad to backup. If we start disassembling in the middle of an opcode, we can 
attempt to disassemble immediate values that are encoded into the middle of an 
opcode. Since x86 instructions can be 1 byte to 15 bytes, we might disassembly 
garbage and never align up to real opcodes.

So I see a few solutions:

- use functions and symbols to get actual boundaries, and use sections to 
detect when there are instruction (code) and not
- check if min and max opcode sizes are the same and only try to backup if they 
are the same, but still use sections to disassembly data as .byte or .long 
directives


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140358/new/

https://reviews.llvm.org/D140358

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to