aboutsummaryrefslogtreecommitdiff
path: root/llvm/docs/CommandGuide
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2024-12-16 21:05:08 -0800
committerGitHub <noreply@github.com>2024-12-16 21:05:08 -0800
commitc6ff809ae9acbc90455dc8b58b2dae84a13366cf (patch)
tree61f7a2c7b5ce534298ad01e296a75711566d47af /llvm/docs/CommandGuide
parente2a94a97bdf26198ab254d61ee4be23a140dab2d (diff)
downloadllvm-c6ff809ae9acbc90455dc8b58b2dae84a13366cf.zip
llvm-c6ff809ae9acbc90455dc8b58b2dae84a13366cf.tar.gz
llvm-c6ff809ae9acbc90455dc8b58b2dae84a13366cf.tar.bz2
[llvm-mc] Add --hex to disassemble hex bytes
`--disassemble`/`--cdis` parses input bytes as decimal, 0bbin, 0ooct, or 0xhex. While the hexadecimal digit form is most commonly used, requiring a 0x prefix for each byte (`0x48 0x29 0xc3`) is cumbersome. Tools like xxd -p and rz-asm use a plain hex dump form without the 0x prefix or space separator. This patch adds --hex to disassemble such hex bytes with optional whitespace. ``` % rz-asm -a x86 -b 64 -d 4829c34829c4 sub rbx, rax sub rsp, rax % llvm-mc -triple=x86_64 --cdis --hex --output-asm-variant=1 <<< 4829c34829c4 .text sub rbx, rax sub rsp, rax ``` Pull Request: https://github.com/llvm/llvm-project/pull/119992
Diffstat (limited to 'llvm/docs/CommandGuide')
-rw-r--r--llvm/docs/CommandGuide/llvm-mc.rst4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/docs/CommandGuide/llvm-mc.rst b/llvm/docs/CommandGuide/llvm-mc.rst
index c5d2f93..8d6346f 100644
--- a/llvm/docs/CommandGuide/llvm-mc.rst
+++ b/llvm/docs/CommandGuide/llvm-mc.rst
@@ -92,6 +92,10 @@ End-user Options
Generate DWARF debugging info for assembly source files.
+.. option:: --hex
+
+ Take raw hexadecimal bytes as input for disassembly. Whitespace is ignored.
+
.. option:: --large-code-model
Create CFI directives that assume the code might be more than 2 GB.