[Lldb-commits] [PATCH] D140358: [lldb-vscode] Add support for disassembly view

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Jan 11 16:39:46 PST 2023


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



More information about the lldb-commits mailing list