Skip to content

Commit b749b8b

Browse files
authored
adds AArch64 support (#18)
1 parent 456dbd1 commit b749b8b

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

lib/frame_arch.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ type t =
9898
| Lm32
9999
| Microblaze
100100
| M6502
101+
| AArch64
101102
| Last
102103
[@@deriving enumerate, variants]
103104

lib/frame_mach.ml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,15 @@ module Sparc = struct
9090
let all = all
9191
end)
9292
end
93+
94+
module AArch64 = struct
95+
type t =
96+
| Unknown
97+
[@@deriving enumerate, variants]
98+
99+
include Frame_enum.Make(struct
100+
type nonrec t = t
101+
let rank = Variants.to_rank
102+
let all = all
103+
end)
104+
end

lib/frame_reader.ml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,18 @@ module Arch = struct
8989
| Some (X86_64 | X86_64_intel) -> Some `x86_64
9090
| _ -> None)
9191

92+
let aarch64 n = Frame_mach.AArch64.(match of_enum n with
93+
| Some (Unknown) -> Some `aarch64
94+
| _ -> None)
95+
9296
(** a projection from BFD architectures to BAP. *)
9397
let of_bfd arch mach = match arch with
9498
| Frame_arch.Arm -> arm mach
9599
| Frame_arch.I386 -> i386 mach
96100
| Frame_arch.Mips -> mips mach
97101
| Frame_arch.Powerpc -> ppc mach
98102
| Frame_arch.Sparc -> sparc mach
103+
| Frame_arch.AArch64 -> aarch64 mach
99104
| _ -> None
100105
end
101106

libtrace/src/frame_arch.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,8 @@ enum frame_architecture
382382
#define frame_mach_lm32 1
383383
frame_arch_microblaze,/* Xilinx MicroBlaze. */
384384
frame_arch_6502,/* MOS Technology 6502. */
385+
frame_arch_aarch64, /* AArch64. */
386+
#define frame_mach_aarch64 0
385387
frame_arch_last
386388
};
387389

0 commit comments

Comments
 (0)