Skip to content

Commit

Permalink
adds baptop and bap.top that work
Browse files Browse the repository at this point in the history
Both require ocaml/dune#6082
And bap.top only works inside `baptop` but not vanila
`utop` or `ocaml`, see ocaml/dune#6081
  • Loading branch information
ivg committed Aug 18, 2022
1 parent e073feb commit a5019b5
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 12 deletions.
4 changes: 4 additions & 0 deletions dune
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,7 @@
ppx_sexp_value
ppx_variants_conv)
(preprocess no_preprocessing))

(alias
(name default)
(deps (alias_rec install)))
5 changes: 3 additions & 2 deletions lib/bap/bap_init_toplevel.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ let main () =
let module Core_kernel_is_required = Core_kernel[@warning "-D"] in
let loader = Topdirs.dir_load Format.err_formatter in
setup_dynamic_loader loader;
install_printers ();
match Bap_main.init ~argv: [|"baptop"|] () with
| Ok () -> ()
| Ok () ->
install_printers ();
()
| Error failed ->
Format.eprintf "Failed to initialize BAP: %a@\n%!"
Bap_main.Extension.Error.pp failed;
Expand Down
10 changes: 4 additions & 6 deletions lib/bap/dune
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,14 @@


(library
(name baptop)
(name bap_init_toplevel)
(public_name bap.top)
(modules bap_init_toplevel)
(private_modules bap_init_toplevel)
(library_flags (-linkall))
(modes byte)
(special_builtin_support findlib_dynload)
(modules bap_init_toplevel)
(optional)
(libraries
bap
bap-main
bap-plugins
dune-site.toplevel ; to disable when toplevel support is not present
compiler-libs
compiler-libs.common))
3 changes: 2 additions & 1 deletion lib/bap_plugins/dune
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
(libraries core_kernel dynlink fileutils findlib uri
bap-bundle bap-future
dune-site
dune-site.plugins))
dune-site.plugins
compiler-libs.common))

(generate_sites_module
(module bap_plugins_sites)
Expand Down
3 changes: 1 addition & 2 deletions lib_test/bap/dune
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@
test_image
test_disasm
test_sema
test_project
))
test_project))
3 changes: 2 additions & 1 deletion src/dune
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,5 @@
(modules baptop)
(modes byte)
(link_flags (-linkall))
(libraries utop threads findlib.dynload))
(optional)
(libraries dune-site.plugins dune-site.toplevel utop threads findlib.dynload))

0 comments on commit a5019b5

Please sign in to comment.