-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[llvm-mc] Add --hex to disassemble hex bytes #119992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
MaskRay
merged 4 commits into
main
from
users/MaskRay/spr/llvm-mc-add-hex-to-disassemble-hex-pairs
Dec 17, 2024
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# RUN: rm -rf %t && split-file %s %t && cd %t | ||
# RUN: llvm-mc -triple=x86_64 --disassemble --hex a.s | FileCheck %s | ||
# RUN: llvm-mc -triple=x86_64 --disassemble --hex decode1.s 2>&1 | FileCheck %s --check-prefix=DECODE1 --implicit-check-not=warning: | ||
# RUN: not llvm-mc -triple=x86_64 --disassemble --hex decode2.s 2>&1 | FileCheck %s --check-prefix=DECODE2 --implicit-check-not=warning: | ||
# RUN: not llvm-mc -triple=x86_64 --disassemble --hex err1.s 2>&1 | FileCheck %s --check-prefix=ERR1 --implicit-check-not=error: | ||
# RUN: not llvm-mc -triple=x86_64 --disassemble --hex err2.s 2>&1 | FileCheck %s --check-prefix=ERR2 --implicit-check-not=error: | ||
|
||
#--- a.s | ||
4883ec08 31 # comment | ||
# comment | ||
ed4829 c390 | ||
[c3c3][4829c3] | ||
[90] | ||
|
||
# CHECK: subq $8, %rsp | ||
# CHECK-NEXT: xorl %ebp, %ebp | ||
# CHECK-NEXT: subq %rax, %rbx | ||
# CHECK-NEXT: nop | ||
# CHECK-NEXT: retq | ||
# CHECK-NEXT: retq | ||
# CHECK-NEXT: subq %rax, %rbx | ||
# CHECK-NEXT: nop | ||
# CHECK-EMPTY: | ||
|
||
#--- decode1.s | ||
4889 | ||
|
||
# DECODE1: 1:1: warning: invalid instruction encoding | ||
|
||
#--- decode2.s | ||
[4889][4889] [4889]4889c3 | ||
[4889] | ||
|
||
# DECODE2: 1:2: warning: invalid instruction encoding | ||
# DECODE2: 1:8: warning: invalid instruction encoding | ||
# DECODE2: 1:15: warning: invalid instruction encoding | ||
# DECODE2: 2:3: warning: invalid instruction encoding | ||
|
||
#--- err1.s | ||
0x31ed | ||
0xcc | ||
g0 | ||
|
||
# ERR1: 1:1: error: invalid input token | ||
# ERR1: 2:1: error: invalid input token | ||
# ERR1: 3:1: error: invalid input token | ||
# ERR1: xorl %ebp, %ebp | ||
# ERR1-NEXT: int3 | ||
# ERR1-EMPTY: | ||
|
||
#--- err2.s | ||
g | ||
90c | ||
cc | ||
c | ||
|
||
# ERR2: 1:1: error: expected two hex digits | ||
# ERR2: 2:3: error: expected two hex digits | ||
# ERR2: 4:1: error: expected two hex digits | ||
# ERR2: nop | ||
# ERR2-NEXT: int3 | ||
# ERR2-EMPTY: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.