[PATCH] D80512: [MC] Changes to help improve target specific symbol disassembly

Ronak Chauhan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 3 10:25:38 PDT 2020


rochauha updated this revision to Diff 268248.
rochauha added a comment.

To have round trippable disassembly, we fall back to decoding the
remaining bytes as instructions.

If there is a failure, we disassemble the 'failed' region as bytes
before falling back.

- This means that on failure the target must print whatever it disassembled so far as comments? Requires discussion.
- Otherwise we would have decoded some bytes twice. Once by the target (until it failed) and then again as bytes.

If there is Success or SoftFail i.e no 'real' failure, we skip over
Size bytes before falling back.
So if the entire symbol is 'eaten' by the target:

  Start += Size  // Now Start = End and we will never decode as instructions

Right now, most targets return None i.e ignore to treat a symbol
separately. But WebAssembly decodes preludes for some symbols.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80512

Files:
  llvm/include/llvm/MC/MCDisassembler/MCDisassembler.h
  llvm/lib/MC/MCDisassembler/MCDisassembler.cpp
  llvm/lib/Target/WebAssembly/Disassembler/WebAssemblyDisassembler.cpp
  llvm/tools/llvm-objdump/llvm-objdump.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80512.268248.patch
Type: text/x-patch
Size: 7894 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200603/2c6910bc/attachment.bin>


More information about the llvm-commits mailing list