Skip to content

Commit 5eccdc6

Browse files
ailrstkatrinafyi
andauthored
Add offline lifter interface (#25)
* add offline lifter flag --------- Co-authored-by: rina <[email protected]>
1 parent b35ce4b commit 5eccdc6

6 files changed

+227
-177
lines changed

CHANGES.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 0.1.2 (2025-05-05)
2+
3+
- Add offline lifter support
14

25
## 0.1.0 (2025-04-05)
36

README.md

+25-33
Original file line numberDiff line numberDiff line change
@@ -6,47 +6,39 @@ This codebase serves to tie several verification tools together.
66
The [GTIRB](https://github.com/grammatech/gtirb) intermediate representation produced by the [Datalog Disassembler](https://github.com/GrammaTech/ddisasm) is deserialised using [Google Protocol Buffers](https://developers.google.com/protocol-buffers). This is then dismantled and the [ASLi ASL Interpreter](https://github.com/UQ-PAC/asl-interpreter) is used to add instruction semantics for each instruction opcode. These are then reserialised back into the original IR protobufs alongside the original data produced by DDisasm (.gts file).
77
The semantic information itself is also printed to stdout.
88

9-
## Installation
9+
## Installing for use
1010

11+
gtirb-semantics can be installed through a Nix package or through our custom opam repository.
1112

12-
### For use
13+
**Nix package:**
1314

14-
Through the nix package
15-
16-
1. (First time only) setup nix repo [nix package](https://github.com/katrinafyi/pac-nix)
15+
1. (First time only) Set up the [pac-nix repo](https://github.com/katrinafyi/pac-nix).
1716
2. `nix profile install github:katrinafyi/pac-nix#gtirb-semantics`
1817

19-
Through opam
20-
21-
1. (First time only) install [ASLp](https://github.com/UQ-PAC/aslp?tab=readme-ov-file#installing-dependencies) if it is not already pinned
22-
23-
```sh
24-
opam pin asli git+https://github.com/UQ-PAC/aslp
25-
```
26-
2. (First time only) Add [opam repository](https://github.com/ailrst/opam-repository):
27-
28-
```sh
29-
opam repository add pac https://github.com/ailrst/opam-repository
30-
```
18+
**Through opam:**
3119

32-
3. `opam install gtirb_semantics`
20+
1. (First time only) Set up the custom [opam repository](https://github.com/ailrst/opam-repository):
21+
```sh
22+
opam repository add pac https://github.com/ailrst/opam-repository.git
23+
```
3324

34-
### For development
25+
2. `opam install gtirb_semantics`
3526

36-
1. (First time only) install [ASLp](https://github.com/UQ-PAC/aslp?tab=readme-ov-file#installing-dependencies) if it is not already pinned
27+
## Setting up for development
3728

38-
```shell
39-
opam pin asli git+https://github.com/UQ-PAC/aslp
40-
```
29+
1. Install the [ASLp](https://github.com/UQ-PAC/aslp) dependency in one of these ways:
30+
- from the opam repository: `opam install asli` (assuming the custom opam repository has been set up, make sure the version is **>= 0.3.0**!),
31+
- via an opam pin: `opam pin asli git+https://github.com/UQ-PAC/aslp`, or
32+
- by manually compiling ASLp, following [these instructions](https://github.com/UQ-PAC/aslp?tab=readme-ov-file#installing-dependencies).
4133

42-
2. Clone and install
34+
2. Clone and install gtirb-semantics:
4335

44-
```
45-
git clone [email protected]:UQ-PAC/gtirb-semantics.git && cd gtirb-semantics
46-
opam install --deps-only .
47-
dune build --profile=release
48-
dune install
49-
```
36+
```bash
37+
git clone [email protected]:UQ-PAC/gtirb-semantics.git && cd gtirb-semantics
38+
opam install --deps-only .
39+
dune build --profile=release
40+
dune install
41+
```
5042

5143
- If the build fails finding `protoc`, it can be installed through the system package manager.
5244
- Lift binaries with `ddisasm` ([install using nix](https://github.com/katrinafyi/pac-nix?tab=readme-ov-file))
@@ -55,11 +47,11 @@ dune install
5547

5648
To save on the initialisation time (2s which can dominate execution time when lifting many programs)
5749
and keep the in-memory instruction cache warm, it is possible to use `gtirb_semantics` as a
58-
client-server.
50+
client-server.
5951

6052
For example:
6153

62-
```
54+
```bash
6355
gtirb_semantics --serve & > /dev/null
6456
gtirb_semantics --client input.gtirb output.gts
6557
gtirb_semantics --client input2.gtirb output2.gts
@@ -88,7 +80,7 @@ ddisasm ./a.out --ir a.gtirb
8880
## GTIRB Specifics
8981
The serialised output is almost identical to that produced by ddisasm except with a few differences:
9082
* The file does not have the 8-byte magic prefix used by GTIRB.
91-
* The semantic information provided by ASLi has been added as an auxdata record for each compilation module.
83+
* The semantic information provided by ASLi has been added as an auxdata record for each compilation module.
9284
The semantic information JSON data is structured as so:
9385
```js
9486
{

0 commit comments

Comments
 (0)