"text/tabwriter"
"golang.org/x/arch/arm/armasm"
+ "golang.org/x/arch/arm64/arm64asm"
"golang.org/x/arch/ppc64/ppc64asm"
"golang.org/x/arch/x86/x86asm"
)
return text, size
}
+func disasm_arm64(code []byte, pc uint64, lookup lookupFunc, byteOrder binary.ByteOrder) (string, int) {
+ inst, err := arm64asm.Decode(code)
+ var text string
+ if err != nil || inst.Op == 0 {
+ text = "?"
+ } else {
+ text = arm64asm.GoSyntax(inst, pc, lookup, textReader{code, pc})
+ }
+ return text, 4
+}
+
func disasm_ppc64(code []byte, pc uint64, lookup lookupFunc, byteOrder binary.ByteOrder) (string, int) {
inst, err := ppc64asm.Decode(code, byteOrder)
var text string
"386": disasm_386,
"amd64": disasm_amd64,
"arm": disasm_arm,
+ "arm64": disasm_arm64,
"ppc64": disasm_ppc64,
"ppc64le": disasm_ppc64,
}
"386": binary.LittleEndian,
"amd64": binary.LittleEndian,
"arm": binary.LittleEndian,
+ "arm64": binary.LittleEndian,
"ppc64": binary.BigEndian,
"ppc64le": binary.LittleEndian,
"s390x": binary.BigEndian,
func TestDisasm(t *testing.T) {
switch runtime.GOARCH {
- case "arm64":
- t.Skipf("skipping on %s, issue 10106", runtime.GOARCH)
case "mips", "mipsle", "mips64", "mips64le":
t.Skipf("skipping on %s, issue 12559", runtime.GOARCH)
case "s390x":
func TestDisasmCode(t *testing.T) {
switch runtime.GOARCH {
- case "arm64":
- t.Skipf("skipping on %s, issue 10106", runtime.GOARCH)
case "mips", "mipsle", "mips64", "mips64le":
t.Skipf("skipping on %s, issue 12559", runtime.GOARCH)
case "s390x":
switch runtime.GOARCH {
case "ppc64":
t.Skipf("skipping on %s, no support for external linking, issue 9038", runtime.GOARCH)
- case "arm64":
- t.Skipf("skipping on %s, issue 10106", runtime.GOARCH)
case "mips64", "mips64le", "mips", "mipsle":
t.Skipf("skipping on %s, issue 12559 and 12560", runtime.GOARCH)
case "s390x":
switch runtime.GOARCH {
case "arm":
t.Skipf("skipping on %s, issue 19811", runtime.GOARCH)
- case "arm64":
- t.Skipf("skipping on %s, issue 10106", runtime.GOARCH)
case "mips", "mipsle", "mips64", "mips64le":
t.Skipf("skipping on %s, issue 12559", runtime.GOARCH)
case "s390x":