@@ -56,12 +56,13 @@ end = struct
56
56
| `r64 -> Bitvector. of_int64 ~width: 64 address
57
57
58
58
let move arch tag cell width value =
59
- let endian =
60
- Option. value_map arch ~default: Bitvector. LittleEndian ~f: Arch. endian in
61
- Value. create tag Trace.Move. {
62
- cell;
63
- data = let width = match width with 0 -> None | w -> Some w in
64
- Bitvector. (of_binary ?width endian value)}
59
+ let data =
60
+ let endian =
61
+ Option. value_map arch ~default: Bitvector. LittleEndian ~f: Arch. endian in
62
+ let width = match width with 0 -> None | w -> Some w in
63
+ Bitvector. of_binary ?width endian value in
64
+ Trace.Move.Fields. create ~cell ~data |>
65
+ Value. create tag
65
66
66
67
let memory_operation arch tag mo width value =
67
68
move arch tag (addr_of_address arch mo.Frame.Mem_operand. address)
@@ -87,33 +88,31 @@ end = struct
87
88
Value. create pc_update (addr_of_address arch address)
88
89
89
90
let code_exec arch address data =
90
- Value. create code_exec Trace.Chunk. {
91
- addr = addr_of_address arch address;
92
- data
93
- }
91
+ Trace.Chunk.Fields. create ~addr: (addr_of_address arch address) ~data |>
92
+ Value. create code_exec
94
93
95
94
let context_switch id =
96
95
Value. create context_switch @@ Int64. to_int_exn id
97
96
98
97
let syscall ~number args =
99
- Value. create syscall Trace.Syscall. {
100
- number = Int64. to_int_exn number;
101
- args = Array. of_list @@ List. map ~f: Bitvector. of_int64 args
102
- }
98
+ Trace.Syscall.Fields. create
99
+ ~ number: ( Int64. to_int_exn number)
100
+ ~ args: ( Array. of_list @@ List. map ~f: Bitvector. of_int64 args) |>
101
+ Value. create syscall
103
102
104
103
let exn arch number ~from_addr ~to_addr =
105
- Value. create exn Trace.Exn. {
106
- number = Int64. to_int_exn number;
107
- src = Option. map from_addr ~f: (addr_of_address arch);
108
- dst = Option. map to_addr ~f: (addr_of_address arch)
109
- }
104
+ Trace.Exn.Fields. create
105
+ ~ number: ( Int64. to_int_exn number)
106
+ ~ src: ( Option. map from_addr ~f: (addr_of_address arch))
107
+ ~ dst: ( Option. map to_addr ~f: (addr_of_address arch)) |>
108
+ Value. create exn
110
109
111
110
let modload arch name low high =
112
- Value. create modload Trace.Modload. {
113
- name;
114
- low = addr_of_address arch low;
115
- high = addr_of_address arch high;
116
- }
111
+ Trace.Modload.Fields. create
112
+ ~ name
113
+ ~ low: ( addr_of_address arch low)
114
+ ~ high: ( addr_of_address arch high) |>
115
+ Value. create modload
117
116
end
118
117
119
118
let of_new_frame context arch address thread_id =
0 commit comments