Skip to content

Commit 3c29b4f

Browse files
committed
This PR is dual to the QEMU PR#7 [1] (#6)
1. The bfd library is removed and merged into frames library. Now we have `Frame_arch` and `Frame_mach` modules. 2. piqi files are gathered in the `piqi` folder 3. arch.hpp is renamed to `frame_arch.h` 4. frame reader is now more sloppy and will try to guess architecture even if it is slightly miss-specified. [1]: BinaryAnalysisPlatform/qemu#7
1 parent 314ffb6 commit 3c29b4f

33 files changed

+651
-762
lines changed

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ doc: setup.data build
99
test: setup.data build
1010
$(SETUP) -test $(TESTFLAGS)
1111

12-
all: build install
1312

1413
install: setup.data
1514
$(SETUP) -install $(INSTALLFLAGS)

README.md

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,49 @@
11
# Overview
22
`Frames` is a format for storing execution traces. This repository contains:
33
- A description in [piqi](http://piqi.org/) language of the `frames` format;
4-
- A `C` library for writing data in the `frames` format
4+
- A `C++` library for writing data in the `frames` format
55
- An `OCaml` library `bap-frames` for reading data in the `frames` format
66
- A BAP plugin `frame` that provides `frames` format reader for the `bap-plugins` library
7-
- A playground `test/tracedump` to inspect the traces
87

98
# Build and install
109

11-
## From sources
10+
## OCaml bap-frames library
11+
### From sources
1212
```
1313
oasis setup
1414
./configure --prefix=`opam config var prefix`
15-
make
15+
make
1616
make install
1717
```
1818

19-
## From opam
19+
### From opam
2020

2121
1. Add our opam repository if you don't have one
2222

2323
```
2424
opam repository add bap git://github.com/BinaryAnalysisPlatform/opam-repository.git
2525
```
26-
2. install
26+
2. install
2727

2828
```
2929
opam install bap-frames
3030
```
31+
32+
## C++ `libtrace` library
33+
34+
1. Generate configuration files
35+
```
36+
cd libtrace
37+
./autogen.sh
38+
```
39+
40+
2. Configure (use configuration options to your taste)
41+
```
42+
./configure
43+
```
44+
45+
3. Compile and install
46+
```
47+
make
48+
make install
49+
```

_oasis

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,14 @@ License: MIT
77
Plugins: META (0.4)
88
BuildTools: ocamlbuild
99

10-
Library bfd
11-
Path: lib/bfd
12-
Modules: Bfd
13-
FindlibName: bfd
14-
CompiledObject: best
15-
BuildDepends: ppx_deriving.std
16-
17-
1810
Library "bap-frames"
19-
Path: lib/frames
20-
Modules: Frame_events, Frame_piqi, Frame_reader
11+
Path: lib/
12+
Modules: Frame_arch, Frame_events, Frame_mach, Frame_piqi, Frame_reader
2113
FindlibName: bap-frames
2214
BuildTools: piqi
23-
BuildDepends: bap, bap-traces, bfd, core_kernel, piqirun.pb, ppx_jane, ppx_deriving.std
15+
BuildDepends: bap, bap-traces, core_kernel, piqirun.pb, ppx_jane, ppx_deriving.std
2416
CompiledObject: best
25-
DataFiles: ../../*.piqi
17+
DataFiles: ../piqi/*.piqi
2618

2719
Library "bap-plugin-frames"
2820
Path: plugin

_tags

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# OASIS_START
2-
# DO NOT EDIT (digest: 2af87a2cce103ee0987cdf9582dfc68f)
2+
# DO NOT EDIT (digest: c47fcdcf848520d4c6201f726377213a)
33
# Ignore VCS directories, you can use the same kind of rule outside
44
# OASIS_START/STOP if you want to exclude directories that contains
55
# useless stuff for the build process
@@ -14,18 +14,14 @@ true: annot, bin_annot
1414
".git": not_hygienic
1515
"_darcs": -traverse
1616
"_darcs": not_hygienic
17-
# Library bfd
18-
"lib/bfd/bfd.cmxs": use_bfd
19-
<lib/bfd/*.ml{,i,y}>: pkg_ppx_deriving.std
2017
# Library bap-frames
21-
"lib/frames/bap-frames.cmxs": use_bap-frames
22-
<lib/frames/*.ml{,i,y}>: pkg_bap
23-
<lib/frames/*.ml{,i,y}>: pkg_bap-traces
24-
<lib/frames/*.ml{,i,y}>: pkg_core_kernel
25-
<lib/frames/*.ml{,i,y}>: pkg_piqirun.pb
26-
<lib/frames/*.ml{,i,y}>: pkg_ppx_deriving.std
27-
<lib/frames/*.ml{,i,y}>: pkg_ppx_jane
28-
<lib/frames/*.ml{,i,y}>: use_bfd
18+
"lib/bap-frames.cmxs": use_bap-frames
19+
<lib/*.ml{,i,y}>: pkg_bap
20+
<lib/*.ml{,i,y}>: pkg_bap-traces
21+
<lib/*.ml{,i,y}>: pkg_core_kernel
22+
<lib/*.ml{,i,y}>: pkg_piqirun.pb
23+
<lib/*.ml{,i,y}>: pkg_ppx_deriving.std
24+
<lib/*.ml{,i,y}>: pkg_ppx_jane
2925
# Library bap-plugin-frames
3026
"plugin/bap-plugin-frames.cmxs": use_bap-plugin-frames
3127
<plugin/*.ml{,i,y}>: pkg_bap
@@ -35,5 +31,5 @@ true: annot, bin_annot
3531
<plugin/*.ml{,i,y}>: pkg_ppx_deriving.std
3632
<plugin/*.ml{,i,y}>: pkg_ppx_jane
3733
<plugin/*.ml{,i,y}>: use_bap-frames
38-
<plugin/*.ml{,i,y}>: use_bfd
3934
# OASIS_STOP
35+
<libtrace>: -traverse

configure

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
#!/bin/sh
2-
3-
# OASIS_START
4-
# DO NOT EDIT (digest: dc86c2ad450f91ca10c931b6045d0499)
52
set -e
63

74
FST=true
@@ -24,4 +21,3 @@ for i in "$@"; do
2421
done
2522

2623
ocaml setup.ml -configure "$@"
27-
# OASIS_STOP

lib/.merlin

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
REC
2-
PKG ppx_deriving.std
2+
PKG ppx_deriving.std
3+
PKG piqirun
4+
B ../_build/lib

lib/bfd/bfd.ml

Lines changed: 0 additions & 152 deletions
This file was deleted.

0 commit comments

Comments
 (0)