Skip to content

Commit

Permalink
adds bap-toplevel (doesnt' work)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivg committed Aug 31, 2022
1 parent 012fe3c commit fb5eb8d
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 28 deletions.
35 changes: 35 additions & 0 deletions bap-toplevel.opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
version: "master"
synopsis: "BAP toplevel, baptop"
description:
"The utop-enhanced bap toplevel interpreter. Run `baptop` and start using bap right away. Or use it as the interpreter for your BAP scripts, e.g., `baptop myprog.ml`"
maintainer: ["Ivan Gotovchits <[email protected]>"]
authors: ["The BAP Team"]
license: "MIT"
tags: ["bap" "toplevel"]
homepage: "https://github.com/BinaryAnalysisPlatform/bap"
bug-reports: "https://github.com/BinaryAnalysisPlatform/bap/issues"
depends: [
"dune" {>= "2.8"}
"bap-base" {= version}
"bap-std" {= version}
"core_kernel" {>= "v0.14" & < "v0.16"}
"ocamlfind" {= version}
"odoc" {with-doc}
]
build: [
["dune" "subst"] {dev}
[
"dune"
"build"
"-p"
name
"-j"
jobs
"@install"
"@runtest" {with-test}
"@doc" {with-doc}
]
]
dev-repo: "git+https://github.com/BinaryAnalysisPlatform/bap.git"
14 changes: 14 additions & 0 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -1390,6 +1390,20 @@ The library provides several algorithms:
(ogre (= :version))
(ppx_bap (= :version))))

(package
(name bap-toplevel)
(synopsis "BAP toplevel, baptop")
(tags (bap toplevel))
(description "\
The utop-enhanced bap toplevel interpreter. \
Run `baptop` and start using bap right away. Or use it \
as the interpreter for your BAP scripts, e.g., `baptop myprog.ml`")
(depends
(bap-base (= :version))
(bap-std (= :version))
(core_kernel (and (>= v0.14) (< v0.16)))
(ocamlfind (= :version))))

(package
(name bap-trace)
(synopsis "BAP plugin for loading and inspecting execution traces")
Expand Down
70 changes: 43 additions & 27 deletions lib/bap/dune
Original file line number Diff line number Diff line change
@@ -1,28 +1,44 @@
(library
(name bap)
(public_name bap-std)
(wrapped false)
(preprocess (pps ppx_bap))
(libraries
bap-bundle
bap-core-theory
bap_disasm
bap-future
bap_image
bap-knowledge
bap-main
bap_sema
bap_types
bitvec
bitvec-binprot
bitvec-order
bitvec-sexp
core_kernel
core_kernel.caml_unix
fileutils
graphlib
monads
ogre
regular)
(modules bap bap_project bap_self)
(private_modules bap_project bap_self))
(name bap)
(public_name bap-std)
(wrapped false)
(preprocess (pps ppx_bap))
(libraries
bap-bundle
bap-core-theory
bap_disasm
bap-future
bap_image
bap-knowledge
bap-main
bap_sema
bap_types
bitvec
bitvec-binprot
bitvec-order
bitvec-sexp
core_kernel
core_kernel.caml_unix
fileutils
graphlib
monads
ogre
regular)
(modules bap bap_project bap_self)
(private_modules bap_project bap_self))


(library
(name baptop)
(public_name bap.top)
(modules bap_init_toplevel)
(private_modules bap_init_toplevel)
(library_flags (-linkall))
(modes byte)
(special_builtin_support findlib_dynload)
(libraries
bap
bap-main
bap-plugins
compiler-libs
compiler-libs.common))
6 changes: 5 additions & 1 deletion src/baptop.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@ let main () =
UTop_main.main ()


let () = main ()
let () =
try main () with
Symtable.Error err ->
Format.eprintf "Internal error: %a@." Symtable.report_error err;
exit 1
9 changes: 9 additions & 0 deletions src/dune
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,12 @@
fileutils
re.posix
threads))

(executable
(name baptop)
(public_name baptop)
(package bap-toplevel)
(modules baptop)
(modes byte)
(link_flags (-linkall))
(libraries utop threads findlib.dynload))

0 comments on commit fb5eb8d

Please sign in to comment.