├── ChangeLog ├── vagrant ├── .gitignore └── bootstrap.sh ├── doc ├── chap-tools │ ├── add2.s │ ├── Makefile │ ├── obtaining.tex │ └── add2.il ├── fig │ ├── add-shl.pdf │ ├── components.pdf │ ├── toolchain.pdf │ ├── memvsarray-1.pdf │ ├── memvsarray-2.pdf │ ├── running-example.pdf │ ├── running-example-patch.pdf │ └── Makefile ├── chap-examples │ ├── test │ ├── basic.o │ ├── cdg.pdf │ ├── ddg.pdf │ ├── basiccfg.pdf │ ├── ssacfg.pdf │ ├── ssaconvcfg.pdf │ ├── ssasimpcfg.pdf │ ├── basic.S │ └── test.c ├── chap-developer.tex ├── chap-intro.tex ├── credits.tex ├── chap-tools.tex ├── chap-examples.tex └── just-formals │ └── Makefile ├── libtracewrap ├── libtrace │ ├── README │ ├── AUTHORS │ ├── ChangeLog │ ├── NEWS │ ├── piqi │ │ ├── piqi │ │ │ ├── VERSION │ │ │ ├── examples │ │ │ │ ├── empty.piq │ │ │ │ ├── empty.piqi │ │ │ │ ├── erlang │ │ │ │ │ ├── test │ │ │ │ │ ├── addressbook.piq │ │ │ │ │ ├── addressbook.proto │ │ │ │ │ ├── addressbook.proto.piqi │ │ │ │ │ ├── list_people │ │ │ │ │ ├── add_person │ │ │ │ │ ├── io_json_xml_pb │ │ │ │ │ ├── Makefile │ │ │ │ │ ├── Makefile.erlang │ │ │ │ │ ├── Makefile.erlang_ext │ │ │ │ │ └── addressbook.erlang.piqi │ │ │ │ ├── ocaml │ │ │ │ │ ├── addressbook.piq │ │ │ │ │ ├── addressbook.proto │ │ │ │ │ ├── addressbook.ocaml.piqi │ │ │ │ │ ├── Makefile │ │ │ │ │ └── Makefile.ocaml_ext │ │ │ │ ├── bool.piq │ │ │ │ ├── ocaml-piq-config │ │ │ │ │ ├── OCamlMakefile │ │ │ │ │ ├── build.sh │ │ │ │ │ ├── config.piqi │ │ │ │ │ ├── config.piq │ │ │ │ │ ├── config.ml │ │ │ │ │ └── README │ │ │ │ ├── flag.piq │ │ │ │ ├── piq-word.piq │ │ │ │ ├── list.piq │ │ │ │ ├── complex.piq │ │ │ │ ├── comment.piq │ │ │ │ ├── record-variant-list.piqi │ │ │ │ ├── ocaml-custom-types │ │ │ │ │ ├── skvl.piqi │ │ │ │ │ └── README │ │ │ │ ├── record-variant-list.piq │ │ │ │ ├── piq-format.piqi │ │ │ │ ├── function.piq │ │ │ │ ├── test_piqi_proto │ │ │ │ ├── complex.piqi │ │ │ │ ├── erlang-custom-types │ │ │ │ │ ├── example.piqi │ │ │ │ │ └── Makefile │ │ │ │ ├── piq-text.piq │ │ │ │ ├── float.piq │ │ │ │ └── person.piq │ │ │ ├── piqi-camlp4 │ │ │ │ ├── 3.10 │ │ │ │ ├── 4.00 │ │ │ │ ├── .gitignore │ │ │ │ ├── META │ │ │ │ └── 3.12 │ │ │ │ │ └── pa_openin.ml │ │ │ ├── bin │ │ │ │ ├── piqi │ │ │ │ ├── piqic │ │ │ │ ├── piqicc │ │ │ │ ├── piqic-erlang-rpc │ │ │ │ └── piqic-erlang-ext │ │ │ ├── piqic │ │ │ │ ├── piqic_common_ext.ml │ │ │ │ ├── piqi-lang.piqi │ │ │ │ ├── piqi.piqi │ │ │ │ ├── piqi-impl.piqi │ │ │ │ ├── .gitignore │ │ │ │ ├── piqi-lang.ocaml.piqi │ │ │ │ └── piqi.erlang.piqi │ │ │ ├── piqirun-ocaml │ │ │ │ ├── .gitignore │ │ │ │ ├── META │ │ │ │ └── test.ocaml │ │ │ ├── tests │ │ │ │ ├── examples │ │ │ │ ├── self_spec │ │ │ │ ├── ocaml_addressbook │ │ │ │ ├── piqi_proto │ │ │ │ │ ├── .gitignore │ │ │ │ │ ├── Makefile │ │ │ │ │ └── README │ │ │ │ ├── erlang_addressbook │ │ │ │ ├── erlang_import │ │ │ │ │ ├── piqi-erlang │ │ │ │ │ ├── first.piqi │ │ │ │ │ ├── second.piqi │ │ │ │ │ └── Makefile │ │ │ │ ├── erlang_packed │ │ │ │ │ ├── piqi-erlang │ │ │ │ │ ├── packed.piqi │ │ │ │ │ ├── test-all.piq │ │ │ │ │ ├── packed-nocompat.piqi │ │ │ │ │ ├── test │ │ │ │ │ ├── test.erl │ │ │ │ │ └── Makefile │ │ │ │ ├── cpp │ │ │ │ │ ├── piqi.piqi │ │ │ │ │ ├── Makefile.cpp │ │ │ │ │ ├── README │ │ │ │ │ ├── Makefile │ │ │ │ │ └── test.cpp │ │ │ │ ├── ocaml_custom_types │ │ │ │ ├── ocaml_packed │ │ │ │ │ ├── packed.piqi │ │ │ │ │ ├── test-all.piq │ │ │ │ │ ├── packed-nocompat.piqi │ │ │ │ │ ├── test_packed.ml │ │ │ │ │ ├── test_packed_array.ml │ │ │ │ │ └── Makefile │ │ │ │ ├── ocaml_array │ │ │ │ │ ├── test-all.piq │ │ │ │ │ ├── Makefile │ │ │ │ │ ├── test.ml │ │ │ │ │ └── Makefile.ocaml │ │ │ │ ├── ocaml_perf │ │ │ │ │ ├── piqi.piqi │ │ │ │ │ ├── addressbook.piq │ │ │ │ │ ├── addressbook.ocaml.piqi │ │ │ │ │ ├── addressbook.proto.piqi │ │ │ │ │ ├── README │ │ │ │ │ └── Makefile │ │ │ │ ├── ocaml_piqi │ │ │ │ │ ├── piqi.ocaml.piqi │ │ │ │ │ ├── piqi.piqi │ │ │ │ │ ├── Makefile │ │ │ │ │ ├── README │ │ │ │ │ ├── test.ml │ │ │ │ │ └── Makefile.ocaml │ │ │ │ ├── erlang_misc │ │ │ │ │ ├── empty-record.piqi │ │ │ │ │ └── Makefile │ │ │ │ ├── erlang_piqi │ │ │ │ │ ├── piqi.piqi │ │ │ │ │ ├── test │ │ │ │ │ ├── Makefile.erlang │ │ │ │ │ ├── test.erl │ │ │ │ │ ├── README │ │ │ │ │ └── Makefile │ │ │ │ ├── erlang_perf │ │ │ │ │ ├── addressbook.piq │ │ │ │ │ ├── addressbook.erlang.piqi │ │ │ │ │ ├── addressbook.proto.piqi │ │ │ │ │ ├── test │ │ │ │ │ ├── Makefile │ │ │ │ │ └── README │ │ │ │ ├── ocaml_misc │ │ │ │ │ ├── empty-record.piqi │ │ │ │ │ ├── variant-1.piqi │ │ │ │ │ ├── Ad.piqi │ │ │ │ │ ├── Protocol.piqi │ │ │ │ │ └── P.piqi │ │ │ │ ├── ocaml_piq_config │ │ │ │ │ ├── ocaml-piq-config │ │ │ │ │ └── Makefile │ │ │ │ ├── piqi_server │ │ │ │ │ └── Makefile │ │ │ │ ├── piqi_proto1 │ │ │ │ │ ├── Makefile │ │ │ │ │ ├── T.piqi │ │ │ │ │ ├── Topic.piqi │ │ │ │ │ ├── test │ │ │ │ │ ├── Ad.piqi │ │ │ │ │ └── ea.piqi │ │ │ │ ├── ocaml_riak_pb │ │ │ │ │ ├── README │ │ │ │ │ └── riak_kv.ocaml.piqi │ │ │ │ ├── boot_proto2piqi │ │ │ │ │ ├── README │ │ │ │ │ └── Makefile │ │ │ │ ├── piqi_packed │ │ │ │ │ ├── Makefile │ │ │ │ │ └── packed-nocompat.piqi │ │ │ │ └── piqi_misc │ │ │ │ │ └── Makefile │ │ │ ├── src │ │ │ │ ├── piqi_src.erl │ │ │ │ ├── piqi_src.app.src │ │ │ │ └── README │ │ │ ├── piqi-rpc │ │ │ │ ├── ebin │ │ │ │ │ └── .gitignore │ │ │ │ ├── examples │ │ │ │ │ ├── addressbook │ │ │ │ │ │ ├── .gitignore │ │ │ │ │ │ ├── server.sh │ │ │ │ │ │ ├── person.piq │ │ │ │ │ │ └── addressbook.piqi │ │ │ │ │ ├── process_info │ │ │ │ │ │ ├── .gitignore │ │ │ │ │ │ └── server.sh │ │ │ │ │ └── Makefile │ │ │ │ ├── piqic-erlang-rpc │ │ │ │ │ ├── .gitignore │ │ │ │ │ └── Makefile │ │ │ │ ├── src │ │ │ │ │ ├── .gitignore │ │ │ │ │ └── debug.hrl │ │ │ │ └── Makefile │ │ │ ├── piqi-tools │ │ │ │ ├── piqi-rpc.piqi │ │ │ │ ├── descriptor.proto │ │ │ │ ├── .gitignore │ │ │ │ ├── descriptor.ocaml.piqi │ │ │ │ └── piqi_run.ml │ │ │ ├── piqilib │ │ │ │ ├── piqi.piqi │ │ │ │ ├── piqi-lang.piqi │ │ │ │ ├── piqi_c.idl │ │ │ │ ├── .gitignore │ │ │ │ ├── piqi_c.ml │ │ │ │ ├── piqi_c.mli │ │ │ │ └── META │ │ │ ├── piqi-erlang │ │ │ │ ├── ebin │ │ │ │ │ └── .gitignore │ │ │ │ ├── include │ │ │ │ │ ├── piqi_piqi.hrl │ │ │ │ │ ├── piqi_rpc_piqi.hrl │ │ │ │ │ └── piqi_tools_piqi.hrl │ │ │ │ ├── src │ │ │ │ │ ├── piqi-rpc.piqi │ │ │ │ │ ├── piqi-tools.piqi │ │ │ │ │ ├── .gitignore │ │ │ │ │ ├── debug.hrl │ │ │ │ │ ├── piqi.app.src │ │ │ │ │ ├── piqi.piqi │ │ │ │ │ └── Makefile.piqi │ │ │ │ ├── piqic-erlang-ext │ │ │ │ │ ├── .gitignore │ │ │ │ │ └── Makefile │ │ │ │ ├── Makefile │ │ │ │ └── README │ │ │ ├── piqicc │ │ │ │ ├── piqi.piqi │ │ │ │ ├── piqi-lang.piqi │ │ │ │ ├── piqi-impl.piqi │ │ │ │ ├── piqicc_run.ml │ │ │ │ └── .gitignore │ │ │ ├── make │ │ │ │ ├── OCamlMakefile │ │ │ │ └── Makefile.dirs │ │ │ ├── deps │ │ │ │ ├── easy-format-1.0.0 │ │ │ │ │ ├── TODO │ │ │ │ │ ├── META.tpl │ │ │ │ │ ├── META │ │ │ │ │ ├── examples │ │ │ │ │ │ └── Makefile │ │ │ │ │ └── README │ │ │ │ ├── ulex-1.1 │ │ │ │ │ ├── _tags │ │ │ │ │ ├── test.ml │ │ │ │ │ ├── META │ │ │ │ │ ├── myocamlbuild.ml │ │ │ │ │ ├── ulex.mli │ │ │ │ │ ├── utf8.mli │ │ │ │ │ └── utf8_test.ml │ │ │ │ ├── .gitignore │ │ │ │ ├── xmlm-1.1.1 │ │ │ │ │ ├── META │ │ │ │ │ └── Makefile │ │ │ │ └── Makefile │ │ │ ├── AUTHORS │ │ │ ├── editors │ │ │ │ └── vim │ │ │ │ │ └── piq.vim │ │ │ ├── doc │ │ │ │ └── README.md │ │ │ ├── .gitignore │ │ │ ├── piqi │ │ │ │ ├── piqi.json.piqi │ │ │ │ └── piqi.getopt.piqi │ │ │ └── setenv.sh │ │ └── Makefile │ ├── protobuf │ │ ├── python │ │ │ └── google │ │ │ │ ├── protobuf │ │ │ │ ├── __init__.py │ │ │ │ └── internal │ │ │ │ │ └── __init__.py │ │ │ │ └── __init__.py │ │ ├── CONTRIBUTORS.txt │ │ ├── src │ │ │ └── google │ │ │ │ └── protobuf │ │ │ │ └── testdata │ │ │ │ ├── golden_message │ │ │ │ └── golden_packed_fields_message │ │ ├── editors │ │ │ └── README.txt │ │ ├── gtest │ │ │ └── xcode │ │ │ │ └── Config │ │ │ │ ├── TestTarget.xcconfig │ │ │ │ ├── FrameworkTarget.xcconfig │ │ │ │ └── StaticLibraryTarget.xcconfig │ │ ├── protobuf-lite.pc.in │ │ ├── protobuf.pc.in │ │ └── examples │ │ │ └── addressbook.proto │ ├── src │ │ ├── Makefile.am │ │ ├── ocaml │ │ │ ├── arch.idl │ │ │ └── utils │ │ │ │ ├── readtrace.ml │ │ │ │ └── copytrace.ml │ │ └── cpp │ │ │ ├── Makefile.am │ │ │ └── utils │ │ │ └── Makefile.am │ ├── Makefile.am │ ├── autogen.sh │ └── piqi-files │ │ └── modloadframe.piqi └── Makefile.in ├── pcre-ocaml ├── OMakefile ├── examples │ ├── OMakefile │ ├── cloc │ │ ├── OMakefile │ │ ├── README │ │ ├── Makefile │ │ ├── make_win32_cloc.bat │ │ └── cloc.ml │ ├── pcregrep │ │ ├── README │ │ ├── OMakefile │ │ └── Makefile │ ├── subst │ │ ├── OMakefile │ │ ├── README │ │ └── Makefile │ └── count_hash │ │ ├── OMakefile │ │ ├── README │ │ ├── Makefile │ │ └── count_hash.ml ├── .hgignore ├── Makefile.conf ├── .hg_archival.txt ├── lib │ ├── META │ ├── Makefile │ └── OMakefile └── Makefile ├── STYLE.C ├── batteries ├── qtest │ ├── _tags │ ├── README.md │ └── qtest_preamble.ml ├── testsuite │ ├── _tags │ ├── myocamlbuild.ml │ ├── test_multipmap.ml │ └── test_dynarray.ml ├── examples │ ├── euler │ │ ├── euler022.ml │ │ ├── euler014.ml │ │ ├── Makefile │ │ ├── euler009.ml │ │ ├── euler010.ml │ │ ├── euler001.ml │ │ ├── euler023.ml │ │ ├── euler012.ml │ │ └── euler024.ml │ ├── tools │ │ ├── myocamlbuild.ml │ │ ├── _tags │ │ ├── now.ml │ │ ├── browser.ml │ │ ├── shuffle.ml │ │ ├── shuffle2.ml │ │ ├── tools.itarget │ │ ├── cat.ml │ │ ├── mygzip.ml │ │ └── gunzip.ml │ ├── snippets │ │ ├── myocamlbuild.ml │ │ ├── unicode.ml │ │ ├── unicode2.ml │ │ ├── _tags │ │ ├── snippets.itarget │ │ ├── netchan_cat.ml │ │ ├── ropes_vs_strings.ml │ │ └── parallelsort.ml │ ├── _tags │ ├── benchmark │ │ ├── _tags │ │ └── run_tests.sh │ └── README ├── build │ ├── ocaml │ ├── preprocess_mli │ │ └── _tags │ ├── optcomp │ │ ├── _tags │ │ ├── META │ │ ├── sample_incl.ml │ │ ├── optcomp_r.ml │ │ └── optcomp_o.ml │ ├── README │ └── import.ml ├── benchsuite │ ├── _tags │ ├── array_filter.png │ ├── README │ ├── flip.ml │ ├── bench_num.ml │ └── fsum.ml ├── src │ ├── batteriesThread.mllib │ ├── batChar.ml │ ├── batChar.mli │ ├── batteriesThread.ml │ ├── _tags │ └── extlib.ml ├── _tags ├── README.folders ├── META.in └── .gitignore ├── ocaml ├── lnf_havlak.mli ├── lnf_sreedhar.mli ├── lnf_reduced_havlak.mli ├── lnf_steensgard.mli ├── typesig.sh ├── sccvn.mli ├── ast_cond_simplify.mli ├── lnf_ramalingam.mli ├── BatListFull.ml ├── tunegc.mli ├── prune_unreachable.ml ├── prune_unreachable.mli ├── tunegc.ml ├── disasm.ml ├── lnf_interface.mli ├── grammar.mly.mli ├── arch.mli ├── lnf_interface.ml ├── piqi │ └── ast_piqi.mli ├── var_temp.ml ├── steensgard.mli ├── ast_mapper.mli ├── ast_mapper.ml ├── ssa_cond_simplify.mli ├── func_boundary.mli ├── asmir_consts.ml └── var_temp.mli ├── tests ├── asm │ ├── nop.S │ ├── vsa-a.S │ ├── vsa-a2.S │ ├── vsa-ae.S │ ├── vsa-b.S │ ├── vsa-be.S │ ├── vsa-e.S │ ├── vsa-e2.S │ ├── vsa-g.S │ ├── vsa-ge.S │ ├── vsa-l.S │ ├── vsa-le.S │ ├── vsa-ne.S │ ├── vsa-ae2.S │ ├── Makefile │ └── mem.S ├── IL │ └── unroll │ │ ├── reducible.il │ │ └── irreducible.il ├── C │ ├── unroll.c │ ├── switch.c │ ├── recover-hard-pointer.c │ ├── recover-hard.c │ ├── test.c │ └── Makefile.in ├── disasm_i386_suite.ml ├── ast_suite.ml ├── sreedhar_suite.ml ├── var_suite.ml └── reduced_havlak_suite.ml ├── utils-proj.example ├── testutil.ml ├── README └── Makefile ├── m4 └── ac_ocaml.m4 ├── ocamlgraph ├── CHANGES ├── COPYING ├── CREDITS ├── src │ └── md.mli ├── dgraph │ ├── xDot.ml │ ├── xDot.mli │ ├── xDotDraw.ml │ ├── xDotDraw.mli │ ├── dGraphMake.ml │ ├── dGraphModel.ml │ ├── dGraphView.ml │ ├── dGraphView.mli │ ├── dGraphModel.mli │ ├── dGraphSubTree.ml │ ├── dGraphSubTree.mli │ ├── dGraphViewItem.ml │ ├── dGraphViewer.ml │ ├── dGraphContainer.ml │ ├── dGraphContainer.mli │ ├── dGraphRandModel.ml │ ├── dGraphRandModel.mli │ ├── dGraphTreeLayout.ml │ ├── dGraphTreeModel.ml │ ├── dGraphTreeModel.mli │ ├── dGraphViewItem.mli │ └── dGraphTreeLayout.mli ├── tests │ └── bench.ml ├── META.in ├── editor │ └── tests │ │ ├── dep_ed.dot │ │ ├── parcours.dot │ │ ├── test2_2.gml │ │ ├── fsm.dot │ │ ├── test2,1_2.gml │ │ ├── test2,1_3.gml │ │ └── test2,1_3tot.gml ├── view_graph │ └── README └── INSTALL ├── pintraces ├── iltest │ ├── mmapped.bin │ └── TRACE ├── README ├── Makefile.in ├── ddk-inc │ └── README ├── getpin.sh └── Makefile.pin ├── ocaml-proj.example ├── README ├── Makefile └── deployproj.sh ├── tests-proj.example ├── README └── Makefile ├── ounit ├── src │ ├── oUnit.mllib │ ├── api-ounit.odocl │ └── META ├── AUTHORS.txt ├── examples │ ├── test_suite.ml │ ├── Makefile │ ├── test_list2.ml │ ├── example.ml │ └── test_list.ml ├── configure ├── ci-main.lua └── README.txt ├── libasmir ├── include │ └── common.h ├── Makefile.am └── src │ └── Makefile.am ├── zarith └── META ├── autogen.sh ├── solvers └── getz3.sh ├── AUTHORS ├── README ├── utils ├── bisect.bash └── backtaint.ml ├── Makefile.am └── TODO /ChangeLog: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vagrant/.gitignore: -------------------------------------------------------------------------------- 1 | .vagrant 2 | -------------------------------------------------------------------------------- /doc/chap-tools/add2.s: -------------------------------------------------------------------------------- 1 | add $2, %eax 2 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/README: -------------------------------------------------------------------------------- 1 | Libtrace -------------------------------------------------------------------------------- /pcre-ocaml/OMakefile: -------------------------------------------------------------------------------- 1 | Subdirs() 2 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/AUTHORS: -------------------------------------------------------------------------------- 1 | Ed Schwartz -------------------------------------------------------------------------------- /libtracewrap/libtrace/ChangeLog: -------------------------------------------------------------------------------- 1 | See SVN 2 | -------------------------------------------------------------------------------- /STYLE.C: -------------------------------------------------------------------------------- 1 | For our C code, we use K&R style. 2 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/NEWS: -------------------------------------------------------------------------------- 1 | No news is good news. -------------------------------------------------------------------------------- /batteries/qtest/_tags: -------------------------------------------------------------------------------- 1 | true: threads, debug 2 | 3 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/VERSION: -------------------------------------------------------------------------------- 1 | 0.6.0 2 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/examples/empty.piq: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/examples/empty.piqi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqi-camlp4/3.10: -------------------------------------------------------------------------------- 1 | 3.11 -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqi-camlp4/4.00: -------------------------------------------------------------------------------- 1 | 3.12 -------------------------------------------------------------------------------- /ocaml/lnf_havlak.mli: -------------------------------------------------------------------------------- 1 | module Make: Lnf.MakeType 2 | -------------------------------------------------------------------------------- /ocaml/lnf_sreedhar.mli: -------------------------------------------------------------------------------- 1 | module Make: Lnf.MakeType 2 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/bin/piqi: -------------------------------------------------------------------------------- 1 | ../piqi-tools/piqi -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/bin/piqic: -------------------------------------------------------------------------------- 1 | ../piqic/piqic -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/bin/piqicc: -------------------------------------------------------------------------------- 1 | ../piqicc/piqicc -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqic/piqic_common_ext.ml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqirun-ocaml/.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/examples: -------------------------------------------------------------------------------- 1 | ../examples -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/self_spec: -------------------------------------------------------------------------------- 1 | ../piqi -------------------------------------------------------------------------------- /ocaml/lnf_reduced_havlak.mli: -------------------------------------------------------------------------------- 1 | module Make: Lnf.MakeType 2 | -------------------------------------------------------------------------------- /ocaml/lnf_steensgard.mli: -------------------------------------------------------------------------------- 1 | module Make: Lnf.MakeType 2 | -------------------------------------------------------------------------------- /batteries/testsuite/_tags: -------------------------------------------------------------------------------- 1 | true: pkg_oUnit, threads, debug 2 | -------------------------------------------------------------------------------- /batteries/testsuite/myocamlbuild.ml: -------------------------------------------------------------------------------- 1 | ../build/myocamlbuild.ml -------------------------------------------------------------------------------- /batteries/examples/euler/euler022.ml: -------------------------------------------------------------------------------- 1 | (* uses names.txt *) 2 | 3 | -------------------------------------------------------------------------------- /batteries/examples/tools/myocamlbuild.ml: -------------------------------------------------------------------------------- 1 | ../../build/myocamlbuild.ml -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/examples/erlang/test: -------------------------------------------------------------------------------- 1 | ../ocaml/test -------------------------------------------------------------------------------- /libtracewrap/libtrace/protobuf/python/google/protobuf/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /batteries/build/ocaml: -------------------------------------------------------------------------------- 1 | ocaml -init `ocamlfind query batteries`/ocamlinit -------------------------------------------------------------------------------- /batteries/examples/snippets/myocamlbuild.ml: -------------------------------------------------------------------------------- 1 | ../../build/myocamlbuild.ml -------------------------------------------------------------------------------- /batteries/examples/tools/_tags: -------------------------------------------------------------------------------- 1 | not(<*_dyn*>): pkg_batteries,debug 2 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/src/piqi_src.erl: -------------------------------------------------------------------------------- 1 | -module(piqi_src). 2 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/ocaml_addressbook: -------------------------------------------------------------------------------- 1 | ../examples/ocaml -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/piqi_proto/.gitignore: -------------------------------------------------------------------------------- 1 | google 2 | -------------------------------------------------------------------------------- /tests/asm/nop.S: -------------------------------------------------------------------------------- 1 | .globl main 2 | 3 | main: 4 | nop 5 | ret 6 | 7 | -------------------------------------------------------------------------------- /utils-proj.example/testutil.ml: -------------------------------------------------------------------------------- 1 | print_string (Testlib.testf ()) ;; 2 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqi-rpc/ebin/.gitignore: -------------------------------------------------------------------------------- 1 | *.app 2 | *.beam 3 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqi-tools/piqi-rpc.piqi: -------------------------------------------------------------------------------- 1 | ../piqi/piqi-rpc.piqi -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqilib/piqi.piqi: -------------------------------------------------------------------------------- 1 | .include [ piqi/piqi ] 2 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/erlang_addressbook: -------------------------------------------------------------------------------- 1 | ../examples/erlang -------------------------------------------------------------------------------- /libtracewrap/libtrace/protobuf/python/google/protobuf/internal/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /m4/ac_ocaml.m4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/m4/ac_ocaml.m4 -------------------------------------------------------------------------------- /pcre-ocaml/examples/OMakefile: -------------------------------------------------------------------------------- 1 | OCAML_LIBRARIES = pcre 2 | 3 | Subdirs() 4 | -------------------------------------------------------------------------------- /batteries/build/preprocess_mli/_tags: -------------------------------------------------------------------------------- 1 | <*>:camlp4oof,use_camlp4_full,use_ocamlbuild -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/examples/erlang/addressbook.piq: -------------------------------------------------------------------------------- 1 | ../addressbook.piq -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/examples/ocaml/addressbook.piq: -------------------------------------------------------------------------------- 1 | ../addressbook.piq -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqi-erlang/ebin/.gitignore: -------------------------------------------------------------------------------- 1 | *.app 2 | *.beam 3 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqicc/piqi.piqi: -------------------------------------------------------------------------------- 1 | .include [ .module piqi/piqi ] 2 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/erlang_import/piqi-erlang: -------------------------------------------------------------------------------- 1 | ../../piqi-erlang -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/erlang_packed/piqi-erlang: -------------------------------------------------------------------------------- 1 | ../../piqi-erlang -------------------------------------------------------------------------------- /pcre-ocaml/.hgignore: -------------------------------------------------------------------------------- 1 | (^|/)\.bzr($|/) 2 | (^|/)\.hg($|/) 3 | (^|/)\.hgtags($|/) 4 | -------------------------------------------------------------------------------- /batteries/benchsuite/_tags: -------------------------------------------------------------------------------- 1 | : pkg_benchmark 2 | : rectypes -------------------------------------------------------------------------------- /batteries/src/batteriesThread.mllib: -------------------------------------------------------------------------------- 1 | BatMutex 2 | BatRMutex 3 | BatteriesThread 4 | -------------------------------------------------------------------------------- /doc/fig/add-shl.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/doc/fig/add-shl.pdf -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/examples/bool.piq: -------------------------------------------------------------------------------- 1 | (:bool) 2 | 3 | true false 4 | 5 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/examples/erlang/addressbook.proto: -------------------------------------------------------------------------------- 1 | ../addressbook.proto -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/examples/ocaml/addressbook.proto: -------------------------------------------------------------------------------- 1 | ../addressbook.proto -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqi-erlang/include/piqi_piqi.hrl: -------------------------------------------------------------------------------- 1 | ../src/piqi_piqi.hrl -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqi-erlang/src/piqi-rpc.piqi: -------------------------------------------------------------------------------- 1 | ../../piqi/piqi-rpc.piqi -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/cpp/piqi.piqi: -------------------------------------------------------------------------------- 1 | .include [ .module piqi/piqi ] 2 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/ocaml_custom_types: -------------------------------------------------------------------------------- 1 | ../examples/ocaml-custom-types -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/ocaml_packed/packed.piqi: -------------------------------------------------------------------------------- 1 | ../piqi_packed/packed.piqi -------------------------------------------------------------------------------- /ocamlgraph/CHANGES: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/ocamlgraph/CHANGES -------------------------------------------------------------------------------- /ocamlgraph/COPYING: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/ocamlgraph/COPYING -------------------------------------------------------------------------------- /ocamlgraph/CREDITS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/ocamlgraph/CREDITS -------------------------------------------------------------------------------- /batteries/build/optcomp/_tags: -------------------------------------------------------------------------------- 1 | <*>:camlp4of,use_camlp4_full 2 | : use_dynlink 3 | -------------------------------------------------------------------------------- /batteries/examples/_tags: -------------------------------------------------------------------------------- 1 | 2 | : pkg_netstring 3 | : thread 4 | 5 | -------------------------------------------------------------------------------- /doc/chap-examples/test: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/doc/chap-examples/test -------------------------------------------------------------------------------- /doc/fig/components.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/doc/fig/components.pdf -------------------------------------------------------------------------------- /doc/fig/toolchain.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/doc/fig/toolchain.pdf -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqi-erlang/include/piqi_rpc_piqi.hrl: -------------------------------------------------------------------------------- 1 | ../src/piqi_rpc_piqi.hrl -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/erlang_packed/packed.piqi: -------------------------------------------------------------------------------- 1 | ../piqi_packed/packed.piqi -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/erlang_packed/test-all.piq: -------------------------------------------------------------------------------- 1 | ../piqi_packed/test-all.piq -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/ocaml_array/test-all.piq: -------------------------------------------------------------------------------- 1 | ../piqi_packed/test-all.piq -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/ocaml_packed/test-all.piq: -------------------------------------------------------------------------------- 1 | ../piqi_packed/test-all.piq -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/ocaml_perf/piqi.piqi: -------------------------------------------------------------------------------- 1 | .include [ .module piqi/piqi ] 2 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/ocaml_piqi/piqi.ocaml.piqi: -------------------------------------------------------------------------------- 1 | ../../piqic/piqi.ocaml.piqi -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/ocaml_piqi/piqi.piqi: -------------------------------------------------------------------------------- 1 | .include [ .module piqi/piqi ] 2 | -------------------------------------------------------------------------------- /ocamlgraph/src/md.mli: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/ocamlgraph/src/md.mli -------------------------------------------------------------------------------- /batteries/src/batChar.ml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/batteries/src/batChar.ml -------------------------------------------------------------------------------- /batteries/src/batChar.mli: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/batteries/src/batChar.mli -------------------------------------------------------------------------------- /doc/chap-examples/basic.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/doc/chap-examples/basic.o -------------------------------------------------------------------------------- /doc/chap-examples/cdg.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/doc/chap-examples/cdg.pdf -------------------------------------------------------------------------------- /doc/chap-examples/ddg.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/doc/chap-examples/ddg.pdf -------------------------------------------------------------------------------- /doc/fig/memvsarray-1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/doc/fig/memvsarray-1.pdf -------------------------------------------------------------------------------- /doc/fig/memvsarray-2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/doc/fig/memvsarray-2.pdf -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/bin/piqic-erlang-rpc: -------------------------------------------------------------------------------- 1 | ../piqi-rpc/piqic-erlang-rpc/piqic-erlang-rpc -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/examples/ocaml-piq-config/OCamlMakefile: -------------------------------------------------------------------------------- 1 | ../../make/OCamlMakefile -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/make/OCamlMakefile: -------------------------------------------------------------------------------- 1 | ../deps/ocaml-make-release-6.29.3/OCamlMakefile -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqi-erlang/include/piqi_tools_piqi.hrl: -------------------------------------------------------------------------------- 1 | ../src/piqi_tools_piqi.hrl -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqi-erlang/src/piqi-tools.piqi: -------------------------------------------------------------------------------- 1 | ../../piqi-tools/piqi-tools.piqi -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqilib/piqi-lang.piqi: -------------------------------------------------------------------------------- 1 | .include [ .module piqi/piqi-lang ] 2 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/erlang_misc/empty-record.piqi: -------------------------------------------------------------------------------- 1 | ../ocaml_misc/empty-record.piqi -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/erlang_piqi/piqi.piqi: -------------------------------------------------------------------------------- 1 | .include [ .module piqi/piqi ] 2 | -------------------------------------------------------------------------------- /ocamlgraph/dgraph/xDot.ml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/ocamlgraph/dgraph/xDot.ml -------------------------------------------------------------------------------- /ocamlgraph/tests/bench.ml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/ocamlgraph/tests/bench.ml -------------------------------------------------------------------------------- /doc/chap-developer.tex: -------------------------------------------------------------------------------- 1 | \chapter{\bap Development Guide} 2 | 3 | \input{chap-developer/overview} 4 | -------------------------------------------------------------------------------- /doc/chap-intro.tex: -------------------------------------------------------------------------------- 1 | \chapter{Introduction} 2 | \input{chap-intro/intro} 3 | \input{chap-intro/overview} -------------------------------------------------------------------------------- /doc/fig/running-example.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/doc/fig/running-example.pdf -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/bin/piqic-erlang-ext: -------------------------------------------------------------------------------- 1 | ../piqi-erlang/piqic-erlang-ext/piqic-erlang-ext -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqi-camlp4/.gitignore: -------------------------------------------------------------------------------- 1 | /pa_labelscope.ml 2 | /pa_openin.ml 3 | 4 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqi-tools/descriptor.proto: -------------------------------------------------------------------------------- 1 | ../tests/boot_proto2piqi/descriptor.proto -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/erlang_perf/addressbook.piq: -------------------------------------------------------------------------------- 1 | ../erlang_addressbook/addressbook.piq -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/ocaml_misc/empty-record.piqi: -------------------------------------------------------------------------------- 1 | .record [ 2 | .name r 3 | ] 4 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/ocaml_perf/addressbook.piq: -------------------------------------------------------------------------------- 1 | ../erlang_addressbook/addressbook.piq -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/ocaml_piq_config/ocaml-piq-config: -------------------------------------------------------------------------------- 1 | ../../examples/ocaml-piq-config -------------------------------------------------------------------------------- /ocamlgraph/dgraph/xDot.mli: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/ocamlgraph/dgraph/xDot.mli -------------------------------------------------------------------------------- /pcre-ocaml/examples/cloc/OMakefile: -------------------------------------------------------------------------------- 1 | OCamlMakeProjDefaults(cloc.exe) 2 | 3 | InstantiateOCamlEnv() 4 | -------------------------------------------------------------------------------- /pcre-ocaml/examples/pcregrep/README: -------------------------------------------------------------------------------- 1 | Start the program with argument "-help" to see what it does! 2 | -------------------------------------------------------------------------------- /pcre-ocaml/examples/subst/OMakefile: -------------------------------------------------------------------------------- 1 | OCamlMakeProjDefaults(subst.exe) 2 | 3 | InstantiateOCamlEnv() 4 | -------------------------------------------------------------------------------- /doc/chap-examples/basiccfg.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/doc/chap-examples/basiccfg.pdf -------------------------------------------------------------------------------- /doc/chap-examples/ssacfg.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/doc/chap-examples/ssacfg.pdf -------------------------------------------------------------------------------- /doc/chap-tools/Makefile: -------------------------------------------------------------------------------- 1 | add2.il: add2.o 2 | toil -bin $< -o $@ 3 | 4 | add2.o: add2.s 5 | $(CC) -m32 -c $< -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/examples/flag.piq: -------------------------------------------------------------------------------- 1 | 2 | :def/r [ 3 | .i 0 4 | .flag 5 | ] 6 | 7 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqilib/piqi_c.idl: -------------------------------------------------------------------------------- 1 | [int64] int piqi_strtoull ([string] char str []); 2 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/erlang_packed/packed-nocompat.piqi: -------------------------------------------------------------------------------- 1 | ../piqi_packed/packed-nocompat.piqi -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/ocaml_packed/packed-nocompat.piqi: -------------------------------------------------------------------------------- 1 | ../piqi_packed/packed-nocompat.piqi -------------------------------------------------------------------------------- /ocamlgraph/dgraph/xDotDraw.ml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/ocamlgraph/dgraph/xDotDraw.ml -------------------------------------------------------------------------------- /ocamlgraph/dgraph/xDotDraw.mli: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/ocamlgraph/dgraph/xDotDraw.mli -------------------------------------------------------------------------------- /pintraces/iltest/mmapped.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/pintraces/iltest/mmapped.bin -------------------------------------------------------------------------------- /batteries/build/README: -------------------------------------------------------------------------------- 1 | This directory contains tools used during the compilation 2 | of Batteries Included. 3 | -------------------------------------------------------------------------------- /doc/chap-examples/ssaconvcfg.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/doc/chap-examples/ssaconvcfg.pdf -------------------------------------------------------------------------------- /doc/chap-examples/ssasimpcfg.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/doc/chap-examples/ssasimpcfg.pdf -------------------------------------------------------------------------------- /libtracewrap/libtrace/src/Makefile.am: -------------------------------------------------------------------------------- 1 | AUTOMAKE_OPTIONS = subdir-objects 2 | SUBDIRS=cpp ocaml ocaml/utils 3 | -------------------------------------------------------------------------------- /ocamlgraph/dgraph/dGraphMake.ml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/ocamlgraph/dgraph/dGraphMake.ml -------------------------------------------------------------------------------- /ocamlgraph/dgraph/dGraphModel.ml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/ocamlgraph/dgraph/dGraphModel.ml -------------------------------------------------------------------------------- /ocamlgraph/dgraph/dGraphView.ml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/ocamlgraph/dgraph/dGraphView.ml -------------------------------------------------------------------------------- /ocamlgraph/dgraph/dGraphView.mli: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/ocamlgraph/dgraph/dGraphView.mli -------------------------------------------------------------------------------- /pcre-ocaml/examples/count_hash/OMakefile: -------------------------------------------------------------------------------- 1 | OCamlMakeProjDefaults(count_hash.exe) 2 | 3 | InstantiateOCamlEnv() 4 | -------------------------------------------------------------------------------- /pcre-ocaml/examples/pcregrep/OMakefile: -------------------------------------------------------------------------------- 1 | OCamlMakeProjDefaults(pcregrep.exe) 2 | 3 | InstantiateOCamlEnv() 4 | -------------------------------------------------------------------------------- /doc/chap-tools/obtaining.tex: -------------------------------------------------------------------------------- 1 | \section{Obtaining \bap} 2 | BAP can be found at \url{http://bap.ece.cmu.edu}. 3 | 4 | -------------------------------------------------------------------------------- /doc/fig/running-example-patch.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/doc/fig/running-example-patch.pdf -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/deps/easy-format-1.0.0/TODO: -------------------------------------------------------------------------------- 1 | $Id: TODO 25 2008-07-13 15:15:00Z mjambon $ 2 | 3 | 4 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/erlang_perf/addressbook.erlang.piqi: -------------------------------------------------------------------------------- 1 | ../erlang_addressbook/addressbook.erlang.piqi -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/erlang_perf/addressbook.proto.piqi: -------------------------------------------------------------------------------- 1 | ../erlang_addressbook/addressbook.proto.piqi -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/ocaml_perf/addressbook.ocaml.piqi: -------------------------------------------------------------------------------- 1 | ../ocaml_addressbook/addressbook.ocaml.piqi -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/ocaml_perf/addressbook.proto.piqi: -------------------------------------------------------------------------------- 1 | ../erlang_addressbook/addressbook.proto.piqi -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/piqi_server/Makefile: -------------------------------------------------------------------------------- 1 | 2 | all: 3 | ./test_piqi_server 4 | 5 | clean: 6 | 7 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/protobuf/python/google/__init__.py: -------------------------------------------------------------------------------- 1 | __import__('pkg_resources').declare_namespace(__name__) 2 | -------------------------------------------------------------------------------- /ocamlgraph/dgraph/dGraphModel.mli: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/ocamlgraph/dgraph/dGraphModel.mli -------------------------------------------------------------------------------- /ocamlgraph/dgraph/dGraphSubTree.ml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/ocamlgraph/dgraph/dGraphSubTree.ml -------------------------------------------------------------------------------- /ocamlgraph/dgraph/dGraphSubTree.mli: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/ocamlgraph/dgraph/dGraphSubTree.mli -------------------------------------------------------------------------------- /ocamlgraph/dgraph/dGraphViewItem.ml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/ocamlgraph/dgraph/dGraphViewItem.ml -------------------------------------------------------------------------------- /ocamlgraph/dgraph/dGraphViewer.ml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/ocamlgraph/dgraph/dGraphViewer.ml -------------------------------------------------------------------------------- /pcre-ocaml/Makefile.conf: -------------------------------------------------------------------------------- 1 | # export STATIC = yes 2 | # export INCDIRS := /usr/include/pcre 3 | # export LIBDIRS := 4 | -------------------------------------------------------------------------------- /batteries/benchsuite/array_filter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/batteries/benchsuite/array_filter.png -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/ocaml_misc/variant-1.piqi: -------------------------------------------------------------------------------- 1 | .enum [ 2 | .name e 3 | .option [ a ] 4 | ] 5 | -------------------------------------------------------------------------------- /ocamlgraph/dgraph/dGraphContainer.ml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/ocamlgraph/dgraph/dGraphContainer.ml -------------------------------------------------------------------------------- /ocamlgraph/dgraph/dGraphContainer.mli: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/ocamlgraph/dgraph/dGraphContainer.mli -------------------------------------------------------------------------------- /ocamlgraph/dgraph/dGraphRandModel.ml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/ocamlgraph/dgraph/dGraphRandModel.ml -------------------------------------------------------------------------------- /ocamlgraph/dgraph/dGraphRandModel.mli: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/ocamlgraph/dgraph/dGraphRandModel.mli -------------------------------------------------------------------------------- /ocamlgraph/dgraph/dGraphTreeLayout.ml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/ocamlgraph/dgraph/dGraphTreeLayout.ml -------------------------------------------------------------------------------- /ocamlgraph/dgraph/dGraphTreeModel.ml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/ocamlgraph/dgraph/dGraphTreeModel.ml -------------------------------------------------------------------------------- /ocamlgraph/dgraph/dGraphTreeModel.mli: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/ocamlgraph/dgraph/dGraphTreeModel.mli -------------------------------------------------------------------------------- /ocamlgraph/dgraph/dGraphViewItem.mli: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/ocamlgraph/dgraph/dGraphViewItem.mli -------------------------------------------------------------------------------- /batteries/examples/snippets/unicode.ml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/batteries/examples/snippets/unicode.ml -------------------------------------------------------------------------------- /batteries/examples/snippets/unicode2.ml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/batteries/examples/snippets/unicode2.ml -------------------------------------------------------------------------------- /doc/credits.tex: -------------------------------------------------------------------------------- 1 | \chapter{Credits} 2 | See \url{http://bap.ece.cmu.edu} for a list of current and former \bap 3 | developers. 4 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/Makefile.am: -------------------------------------------------------------------------------- 1 | AUTOMAKE_OPTIONS = subdir-objects 2 | SUBDIRS=piqi protobuf src 3 | ACLOCAL_AMFLAGS=-I m4 4 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqi-rpc/examples/addressbook/.gitignore: -------------------------------------------------------------------------------- 1 | *.beam 2 | 3 | *_piqi*.erl 4 | *_piqi*.hrl 5 | 6 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqi-rpc/examples/process_info/.gitignore: -------------------------------------------------------------------------------- 1 | *.beam 2 | 3 | *_piqi*.erl 4 | *_piqi*.hrl 5 | 6 | -------------------------------------------------------------------------------- /ocaml-proj.example/README: -------------------------------------------------------------------------------- 1 | This is an example project-specific directory. To add it to bap, 2 | move it to bap-dir/../ocaml-proj. -------------------------------------------------------------------------------- /ocamlgraph/dgraph/dGraphTreeLayout.mli: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/ocamlgraph/dgraph/dGraphTreeLayout.mli -------------------------------------------------------------------------------- /tests-proj.example/README: -------------------------------------------------------------------------------- 1 | This is an example project-specific directory. To add it to bap, 2 | move it to bap-dir/../tests-proj. -------------------------------------------------------------------------------- /utils-proj.example/README: -------------------------------------------------------------------------------- 1 | This is an example project-specific directory. To add it to bap, 2 | move it to bap-dir/../utils-proj. -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/examples/piq-word.piq: -------------------------------------------------------------------------------- 1 | (:piq-format/word) 2 | 3 | abc 4 | 5 | !!!!! 6 | 7 | *0-=+q`~@j\/& 8 | 9 | -------------------------------------------------------------------------------- /ocaml/typesig.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ocamlfind ocamlc -package str,ocamlgraph,extlib,unix,sqlite3 -c -i -for-pack Bap -for-pack Bap $1 3 | -------------------------------------------------------------------------------- /tests/asm/vsa-a.S: -------------------------------------------------------------------------------- 1 | mov $0, %ecx 2 | 3 | loop: 4 | 5 | inc %ecx 6 | cmp $20, %ecx 7 | ja loop 8 | 9 | done: 10 | hlt 11 | -------------------------------------------------------------------------------- /tests/asm/vsa-a2.S: -------------------------------------------------------------------------------- 1 | mov $30, %ecx 2 | 3 | loop: 4 | 5 | dec %ecx 6 | cmp $20, %ecx 7 | ja loop 8 | 9 | done: 10 | hlt 11 | -------------------------------------------------------------------------------- /tests/asm/vsa-ae.S: -------------------------------------------------------------------------------- 1 | mov $0, %ecx 2 | 3 | loop: 4 | 5 | inc %ecx 6 | cmp $20, %ecx 7 | jae loop 8 | 9 | done: 10 | hlt 11 | -------------------------------------------------------------------------------- /tests/asm/vsa-b.S: -------------------------------------------------------------------------------- 1 | mov $0, %ecx 2 | 3 | loop: 4 | 5 | inc %ecx 6 | cmp $20, %ecx 7 | jb loop 8 | 9 | done: 10 | hlt 11 | -------------------------------------------------------------------------------- /tests/asm/vsa-be.S: -------------------------------------------------------------------------------- 1 | mov $0, %ecx 2 | 3 | loop: 4 | 5 | inc %ecx 6 | cmp $20, %ecx 7 | jbe loop 8 | 9 | done: 10 | hlt 11 | -------------------------------------------------------------------------------- /tests/asm/vsa-e.S: -------------------------------------------------------------------------------- 1 | mov $0, %ecx 2 | 3 | loop: 4 | 5 | inc %ecx 6 | cmp $20, %ecx 7 | je loop 8 | 9 | done: 10 | hlt 11 | -------------------------------------------------------------------------------- /tests/asm/vsa-e2.S: -------------------------------------------------------------------------------- 1 | mov $19, %ecx 2 | 3 | loop: 4 | 5 | inc %ecx 6 | cmp $20, %ecx 7 | je loop 8 | 9 | done: 10 | hlt 11 | -------------------------------------------------------------------------------- /tests/asm/vsa-g.S: -------------------------------------------------------------------------------- 1 | mov $0, %ecx 2 | 3 | loop: 4 | 5 | inc %ecx 6 | cmp $20, %ecx 7 | jg loop 8 | 9 | done: 10 | hlt 11 | -------------------------------------------------------------------------------- /tests/asm/vsa-ge.S: -------------------------------------------------------------------------------- 1 | mov $0, %ecx 2 | 3 | loop: 4 | 5 | inc %ecx 6 | cmp $20, %ecx 7 | jge loop 8 | 9 | done: 10 | hlt 11 | -------------------------------------------------------------------------------- /tests/asm/vsa-l.S: -------------------------------------------------------------------------------- 1 | mov $0, %ecx 2 | 3 | loop: 4 | 5 | inc %ecx 6 | cmp $20, %ecx 7 | jl loop 8 | 9 | done: 10 | hlt 11 | -------------------------------------------------------------------------------- /tests/asm/vsa-le.S: -------------------------------------------------------------------------------- 1 | mov $0, %ecx 2 | 3 | loop: 4 | 5 | inc %ecx 6 | cmp $20, %ecx 7 | jle loop 8 | 9 | done: 10 | hlt 11 | -------------------------------------------------------------------------------- /tests/asm/vsa-ne.S: -------------------------------------------------------------------------------- 1 | mov $0, %ecx 2 | 3 | loop: 4 | 5 | inc %ecx 6 | cmp $20, %ecx 7 | jne loop 8 | 9 | done: 10 | hlt 11 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqi-tools/.gitignore: -------------------------------------------------------------------------------- 1 | piqi 2 | 3 | descriptor_piqi.ml 4 | piqi_tools_piqi.ml 5 | piqi_rpc_piqi.ml 6 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/piqi_proto1/Makefile: -------------------------------------------------------------------------------- 1 | 2 | all: 3 | ./test 4 | 5 | clean: 6 | rm -f *.proto *.proto.piqi t 7 | -------------------------------------------------------------------------------- /tests/asm/vsa-ae2.S: -------------------------------------------------------------------------------- 1 | mov $30, %ecx 2 | 3 | loop: 4 | 5 | dec %ecx 6 | cmp $20, %ecx 7 | jae loop 8 | 9 | done: 10 | hlt 11 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/protobuf/CONTRIBUTORS.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/libtracewrap/libtrace/protobuf/CONTRIBUTORS.txt -------------------------------------------------------------------------------- /ounit/src/oUnit.mllib: -------------------------------------------------------------------------------- 1 | # OASIS_START 2 | # DO NOT EDIT (digest: badb307dc88ab237e46550b25a383039) 3 | OUnit 4 | OUnitDiff 5 | # OASIS_STOP 6 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqi-rpc/examples/Makefile: -------------------------------------------------------------------------------- 1 | include $(PIQI_ROOT)/make/Makefile.dirs 2 | 3 | DIRS = process_info addressbook 4 | 5 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqi-rpc/piqic-erlang-rpc/.gitignore: -------------------------------------------------------------------------------- 1 | *.beam 2 | 3 | piqi_piqi.erl 4 | piqi_piqi.hrl 5 | 6 | piqic-erlang-rpc 7 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqilib/.gitignore: -------------------------------------------------------------------------------- 1 | 2 | piqi_lang_piqi.* 3 | piqi_version.ml 4 | piqi_json_parser.ml 5 | 6 | libpiqilib_stubs.a 7 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/ocaml_misc/Ad.piqi: -------------------------------------------------------------------------------- 1 | .ocaml-module "Ad" 2 | 3 | .alias [ 4 | .name id 5 | .type int64 6 | ] 7 | 8 | -------------------------------------------------------------------------------- /ocaml/sccvn.mli: -------------------------------------------------------------------------------- 1 | val replacer : ?opt:bool -> Cfg.SSA.G.t -> Cfg.SSA.G.t * bool 2 | val aliased : Cfg.SSA.G.t -> Ssa.exp -> Ssa.exp -> bool option 3 | -------------------------------------------------------------------------------- /ounit/src/api-ounit.odocl: -------------------------------------------------------------------------------- 1 | # OASIS_START 2 | # DO NOT EDIT (digest: badb307dc88ab237e46550b25a383039) 3 | OUnit 4 | OUnitDiff 5 | # OASIS_STOP 6 | -------------------------------------------------------------------------------- /libasmir/include/common.h: -------------------------------------------------------------------------------- 1 | #ifndef __COMMON_H 2 | #define __COMMON_H 3 | 4 | #include 5 | 6 | typedef int64_t address_t; 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/examples/erlang/addressbook.proto.piqi: -------------------------------------------------------------------------------- 1 | % This file was generated from "addressbook.proto" using the following command: -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqi-erlang/piqic-erlang-ext/.gitignore: -------------------------------------------------------------------------------- 1 | *.beam 2 | 3 | piqi_piqi.erl 4 | piqi_piqi.hrl 5 | 6 | piqic-erlang-ext 7 | -------------------------------------------------------------------------------- /batteries/examples/snippets/_tags: -------------------------------------------------------------------------------- 1 | <*>: pkg_batteries, syntax_camlp4o, pkg_batteries.syntax, debug 2 | : pkg_netstring 3 | : thread -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/deps/ulex-1.1/_tags: -------------------------------------------------------------------------------- 1 | "pa_ulex.ml": camlp4orf, use_camlp4 2 | or "custom_ulexing.ml": use_ulex 3 | # true: use_ulex 4 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/deps/ulex-1.1/test.ml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/libtracewrap/libtrace/piqi/piqi/deps/ulex-1.1/test.ml -------------------------------------------------------------------------------- /ocamlgraph/META.in: -------------------------------------------------------------------------------- 1 | version = "VERSION" 2 | description = "Generic Graph Library" 3 | requires="" 4 | archive(byte) = "CMA" 5 | archive(native) = "CMXA" 6 | -------------------------------------------------------------------------------- /doc/chap-examples/basic.S: -------------------------------------------------------------------------------- 1 | add %eax, %ebx 2 | shl %cl, %ebx 3 | jc target 4 | 5 | elsewhere: 6 | inc %eax 7 | 8 | target: 9 | inc %ebx 10 | 11 | -------------------------------------------------------------------------------- /doc/chap-examples/test.c: -------------------------------------------------------------------------------- 1 | int g(int y) { 2 | if (y == 42) { return 42; } else { return -1; } 3 | } 4 | 5 | int main(char **argv, int argc) { 6 | return g(42); 7 | } 8 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/deps/.gitignore: -------------------------------------------------------------------------------- 1 | easy-format-1.0.0/bytecode 2 | easy-format-1.0.0/easy_format.annot 3 | easy-format-1.0.0/nativecode 4 | ulex-1.1/_build/ 5 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqi-erlang/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.config 2 | include $(PIQI_ROOT)/make/Makefile.dirs 3 | 4 | DIRS = src piqic-erlang-ext 5 | 6 | -------------------------------------------------------------------------------- /pcre-ocaml/.hg_archival.txt: -------------------------------------------------------------------------------- 1 | repo: 1062d19ece6f075dbc2fff3238732629f8005eb1 2 | node: 853c8a72818fdb44b4268bbe27228af44843f7d3 3 | branch: default 4 | tag: release-6.2.5 5 | -------------------------------------------------------------------------------- /pcre-ocaml/examples/count_hash/README: -------------------------------------------------------------------------------- 1 | This program reads in text from stdin, counts all equal words that are 2 | separated by whitespace and prints the result to stdout. 3 | -------------------------------------------------------------------------------- /pintraces/iltest/TRACE: -------------------------------------------------------------------------------- 1 | ../pin/pin -t obj-ia32/gentrace.so -logone-after -logall-before -taint-start 0x3ffff000 -taint-end 0x3ffff010 -trig_addr 0x3ffff000 -- ./iltest/test -------------------------------------------------------------------------------- /tests/asm/Makefile: -------------------------------------------------------------------------------- 1 | ASFLAGS = -m32 2 | 3 | VSA_OBJ = $(patsubst %.S,%.o,$(wildcard *.S)) 4 | 5 | all: nop $(VSA_OBJ) 6 | 7 | nop: nop.S 8 | gcc -m32 -c -o nop nop.S 9 | -------------------------------------------------------------------------------- /zarith/META: -------------------------------------------------------------------------------- 1 | description = "Arbitrary precision integers" 2 | requires = "" 3 | version = "1.2.1" 4 | archive(byte) = "zarith.cma" 5 | archive(native) = "zarith.cmxa" 6 | -------------------------------------------------------------------------------- /batteries/examples/snippets/snippets.itarget: -------------------------------------------------------------------------------- 1 | netchan_cat.byte 2 | netchan_cat.native 3 | parallelsort.byte 4 | parallelsort.native 5 | test_printf.byte 6 | test_printf.native 7 | -------------------------------------------------------------------------------- /batteries/examples/tools/now.ml: -------------------------------------------------------------------------------- 1 | (* 2 | Print the current date 3 | 4 | Usage: 5 | ./now 6 | *) 7 | 8 | open Date 9 | print stdout (now ()); 10 | print_newline () 11 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqic/piqi-lang.piqi: -------------------------------------------------------------------------------- 1 | .include [ .module piqi/piqi-lang ] 2 | .include [ .module piqic/piqi ] 3 | 4 | .include [ .module piqic/piqi-lang.ocaml ] 5 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/cpp/Makefile.cpp: -------------------------------------------------------------------------------- 1 | ctest: piqi.piqi.pb.o test.cpp 2 | $(CXX) $(CXXFLAGS) -o $@ $^ -lprotobuf -lpthread 3 | 4 | clean: 5 | rm -f *.o ctest 6 | -------------------------------------------------------------------------------- /pcre-ocaml/examples/subst/README: -------------------------------------------------------------------------------- 1 | Start the program with argument "-help" to see what it does! 2 | 3 | Example invocation: 4 | 5 | subst '([Tt])ermcap' '$1ermCap' < /etc/termcap 6 | -------------------------------------------------------------------------------- /batteries/examples/benchmark/_tags: -------------------------------------------------------------------------------- 1 | : pkg_bitstring 2 | : pkg_batteries,pkg_core,debug,pkg_threads,pkg_benchmark 3 | : pkg_batteries,pkg_core,pkg_threads 4 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/AUTHORS: -------------------------------------------------------------------------------- 1 | This file lists Piqi authors. GitHub usernames are specified in parentheses. 2 | 3 | 4 | Anton Lavrik (alavrik) 5 | Hunter Morris (skarab) 6 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/examples/list.piq: -------------------------------------------------------------------------------- 1 | :def/int-list [] 2 | 3 | :def/int-list [ 1 2 3 4 5 ] 4 | 5 | :def/int-list-list [ 6 | [] 7 | [ 1 2 3 ] 8 | ] 9 | 10 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqilib/piqi_c.ml: -------------------------------------------------------------------------------- 1 | (* File generated from piqi_c.idl *) 2 | 3 | 4 | external piqi_strtoull : string -> int64 5 | = "camlidl_piqi_c_piqi_strtoull" 6 | 7 | -------------------------------------------------------------------------------- /pcre-ocaml/examples/cloc/README: -------------------------------------------------------------------------------- 1 | This program reads C-sources from stdin and prints them to stdout with 2 | comments and empty lines removed. - A very primitive way of counting LOCs. 3 | -------------------------------------------------------------------------------- /batteries/build/import.ml: -------------------------------------------------------------------------------- 1 | (* 2 | Placeholder for a future tool. 3 | 4 | This tool will import a set of interfaces from a library for quick 5 | initialization of layer code. 6 | *) 7 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqi-rpc/src/.gitignore: -------------------------------------------------------------------------------- 1 | dialyzer_plt 2 | dialyzer.log 3 | 4 | piqi-rpc.piqi 5 | 6 | piqi_rpc_piqi.erl 7 | piqi_rpc_piqi.hrl 8 | 9 | piqi_rpc.app 10 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqilib/piqi_c.mli: -------------------------------------------------------------------------------- 1 | (* File generated from piqi_c.idl *) 2 | 3 | 4 | external piqi_strtoull : string -> int64 5 | = "camlidl_piqi_c_piqi_strtoull" 6 | 7 | -------------------------------------------------------------------------------- /ounit/AUTHORS.txt: -------------------------------------------------------------------------------- 1 | (* OASIS_START *) 2 | (* DO NOT EDIT (digest: 2915822545ee2a6c6708508e9418550d) *) 3 | Authors of ounit 4 | Maas-Maarten Zeeman 5 | Sylvain Le Gall 6 | (* OASIS_STOP *) 7 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -ex 4 | 5 | (cd protobuf && ./autogen.sh) 6 | aclocal -I m4 7 | autoconf 8 | autoheader 9 | automake --add-missing --copy 10 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/protobuf/src/google/protobuf/testdata/golden_message: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/libtracewrap/libtrace/protobuf/src/google/protobuf/testdata/golden_message -------------------------------------------------------------------------------- /tests/IL/unroll/reducible.il: -------------------------------------------------------------------------------- 1 | cjmp e:bool, "a", "b" 2 | x:u32 := 0:u32 3 | 4 | label a 5 | x:u32 := x:u32 + 1:u32 6 | cjmp e2:bool, "a", "b" 7 | 8 | label b 9 | x:u32 := x:u32 + 1:u32 10 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/erlang_packed/test: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | RUN="test run" 4 | ERL_PATH=$PIQI_ROOT/piqi-erlang/ebin 5 | 6 | erl -pa $ERL_PATH -noshell -run $RUN -s erlang halt 7 | 8 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/erlang_piqi/test: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | RUN="test run" 4 | ERL_PATH=$PIQI_ROOT/piqi-erlang/ebin 5 | 6 | erl -pz $ERL_PATH -noshell -run $RUN -s erlang halt 7 | 8 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqilib/META: -------------------------------------------------------------------------------- 1 | description = "The Piqi library" 2 | requires = "ulex easy-format xmlm piqi.runtime" 3 | archive(byte) = "piqilib.cma" 4 | archive(native) = "piqilib.cmxa" 5 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/piqi_proto1/T.piqi: -------------------------------------------------------------------------------- 1 | .protobuf-package "T" 2 | 3 | .import [ .module Topic ] 4 | 5 | .alias [ 6 | .name vector 7 | .type Topic/vector 8 | ] 9 | 10 | -------------------------------------------------------------------------------- /pcre-ocaml/lib/META: -------------------------------------------------------------------------------- 1 | name="pcre" 2 | version="6.2.5" 3 | description="Perl Compatibility Regular Expressions" 4 | requires="" 5 | archive(byte)="pcre.cma" 6 | archive(native)="pcre.cmxa" 7 | linkopts = "" 8 | -------------------------------------------------------------------------------- /tests/asm/mem.S: -------------------------------------------------------------------------------- 1 | movl $42, 12(%esp) 2 | je foo 3 | movl $8, 4(%esp) 4 | jmp end 5 | foo: 6 | movl $12, 8(%esp) 7 | end: 8 | 9 | mov 8(%esp), %eax 10 | mov 4(%esp), %ebx 11 | mov 12(%esp), %ecx 12 | -------------------------------------------------------------------------------- /autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -ex 4 | 5 | aclocal 6 | autoconf 7 | autoheader 8 | automake --add-missing --copy 9 | (cd ocamlgraph && autoconf) 10 | (cd libtracewrap/libtrace && ./autogen.sh) 11 | 12 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/deps/easy-format-1.0.0/META.tpl: -------------------------------------------------------------------------------- 1 | name = "easy-format" 2 | description = "Indentation made easy(ier)" 3 | archive(byte) = "easy_format.cmo" 4 | archive(native) = "easy_format.cmx" 5 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqi-rpc/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.config 2 | include $(PIQI_ROOT)/make/Makefile.dirs 3 | 4 | DIRS = src piqic-erlang-rpc 5 | 6 | 7 | clean:: 8 | $(MAKE) -C examples clean 9 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqirun-ocaml/META: -------------------------------------------------------------------------------- 1 | description = "Runtime support for wire parsers and generators produced by 'piqic ocaml'" 2 | archive(byte) = "piqirun.cma" 3 | archive(native) = "piqirun.cmxa" 4 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/src/ocaml/arch.idl: -------------------------------------------------------------------------------- 1 | #include "../common/arch.hpp" 2 | 3 | typedef unsigned long machine_t; 4 | 5 | const int mach_i386_i386 = bfd_mach_i386_i386; 6 | const int mach_x86_64 = bfd_mach_x86_64; 7 | -------------------------------------------------------------------------------- /batteries/examples/tools/browser.ml: -------------------------------------------------------------------------------- 1 | (** 2 | Call your favorite browser to browse each of the URLs entered on the command-line. 3 | *) 4 | open Batteries_config 5 | 6 | iter (fun x -> ignore **> browse x) (args ()) 7 | -------------------------------------------------------------------------------- /tests/C/unroll.c: -------------------------------------------------------------------------------- 1 | int main() { 2 | int i, j; 3 | int sum = 0; 4 | 5 | for (i = 0; i < 10; i++) { 6 | for (j = 0; j < 10; j++) { 7 | sum += 1; 8 | } 9 | } 10 | 11 | return sum; 12 | } 13 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/src/piqi_src.app.src: -------------------------------------------------------------------------------- 1 | {application, piqi_src, 2 | [{description, "Piqi project source code"}, 3 | {vsn, git}, 4 | {modules, []}, 5 | {applications, [kernel, stdlib]}, 6 | {env, []}]}. 7 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/piqi_proto/Makefile: -------------------------------------------------------------------------------- 1 | 2 | all: 3 | ./test 4 | 5 | 6 | clean: 7 | test ! -d google/protobuf || find google/protobuf \( -name '*.proto.pb*' -or -name '*.piqi*' \) -delete 8 | rm -f l 9 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/protobuf/src/google/protobuf/testdata/golden_packed_fields_message: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0day1day/bap/HEAD/libtracewrap/libtrace/protobuf/src/google/protobuf/testdata/golden_packed_fields_message -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/ocaml_riak_pb/README: -------------------------------------------------------------------------------- 1 | Riak Protocol Buffers definitions were downloaded from 2 | 3 | git@github.com:basho/riak_pb.git 4 | 5 | commit: ab277e0900887699aeafcd8c1d0495fc5b4e304e 6 | -------------------------------------------------------------------------------- /pcre-ocaml/examples/cloc/Makefile: -------------------------------------------------------------------------------- 1 | OCAMLMAKEFILE = ../../OCamlMakefile 2 | 3 | SOURCES = cloc.ml 4 | INCDIRS = ../../lib 5 | LIBDIRS = ../../lib 6 | LIBS = pcre 7 | RESULT = cloc 8 | 9 | -include $(OCAMLMAKEFILE) 10 | -------------------------------------------------------------------------------- /tests/IL/unroll/irreducible.il: -------------------------------------------------------------------------------- 1 | cjmp e:bool, "a", "b" 2 | x:u32 := 0:u32 3 | 4 | label a 5 | x:u32 := x:u32 + 1:u32 6 | cjmp e2:bool, "b", "out" 7 | 8 | label b 9 | x:u32 := x:u32 + 1:u32 10 | jmp "a" 11 | 12 | label out -------------------------------------------------------------------------------- /batteries/build/optcomp/META: -------------------------------------------------------------------------------- 1 | # -*- conf-mode -*- 2 | name = "optcomp" 3 | version = "1.1" 4 | description = "Optional compilation with cpp-like directives" 5 | requires = "camlp4" 6 | archive(syntax, preprocessor) = "pa_optcomp.cmo" 7 | -------------------------------------------------------------------------------- /doc/fig/Makefile: -------------------------------------------------------------------------------- 1 | FIGS = $(wildcard *.fig) 2 | 3 | all: $(FIGS:.fig=.pdf) add-shl.pdf 4 | 5 | %.pdf : %.dot 6 | dot -Tpdf -o $@ $< 7 | 8 | %.pdf : %.fig 9 | fig2dev -L pdf $< $@ 10 | 11 | clean: 12 | rm -f $(FIGS:.fig=.pdf) -------------------------------------------------------------------------------- /libasmir/Makefile.am: -------------------------------------------------------------------------------- 1 | # Owned and copyright BitBlaze, 2007. All rights reserved. 2 | # Do not copy, disclose, or distribute without explicit written 3 | # permission. 4 | 5 | AUTOMAKE_OPTIONS = subdir-objects 6 | 7 | SUBDIRS= src 8 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/deps/easy-format-1.0.0/META: -------------------------------------------------------------------------------- 1 | version = "1.0.0" 2 | name = "easy-format" 3 | description = "Indentation made easy(ier)" 4 | archive(byte) = "easy_format.cmo" 5 | archive(native) = "easy_format.cmx" 6 | -------------------------------------------------------------------------------- /ocaml/ast_cond_simplify.mli: -------------------------------------------------------------------------------- 1 | (** Simplify predicates so that VSA and other abstract interpretations 2 | can use them. *) 3 | 4 | (** Simplify conditions used in edge labels *) 5 | val simplifycond_cfg : Cfg.AST.G.t -> Cfg.AST.G.t 6 | -------------------------------------------------------------------------------- /pcre-ocaml/examples/subst/Makefile: -------------------------------------------------------------------------------- 1 | OCAMLMAKEFILE = ../../OCamlMakefile 2 | 3 | SOURCES = subst.ml 4 | INCDIRS = ../../lib 5 | LIBDIRS = ../../lib 6 | LIBS = pcre 7 | RESULT = subst 8 | 9 | -include $(OCAMLMAKEFILE) 10 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/examples/complex.piq: -------------------------------------------------------------------------------- 1 | 2 | :complex/t [ .re 0 .im 0 ] 3 | 4 | 5 | % field names are optional: 6 | :complex/t [ 0 0 ] 7 | 8 | 9 | % an object without any fields 10 | :complex/foo [] 11 | 12 | 13 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/ocaml_piq_config/Makefile: -------------------------------------------------------------------------------- 1 | 2 | all: 3 | $(MAKE) -C ocaml-piq-config OCAMLPATH=$(PIQI_BUILD)/lib/ocaml 4 | cd ocaml-piq-config; ./config 5 | 6 | clean: 7 | $(MAKE) -C ocaml-piq-config clean 8 | 9 | -------------------------------------------------------------------------------- /pcre-ocaml/examples/pcregrep/Makefile: -------------------------------------------------------------------------------- 1 | OCAMLMAKEFILE = ../../OCamlMakefile 2 | 3 | SOURCES = pcregrep.ml 4 | INCDIRS = ../../lib 5 | LIBDIRS = ../../lib 6 | LIBS = pcre 7 | RESULT = pcregrep 8 | 9 | -include $(OCAMLMAKEFILE) 10 | -------------------------------------------------------------------------------- /batteries/_tags: -------------------------------------------------------------------------------- 1 | <**/*.ml> : annot 2 | <**/*.ml> and not : warn_Ae-29 3 | "build": include 4 | "src": include 5 | "libs": include 6 | "testsuite": include 7 | "qtest": include 8 | "benchsuite": include 9 | ".git": -traverse 10 | -------------------------------------------------------------------------------- /pcre-ocaml/examples/count_hash/Makefile: -------------------------------------------------------------------------------- 1 | OCAMLMAKEFILE = ../../OCamlMakefile 2 | 3 | SOURCES = count_hash.ml 4 | INCDIRS = ../../lib 5 | LIBDIRS = ../../lib 6 | LIBS = pcre 7 | RESULT = count_hash 8 | 9 | -include $(OCAMLMAKEFILE) 10 | -------------------------------------------------------------------------------- /pintraces/README: -------------------------------------------------------------------------------- 1 | Run getpin.sh to download and extract Pin in the proper location. 2 | 3 | If you run an x86_64 host, you will need to install the multilib 4 | version of g++ (and possibly binutils). 5 | 6 | XXX: Add instructions on how to run the tool -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/deps/easy-format-1.0.0/examples/Makefile: -------------------------------------------------------------------------------- 1 | # $Id: Makefile 22 2008-07-13 14:41:19Z mjambon $ 2 | .PHONY: clean jsonpp 3 | jsonpp: 4 | ocamlscript jsonpp.ml sample.json > sample.html 5 | clean: 6 | rm -f *.exe sample.html 7 | -------------------------------------------------------------------------------- /ocaml-proj.example/Makefile: -------------------------------------------------------------------------------- 1 | # Project specific source file Makefile 2 | # $Id: Makefile 4076 2010-07-02 17:12:05Z edmcman $ 3 | 4 | export BAP_PROJ_OCAMLDIR=$(BAP_DIR)/../ocaml-proj 5 | 6 | export PROJSOURCES = \ 7 | $(BAP_PROJ_OCAMLDIR)/testlib.ml 8 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/ocaml_riak_pb/riak_kv.ocaml.piqi: -------------------------------------------------------------------------------- 1 | .include [ .module riak_kv ] 2 | 3 | .extend [ 4 | (.field RpbListKeysResp.done RpbMapRedResp.done) 5 | 6 | .with.ocaml-name "isdone" 7 | ] 8 | 9 | .custom-field ocaml-name 10 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqi-erlang/src/.gitignore: -------------------------------------------------------------------------------- 1 | piqi.app 2 | 3 | piqi_rpc_piqi.erl 4 | piqi_rpc_piqi.hrl 5 | 6 | piqi_tools_piqi.erl 7 | piqi_tools_piqi.hrl 8 | 9 | piqi_piqi.erl 10 | piqi_piqi.hrl 11 | 12 | dialyzer_plt 13 | dialyzer.log 14 | 15 | -------------------------------------------------------------------------------- /doc/chap-tools.tex: -------------------------------------------------------------------------------- 1 | \chapter{The \bap Toolkit} 2 | \input{chap-tools/overview} 3 | \input{chap-tools/obtaining} 4 | \input{chap-tools/toil} 5 | \input{chap-tools/iltrans} 6 | \input{chap-tools/other-utils} 7 | \input{chap-tools/discussion} 8 | %\input{chap-tools/translate} 9 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/src/README: -------------------------------------------------------------------------------- 1 | We need this directory to be able to treat the main Piqi repository as a 2 | "piqi_src" rebar dependency for the "piqi-erlang" rebar package, which is 3 | located at: 4 | 5 | https://github.com/alavrik/piqi-erlang 6 | 7 | -------------------------------------------------------------------------------- /ocamlgraph/editor/tests/dep_ed.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | size="7.5,10" ; 3 | rankdir = TB ; 4 | "Ed_main" -> "Ed_display" ; 5 | "Ed_main" -> "Ed_draw" ; 6 | "Ed_graph" -> "Ed_hyper" ; 7 | "Ed_draw" -> "Ed_graph" ; 8 | "Ed_display" -> "Ed_graph" ; 9 | } 10 | -------------------------------------------------------------------------------- /batteries/qtest/README.md: -------------------------------------------------------------------------------- 1 | # qTest 2 | 3 | ## Info: 4 | The inline tests are generated and run here. The qTest code itself has moved to a new location: 5 | 6 | https://github.com/vincent-hugot/iTeML 7 | 8 | 9 | ## Files: 10 | _tags : necessary to run the tests 11 | -------------------------------------------------------------------------------- /batteries/src/batteriesThread.ml: -------------------------------------------------------------------------------- 1 | module Mutex = BatMutex 2 | module RMutex = BatRMutex 3 | 4 | let () = 5 | BatUnix.lock := RMutex.make (); 6 | BatIO.lock := RMutex.make (); 7 | BatIO.lock_factory := RMutex.make; 8 | BatPervasives.lock := RMutex.make (); 9 | () 10 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/protobuf/editors/README.txt: -------------------------------------------------------------------------------- 1 | This directory contains syntax highlighting and configuration files for editors 2 | to properly display Protocol Buffer files. 3 | 4 | See each file's header comment for directions on how to use it with the 5 | appropriate editor. 6 | -------------------------------------------------------------------------------- /ounit/examples/test_suite.ml: -------------------------------------------------------------------------------- 1 | open OUnit 2 | 3 | (* Collect the tests of different modules into one test suite *) 4 | let suite = "OUnit Example" >::: 5 | [Test_list.suite; 6 | Test_list2.suite; 7 | Test_stack.suite] 8 | 9 | let _ = 10 | run_test_tt_main suite 11 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/ocaml_misc/Protocol.piqi: -------------------------------------------------------------------------------- 1 | .ocaml-module "Protocol" 2 | 3 | .import [ .module Ad ] 4 | 5 | .variant [ 6 | .name op 7 | .option [ .name ping ] 8 | .option [ 9 | .name get-balance 10 | .type Ad/id 11 | ] 12 | ] 13 | 14 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqi-camlp4/META: -------------------------------------------------------------------------------- 1 | requires = "camlp4" 2 | description = "Useful Camlp4 macro for dealing with OCaml types genereated by 'piqic ocaml'" 3 | archive(syntax,toploop) = "pa_labelscope.cmo pa_openin.cmo" 4 | archive(syntax,preprocessor) = "pa_labelscope.cmo pa_openin.cmo" 5 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/erlang_import/first.piqi: -------------------------------------------------------------------------------- 1 | .variant [ 2 | .name first-variant 3 | .option [ .type int ] 4 | .option [ .type string ] 5 | ] 6 | 7 | .record [ 8 | .name first-record 9 | .field [ .type int ] 10 | .field [ .type string ] 11 | ] 12 | 13 | -------------------------------------------------------------------------------- /batteries/build/optcomp/sample_incl.ml: -------------------------------------------------------------------------------- 1 | (* 2 | * sample_incl.ml 3 | * -------------- 4 | * Copyright : (c) 2009, Jeremie Dimino 5 | * Licence : BSD3 6 | * 7 | * This file is a part of optcomp. 8 | *) 9 | 10 | (* File included by "sample.ml" *) 11 | 12 | #let x = 1 13 | -------------------------------------------------------------------------------- /batteries/examples/tools/shuffle.ml: -------------------------------------------------------------------------------- 1 | (* Randomly reorder the elements given on the command-line. 2 | 3 | Usage: 4 | ./shuffle 1 2 3 4 5 6 7 8 9 5 | *) 6 | 7 | open Random with self_init () 8 | 9 | let _ = Array.print ~sep:" " ~first:"" ~last:"\n" output_string stdout (shuffle (args ()));; 10 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/examples/comment.piq: -------------------------------------------------------------------------------- 1 | % This is an empty .piq file with a bunch of comments 2 | 3 | % comments start with '%' character and continue until the end of the line 4 | 5 | % one 6 | % two 7 | % three 8 | 9 | % Note that '%%' is not a valid literal sequence. 10 | % 11 | 12 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqi-camlp4/3.12/pa_openin.ml: -------------------------------------------------------------------------------- 1 | (*pp camlp4of *) 2 | 3 | (* Left for backward compatibility with existing code that uses pa_openin. 4 | * 5 | * For OCaml >= 3.12 this module is no longer needed, since 6 | * "let open ... in ..." operation is now supported natively. 7 | *) 8 | -------------------------------------------------------------------------------- /pcre-ocaml/examples/count_hash/count_hash.ml: -------------------------------------------------------------------------------- 1 | open Hashtbl 2 | 3 | let hash = create 1973 4 | let add_string s = try incr (find hash s) with Not_found -> add hash s (ref 1);; 5 | Pcre.foreach_line (fun line -> List.iter add_string (Pcre.split line)); 6 | iter (fun k v -> Printf.printf "%4d\t%s\n" !v k) hash 7 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/deps/ulex-1.1/META: -------------------------------------------------------------------------------- 1 | version = "1.1" 2 | requires = "camlp4" 3 | description = "Runtime support for ulex" 4 | archive(byte) = "ulexing.cma" 5 | archive(native) = "ulexing.cmxa" 6 | archive(syntax,toploop) = "pa_ulex.cma ulexing.cma" 7 | archive(syntax,preprocessor) = "pa_ulex.cma" 8 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/ocaml_array/Makefile: -------------------------------------------------------------------------------- 1 | 2 | all: 3 | $(MAKE) -f Makefile.ocaml 4 | piqi convert -t pb test-all.piq 5 | ./test 6 | cmp test-all.piq.pb test-all.piq.pb.array 7 | 8 | 9 | clean: 10 | $(MAKE) -f Makefile.ocaml clean 11 | rm -f test-all.piq.* test-all-lists.piq.* 12 | -------------------------------------------------------------------------------- /pintraces/Makefile.in: -------------------------------------------------------------------------------- 1 | .PHONY: default tags 2 | default: all 3 | 4 | %: 5 | ifeq ("@ARCH_X64@","true") 6 | (make -f Makefile.pin PIN_ROOT=@PIN_ROOT@ TARGET=intel64 ARCH_X64="@ARCH_X64@" $@) 7 | endif 8 | (make -f Makefile.pin PIN_ROOT=@PIN_ROOT@ TARGET=ia32 ARCH_X64="@ARCH_X64@" $@) 9 | 10 | tags: 11 | -------------------------------------------------------------------------------- /doc/chap-examples.tex: -------------------------------------------------------------------------------- 1 | \chapter{Examples} 2 | 3 | In this chapter, we present some hands-on examples that may be useful 4 | to become familiar with BAP's capabilities. 5 | 6 | \input{chap-examples/il} 7 | \input{chap-examples/functions} 8 | \input{chap-examples/conceval} 9 | \input{chap-examples/traces} 10 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqi-rpc/examples/process_info/server.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | PA="-pa $PIQI_ROOT/piqi-erlang/ebin -pa $PIQI_ROOT/piqi-rpc/ebin" 4 | 5 | RUN='piqi_rpc:add_service({process_info_example, process_info_piqi_rpc, "process-info"}).' 6 | 7 | erl $PA -noshell -s piqi_rpc start -eval "$RUN" 8 | 9 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/erlang_piqi/Makefile.erlang: -------------------------------------------------------------------------------- 1 | 2 | ERL_SOURCES = piqi_piqi.erl piqobj_piqi.erl test.erl 3 | 4 | 5 | ERL_APP_PATH = $(PIQI_ROOT)/piqi-erlang 6 | ERLC_FLAGS = -I . 7 | EBIN_DIR = . 8 | 9 | 10 | all: ebin 11 | 12 | 13 | include $(PIQI_ROOT)/make/Makefile.erlang 14 | 15 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqic/piqi.piqi: -------------------------------------------------------------------------------- 1 | 2 | .include [ .module piqi/piqi ] 3 | 4 | 5 | % Piqi compiler currently supports Piqi dialect based on the following language 6 | % extensions: 7 | 8 | .include [ .module piqic/piqi.ocaml-extensions ] 9 | .include [ .module piqic/piqi.erlang-extensions ] 10 | 11 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqicc/piqi-lang.piqi: -------------------------------------------------------------------------------- 1 | .include [ .module piqi/piqi-lang ] 2 | 3 | % Piqi compiler compiler (piqicc) produces OCaml code, therefore it has to 4 | % support OCaml-specific extensions. 5 | 6 | .include [ .module piqic/piqi.ocaml-extensions ] 7 | .include [ .module piqic/piqi-lang.ocaml ] 8 | 9 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/boot_proto2piqi/README: -------------------------------------------------------------------------------- 1 | This program was used for bootstrapping .proto to .piqi converter, which is now 2 | available as "piqi of-proto" command. 3 | 4 | Essentially it was used for converting 5 | "protobuf-2.3.0/src/google/protobuf/descriptor.proto" to 6 | "$PIQI_ROOT/piqi/desriptor.piqi". 7 | -------------------------------------------------------------------------------- /batteries/src/_tags: -------------------------------------------------------------------------------- 1 | true: debug 2 | <{batMutex,batRMutex}.{ml,mli}>: threads 3 | : threads 4 | : rectypes 5 | <{batMap,batVect,batFile,batPervasives,batParserCo,batSet,batLogger,batPathGen,batSplay}.ml>: warn_z 6 | <{batPervasives,batIMap,batLog}.ml>: warn_-9 7 | : compiler-libs 8 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/piqi_packed/Makefile: -------------------------------------------------------------------------------- 1 | 2 | all: 3 | cat packed.piqi | sed -e 's/\.protobuf-packed//' > unpacked.piqi 4 | cat test-all.piq | sed -e 's/:packed/:unpacked/' > test-all-unpacked.piq 5 | ./test 6 | 7 | 8 | clean: 9 | rm -f *.pb *.proto* *.pib unpacked.piqi test-all-unpacked.piq 10 | 11 | -------------------------------------------------------------------------------- /ocaml/lnf_ramalingam.mli: -------------------------------------------------------------------------------- 1 | open Lnf 2 | 3 | module type RamalingamHelper = 4 | functor (Gr: G) -> 5 | sig 6 | type t 7 | val init: Gr.G.t -> Gr.G.V.t -> t 8 | val find_headers: t -> Gr.G.V.t list -> Gr.G.V.t list 9 | end 10 | 11 | module Make : functor (RH: RamalingamHelper) -> MakeType 12 | 13 | -------------------------------------------------------------------------------- /pintraces/ddk-inc/README: -------------------------------------------------------------------------------- 1 | This directory contains include files from the Windows Driver 2 | Development Kit, version 7600.16385.1. They are included here because 3 | 1) WDK is annoying to obtain, 2) there are header file conflicts 4 | between WDK and VC++ that are difficult to resolve. These header 5 | files work on VS 10.0.30319.1. -------------------------------------------------------------------------------- /batteries/examples/tools/shuffle2.ml: -------------------------------------------------------------------------------- 1 | (*Randomly reorder the elements given on stdin. 2 | 3 | Usage: 4 | ./shuffle2.byte < some_file.txt 5 | *) 6 | 7 | open Random with self_init () 8 | open IO, Printf 9 | 10 | let shift x = x + 1;; 11 | 12 | Array.iteri (shift |- printf "%-2d: %s\n") (shuffle (lines_of stdin)) 13 | 14 | -------------------------------------------------------------------------------- /batteries/examples/tools/tools.itarget: -------------------------------------------------------------------------------- 1 | conv.byte 2 | conv.native 3 | now.byte 4 | now.native 5 | cat.byte 6 | cat.native 7 | cat2.byte 8 | cat2.native 9 | shuffle.byte 10 | shuffle.native 11 | shuffle2.byte 12 | shuffle2.native 13 | gzip.byte 14 | gzip.native 15 | gunzip.byte 16 | gunzip.native 17 | browser.byte 18 | browser.native -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/examples/erlang/list_people: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ $# -ne 1 ] 4 | then 5 | echo "Usage: $0 ADDRESS_BOOK_FILE" 6 | exit 1 7 | fi 8 | 9 | 10 | RUN="list_people run" 11 | ERL_PATH=$PIQI_ROOT/piqi-erlang/ebin 12 | 13 | 14 | erl -pa $ERL_PATH -noshell -run $RUN "$1" -s erlang halt 15 | 16 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqi-erlang/README: -------------------------------------------------------------------------------- 1 | To install and use Piqi Erlang application separately from the rest of the Piqi 2 | codebase, use the following rebar[1] package: 3 | 4 | https://github.com/alavrik/piqi-erlang 5 | 6 | 7 | [1] Rebar is a build system for Erlang projects: https://github.com/basho/rebar 8 | 9 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqi-erlang/src/debug.hrl: -------------------------------------------------------------------------------- 1 | -ifndef(__PIQI_DEBUG_HRL__). 2 | -define(__PIQI_DEBUG_HRL__, 1). 3 | 4 | 5 | -ifdef(DEBUG). 6 | -define(PRINT(Var), io:format("DEBUG: ~p:~p - ~p~n~n ~p~n~n", [?MODULE, ?LINE, ??Var, Var])). 7 | -else. 8 | -define(PRINT(Var), ok). 9 | -endif. 10 | 11 | 12 | -endif. 13 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/cpp/README: -------------------------------------------------------------------------------- 1 | 2 | Convert complex piqi specification "piqi/piqi.piqi" to .proto. 3 | 4 | Then build a C++ program which reads and dumps a serialized binary object using 5 | Protocol Buffers library. The binary object used as the test input is a 6 | serialized "piqi.piqi" specification itself. 7 | 8 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/protobuf/gtest/xcode/Config/TestTarget.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // TestTarget.xcconfig 3 | // 4 | // These are Test target settings for the gtest framework and examples. It 5 | // is set in the "Based On:" dropdown in the "Target" info dialog. 6 | 7 | PRODUCT_NAME = $(TARGET_NAME) 8 | HEADER_SEARCH_PATHS = ../include 9 | -------------------------------------------------------------------------------- /batteries/qtest/qtest_preamble.ml: -------------------------------------------------------------------------------- 1 | (* this file is part of Batteries 'qtest' usage; it will be included 2 | at the top of the generated test runner, and is therefore a good 3 | location to add functions that would be convenient to write tests 4 | but have not yet found their place into Batteries proper. *) 5 | open Batteries 6 | 7 | 8 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/examples/erlang/add_person: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ $# -ne 1 ] 4 | then 5 | echo "Usage: $0 ADDRESS_BOOK_FILE" 6 | exit 1 7 | fi 8 | 9 | 10 | RUN="add_person run" 11 | ERL_PATH=$PIQI_ROOT/piqi-erlang/ebin 12 | 13 | 14 | erl -pa $ERL_PATH -noshell -run $RUN "$0" "$1" -s erlang halt 15 | 16 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqi-rpc/src/debug.hrl: -------------------------------------------------------------------------------- 1 | -ifndef(__PIQI_RPC_DEBUG_HRL__). 2 | -define(__PIQI_RPC_DEBUG_HRL__, 1). 3 | 4 | 5 | -ifdef(DEBUG). 6 | -define(PRINT(Var), io:format("DEBUG: ~p:~p - ~p~n~n ~p~n~n", [?MODULE, ?LINE, ??Var, Var])). 7 | -else. 8 | -define(PRINT(Var), ok). 9 | -endif. 10 | 11 | 12 | -endif. 13 | -------------------------------------------------------------------------------- /ocaml/BatListFull.ml: -------------------------------------------------------------------------------- 1 | (** Opening this module will put a more tail-recursive List module 2 | into scope. *) 3 | 4 | (** A complete list module that uses Batteries functions when 5 | possible. 6 | 7 | Why is this not in batteries itself? 8 | *) 9 | 10 | module List = struct 11 | include List 12 | include BatList 13 | end 14 | -------------------------------------------------------------------------------- /ocaml/tunegc.mli: -------------------------------------------------------------------------------- 1 | (** Automatically tune Garbage collection parameters. 2 | 3 | Decrease the aggressiveness of OCaml's garbage collector, since BAP 4 | often uses very large objects. 5 | *) 6 | 7 | val set_gc : unit -> unit 8 | (** [set_gc ()] tunes the garbage collection parameters so they are 9 | more appropriate for BAP. *) 10 | -------------------------------------------------------------------------------- /batteries/build/optcomp/optcomp_r.ml: -------------------------------------------------------------------------------- 1 | (* 2 | * optcomp_r.ml 3 | * ------------ 4 | * Copyright : (c) 2009, Jeremie Dimino 5 | * Licence : BSD3 6 | *) 7 | 8 | (* Standalone version, revised syntax *) 9 | 10 | let module M = Camlp4OCamlRevisedParser.Make(Camlp4.PreCast.Syntax) in () 11 | 12 | let _ = Optcomp.main () 13 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/examples/erlang/io_json_xml_pb: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ $# -ne 1 ] 4 | then 5 | echo "Usage: $0 ADDRESS_BOOK_FILE" 6 | exit 1 7 | fi 8 | 9 | 10 | RUN="io_json_xml_pb run" 11 | ERL_PATH=$PIQI_ROOT/piqi-erlang/ebin 12 | 13 | 14 | erl -pa $ERL_PATH -noshell -s piqi start -run $RUN "$1" -s erlang halt 15 | 16 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/examples/record-variant-list.piqi: -------------------------------------------------------------------------------- 1 | 2 | .record [ 3 | .name r 4 | .field [ .name a .type int ] 5 | .field [ .name b .type int ] 6 | ] 7 | 8 | .variant [ 9 | .name v 10 | .option [ .name a .type int ] 11 | .option [ .name b .type int ] 12 | ] 13 | 14 | 15 | .list [ .name l .type v ] 16 | 17 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/erlang_piqi/test.erl: -------------------------------------------------------------------------------- 1 | -module(test). 2 | -compile(export_all). 3 | 4 | 5 | run() -> 6 | {ok, Bytes} = file:read_file("piqi.piqi.pb"), 7 | Piqi = piqi_piqi:parse_piqi(Bytes), 8 | 9 | IOList = piqi_piqi:gen_piqi(Piqi), 10 | ok = file:write_file("piqi.piqi.pb.pb", IOList), 11 | ok. 12 | 13 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqi-rpc/examples/addressbook/server.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | PA="-pa $PIQI_ROOT/piqi-erlang/ebin -pa $PIQI_ROOT/piqi-rpc/ebin" 4 | 5 | RUN='piqi_rpc:add_service({addressbook, addressbook_piqi_rpc, "addressbook"}).' 6 | 7 | #erl $PA -s piqi_rpc start -eval "$RUN" 8 | erl $PA -noshell -s piqi_rpc start -eval "$RUN" 9 | 10 | -------------------------------------------------------------------------------- /ocaml/prune_unreachable.ml: -------------------------------------------------------------------------------- 1 | module D = Debug.Make(struct let name = "Prune_unreachable" and default=`Debug end) 2 | module R = Reachable 3 | 4 | let prune_unreachable_ast g = 5 | R.AST.remove_unreachable g (Cfg.AST.G.V.create Cfg.BB_Entry) 6 | 7 | let prune_unreachable_ssa g = 8 | R.SSA.remove_unreachable g (Cfg.SSA.G.V.create Cfg.BB_Entry) 9 | 10 | -------------------------------------------------------------------------------- /batteries/README.folders: -------------------------------------------------------------------------------- 1 | The following directories contain: 2 | 3 | * build/ various (old) files needed for building 4 | * examples/ example files showing how to use various features of batteries 5 | * apidocs/ the html documentation 6 | * src/ the core of Batteries Included, all the batFoo modules 7 | * testsuite/ a minimal testsuite for batteries 8 | 9 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/deps/ulex-1.1/myocamlbuild.ml: -------------------------------------------------------------------------------- 1 | open Ocamlbuild_plugin;; 2 | open Command;; 3 | dispatch begin function 4 | | After_rules -> 5 | flag ["ocaml"; "pp"; "use_ulex"] (S[A"camlp4o"; A"pa_ulex.cma"]); 6 | dep ["ocaml"; "ocamldep"; "use_ulex"] ["pa_ulex.cma"]; 7 | ocaml_lib ~tag_name:"use_ulex" "ulexing"; 8 | | _ -> () 9 | end;; 10 | -------------------------------------------------------------------------------- /pcre-ocaml/examples/cloc/make_win32_cloc.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | set OCAMLC=ocamlc -g 4 | set OCAMLOPT=ocamlopt 5 | 6 | set MAIN=cloc 7 | 8 | @echo on 9 | %OCAMLC% -o %MAIN%.exe pcre.cma %MAIN%.ml 10 | %OCAMLOPT% -o %MAIN%.com pcre.cmxa %MAIN%.ml 11 | 12 | @REM Example use: 13 | @REM %MAIN%.exe < ..\..\lib\pcre_stubs.c 14 | @REM %MAIN%.com < ..\..\lib\pcre_stubs.c 15 | -------------------------------------------------------------------------------- /batteries/build/optcomp/optcomp_o.ml: -------------------------------------------------------------------------------- 1 | (* 2 | * optcomp_o.ml 3 | * ------------ 4 | * Copyright : (c) 2009, Jeremie Dimino 5 | * Licence : BSD3 6 | *) 7 | 8 | (* Standalone version, original syntax *) 9 | 10 | let module M = Camlp4OCamlParser.Make(Camlp4OCamlRevisedParser.Make(Camlp4.PreCast.Syntax)) in () 11 | 12 | let _ = Optcomp.main () 13 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/erlang_packed/test.erl: -------------------------------------------------------------------------------- 1 | -module(test). 2 | -compile(export_all). 3 | 4 | 5 | run() -> 6 | {ok, Bytes} = file:read_file("test-all.piq.pb"), 7 | R = packed_piqi:parse_r_all(Bytes), 8 | 9 | Iolist = packed_piqi:gen_r_all(R), 10 | ok = file:write_file("test-all.piq.pb.pb", iolist_to_binary(Iolist)), 11 | ok. 12 | 13 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/piqi_proto1/Topic.piqi: -------------------------------------------------------------------------------- 1 | .ocaml-module "Topic" .protobuf-package "Topic" 2 | .custom-field ocaml-module 3 | 4 | .alias [ .name probability .type float ] 5 | 6 | .list [ 7 | .name topic-probability-list 8 | .type probability 9 | ] 10 | 11 | .alias [ 12 | .name vector 13 | .type topic-probability-list 14 | ] 15 | 16 | -------------------------------------------------------------------------------- /batteries/benchsuite/README: -------------------------------------------------------------------------------- 1 | The purpose of this directory is to provide performance evaluations of 2 | Batteries functions implementations. This is specially useful when 3 | testing changes against an upstream library such as INRIA's stdlib or 4 | Extlib. 5 | The benchmarks rely on the Ocaml [benchmark] library. 6 | 7 | [benchmark] http://forge.ocamlcore.org/projects/ocaml-benchmark/ 8 | -------------------------------------------------------------------------------- /ocaml/prune_unreachable.mli: -------------------------------------------------------------------------------- 1 | (** Code for removing unreachable nodes in a CFG. *) 2 | 3 | (** [prune_unreachable_ast g] returns an AST CFG in which nodes 4 | unreachable from BB_Entry are removed. *) 5 | val prune_unreachable_ast : Cfg.AST.G.t -> Cfg.AST.G.t 6 | 7 | (** Same as [prune_unreachable_ast] but for SSA CFGs. *) 8 | val prune_unreachable_ssa : Cfg.SSA.G.t -> Cfg.SSA.G.t 9 | -------------------------------------------------------------------------------- /ocaml/tunegc.ml: -------------------------------------------------------------------------------- 1 | (* Make the garbage collector less aggressive, since we often have 2 | very large objects *) 3 | let set_gc () = 4 | Gc.set 5 | { 6 | (Gc.get ()) with 7 | Gc.minor_heap_size = 32000000; (* 128 mb *) 8 | Gc.major_heap_increment = 16000000; (* 64 mb *) 9 | Gc.max_overhead = 100; (* compact after 100% overhead *) 10 | };; 11 | -------------------------------------------------------------------------------- /ounit/src/META: -------------------------------------------------------------------------------- 1 | # OASIS_START 2 | # DO NOT EDIT (digest: 61707d1b080e36d947156b3beaac22fe) 3 | version = "1.1.2" 4 | description = "Unit testing framework" 5 | requires = "unix" 6 | archive(byte) = "oUnit.cma" 7 | archive(byte, plugin) = "oUnit.cma" 8 | archive(native) = "oUnit.cmxa" 9 | archive(native, plugin) = "oUnit.cmxs" 10 | exists_if = "oUnit.cma" 11 | # OASIS_STOP 12 | 13 | -------------------------------------------------------------------------------- /batteries/examples/tools/cat.ml: -------------------------------------------------------------------------------- 1 | (** Implementation of a cat-like tool: read each file whose name is 2 | given on the command-line and print the contents to stdout. 3 | 4 | Compilation: 5 | ocamlbuild cat.byte 6 | 7 | Usage: 8 | ./cat.byte *.ml 9 | 10 | *) 11 | 12 | open Batteries_uni;; 13 | 14 | iter (fun x -> IO.copy (File.open_in x) stdout) (args ());; 15 | -------------------------------------------------------------------------------- /tests/disasm_i386_suite.ml: -------------------------------------------------------------------------------- 1 | open OUnit 2 | open Big_int_convenience 3 | 4 | let parse_nop _ = 5 | let nop _ = '\x90' in 6 | let (l,_,op,i64) = Disasm_i386.parse_instr Disasm_i386.X86 nop bi0 in 7 | let m = "instruction is not a Nop!" in 8 | assert_equal ~msg:m Disasm_i386.Nop op;; 9 | 10 | let suite = "Disasm_i386" >::: 11 | [ 12 | "parse_nop" >:: parse_nop; 13 | ] 14 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/editors/vim/piq.vim: -------------------------------------------------------------------------------- 1 | 2 | if exists("b:did_ftplugin") 3 | finish 4 | endif 5 | let b:did_ftplugin = 1 6 | 7 | 8 | setlocal comments=:%,:# commentstring=%\ %s 9 | setlocal iskeyword=-,+,a-z,A-Z,48-57 10 | 11 | setlocal formatoptions-=t formatoptions+=croql 12 | 13 | setl sw=4 ts=4 et 14 | 15 | 16 | let b:undo_ftplugin = "setl com< cms< fo< isk<" 17 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/examples/ocaml-custom-types/skvl.piqi: -------------------------------------------------------------------------------- 1 | 2 | .record [ 3 | .name string-key-value 4 | 5 | .field [ 6 | .name key 7 | .type string 8 | ] 9 | .field [ 10 | .name value 11 | .type string 12 | ] 13 | ] 14 | 15 | 16 | .list [ 17 | .name string-key-value-list 18 | .type string-key-value 19 | ] 20 | 21 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/deps/xmlm-1.1.1/META: -------------------------------------------------------------------------------- 1 | # OASIS_START 2 | # DO NOT EDIT (digest: ace4a1cb56c7d987ff58e55d2d7e7ffa) 3 | version = "1.1.1" 4 | description = "Streaming XML IO for OCaml" 5 | archive(byte) = "xmlm.cma" 6 | archive(byte, plugin) = "xmlm.cma" 7 | archive(native) = "xmlm.cmxa" 8 | archive(native, plugin) = "xmlm.cmxs" 9 | exists_if = "xmlm.cma" 10 | # OASIS_STOP 11 | 12 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/doc/README.md: -------------------------------------------------------------------------------- 1 | This directory contains the primary copy of the Piqi project documentation. 2 | 3 | The up-to-date copy of documentation for the most recent stable version of Piqi 4 | is published on the [project's website](http:/piqi.org/doc/). 5 | 6 | Note that documents are written using 7 | [Pandoc](http://johnmacfarlane.net/pandoc/) variation of Markdown syntax. 8 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/examples/ocaml-custom-types/README: -------------------------------------------------------------------------------- 1 | This is an example of how to serialize arbitrary monomorphic OCaml types by 2 | mapping them to built-in or previously defined Piqi types. 3 | 4 | This mechanism can be used, for example, for serializing OCaml chars as 5 | integers, bigints as decimal strings, or even "string Map.Make(String).t" as 6 | list of {key, value} records. 7 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/erlang_import/second.piqi: -------------------------------------------------------------------------------- 1 | .import [ 2 | .module first 3 | ] 4 | 5 | .variant [ 6 | .name second-variant 7 | .option [ .type first/first-record ] 8 | .option [ .type first/first-variant ] 9 | ] 10 | 11 | .record [ 12 | .name second-record 13 | .field [ .type first/first-record ] 14 | .field [ .type first/first-variant ] 15 | ] 16 | 17 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/ocaml_piqi/Makefile: -------------------------------------------------------------------------------- 1 | all: prep test 2 | 3 | 4 | prep: 5 | cat ../piqi_misc/piqobj.piqi | sed -e 's/piqi\///' > piqobj.piqi 6 | piqi convert --add-defaults -t pb piqi.piqi 7 | 8 | 9 | test: 10 | $(MAKE) -f Makefile.ocaml 11 | ./otest 12 | cmp *.pb 13 | 14 | 15 | clean: 16 | $(MAKE) -f Makefile.ocaml clean 17 | rm -f piqobj.piqi piqi.piqi.pb* t.* 18 | 19 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/piqi_proto/README: -------------------------------------------------------------------------------- 1 | You need to have a Protobuf source distribution for this test. It can be 2 | downloaded from here: 3 | http://code.google.com/p/protobuf/downloads/detail?name=protobuf-2.3.0.tar.gz 4 | 5 | After downloading and unpacking, create the following symlink before running the 6 | test script: 7 | 8 | ln -s /src/google . 9 | 10 | -------------------------------------------------------------------------------- /tests-proj.example/Makefile: -------------------------------------------------------------------------------- 1 | export BAP_PROJ_OCAMLDIR=$(BAP_DIR)/../ocaml-proj 2 | export BAP_PROJ_UTILDIR=$(BAP_DIR)/../utils-proj 3 | export BAP_PROJ_TESTDIR=$(BAP_DIR)/../tests-proj 4 | 5 | define PROJ_testsuite 6 | RESULT=project_test_suite 7 | SOURCES = $(BAP_PROJ_TESTDIR)/project_suite.ml 8 | DOC_FILES=$(SOURCES) 9 | endef 10 | export PROJ_testsuite 11 | 12 | export PROJTESTS = testsuite 13 | -------------------------------------------------------------------------------- /libasmir/src/Makefile.am: -------------------------------------------------------------------------------- 1 | AUTOMAKE_OPTIONS = subdir-objects 2 | 3 | RANLIB = @RANLIB@ 4 | lib_LIBRARIES = libasmir.a 5 | AM_CFLAGS = -I../include -Itraces -fPIC -DGET_OPERANDS 6 | AM_CXXFLAGS = $(AM_CFLAGS) 7 | 8 | 9 | libasmir_a_SOURCES = \ 10 | asm_program.c \ 11 | symbols.c \ 12 | ocaml_helpers.c \ 13 | llvm.cpp 14 | 15 | libasmir_a_LIBADD = @BAP_DIR@/libtracewrap/libtrace/src/cpp/libtrace.a 16 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/deps/ulex-1.1/ulex.mli: -------------------------------------------------------------------------------- 1 | type regexp 2 | 3 | val chars: Cset.t -> regexp 4 | val seq: regexp -> regexp -> regexp 5 | val alt: regexp -> regexp -> regexp 6 | val rep: regexp -> regexp 7 | val plus: regexp -> regexp 8 | val eps: regexp 9 | 10 | val compile: regexp array -> (int * int array * bool array) array 11 | val partitions: unit -> (int * (int * int * int) list) list 12 | -------------------------------------------------------------------------------- /solvers/getz3.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | 5 | if test "$(uname -m)" == "x86_64"; then 6 | url="http://research.microsoft.com/projects/z3/z3-x64-3.2.tar.gz" 7 | else 8 | url="http://research.microsoft.com/projects/z3/z3-3.2.tar.gz" 9 | fi 10 | 11 | wget $url -O - | tar -xvz -C $DIR 12 | cd $DIR/z3/ocaml && ./build-lib.sh $(ocamlfind query unix) -------------------------------------------------------------------------------- /batteries/examples/tools/mygzip.ml: -------------------------------------------------------------------------------- 1 | (* Compress a file to .gz on the spot 2 | 3 | Usage: 4 | ./gzip.byte some_file 5 | (produces some_file.gz, removes some_file) 6 | *) 7 | open File, IO, Filename 8 | 9 | iter f (args ()) 10 | where let f name = 11 | with_file_out (name ^ ".gz") (fun out -> 12 | with_file_in name (fun inp -> 13 | copy inp (Gzip.compress out); 14 | Sys.remove name 15 | )) 16 | -------------------------------------------------------------------------------- /batteries/examples/euler/euler014.ml: -------------------------------------------------------------------------------- 1 | let rec seq i = function 2 | 1 -> i 3 | | n when n land 1 = 0 -> seq (i+1) (n asr 1) 4 | | n (* odd *) -> seq (i+1) (3*n+1) 5 | 6 | let () = 7 | let best_i = ref 1 8 | and best_n0 = ref 1 in 9 | for n = 1 to 1_000_000 do 10 | let i = seq 1 n in 11 | if i > !best_i then 12 | ( best_i := i; best_n0 := n ); 13 | done; 14 | print_int !best_n0; print_newline () 15 | -------------------------------------------------------------------------------- /doc/just-formals/Makefile: -------------------------------------------------------------------------------- 1 | PAPERNAME=vine 2 | TEXFILES = *.tex 3 | 4 | TEXFILES = $(wildcard ../*.tex) $(wildcard *.sty) 5 | BIBFILES = $(wildcard bibtex/*.bib) 6 | 7 | all: $(PAPERNAME).pdf 8 | 9 | $(PAPERNAME).pdf : $(TEXFILES) $(BIBFILES) $(PAPERNAME).tex 10 | pdflatex $(PAPERNAME) 11 | pdflatex $(PAPERNAME) 12 | 13 | clean: 14 | rm -f *.ps *.pdf *.dvi *.aux *.log *.blg *.bbl *~ *.ilg *.idx *.out *.in $(PROGS) 15 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/ocaml_misc/P.piqi: -------------------------------------------------------------------------------- 1 | .ocaml-module "P" 2 | 3 | .import [ 4 | .module Ad 5 | .ocaml-name "Common_ad" 6 | ] 7 | 8 | .variant [ 9 | .name reply 10 | .option [ 11 | .name page 12 | .type Ad/id 13 | ] 14 | ] 15 | 16 | .variant [ 17 | .name voidvarianttosolvepiqibug 18 | .option [ 19 | .name bad 20 | .type int 21 | ] 22 | ] 23 | 24 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/ocaml_piqi/README: -------------------------------------------------------------------------------- 1 | 2 | Compile complex piqi specification "piqi/piqi.piqi" to produce OCaml 3 | parsers and generators. 4 | 5 | Then build a program which reads and writes back a serialized binary object 6 | which happens to be a serialized "piqi.piqi" specification. 7 | 8 | Also testing piqi imports in OCaml by compiling and linking "piqobj.piqi" which 9 | imports "piqi.piqi". 10 | 11 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/examples/record-variant-list.piq: -------------------------------------------------------------------------------- 1 | 2 | % record 3 | :record-variant-list/r [ .a 0 .b 1 ] 4 | 5 | % variant list 6 | :record-variant-list/l [ .a 0 .b 1 ] 7 | 8 | % abbreviated representation of variant values 9 | :record-variant-list/v.a 0 10 | :record-variant-list/v.b 1 11 | 12 | % un-abbreviated representation of variant values 13 | :record-variant-list/v (.a 0) 14 | :record-variant-list/v (.b 1) 15 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | The following people currently work on BAP: 2 | 3 | David Brumley 4 | Thanassis Avgerinos 5 | Edward J. Schwartz 6 | 7 | Previous developers include: 8 | Ivan Jager 9 | JongHyup Lee 10 | Spencer Whitman 11 | 12 | The original version of BAP was called VINE. VINE developers included: 13 | David Brumley 14 | Juan Caballero 15 | Cody Hartwig 16 | Ivan Jager 17 | Eric Li 18 | James Newsome 19 | Pongsin Poosankam 20 | Heng Yin 21 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/erlang_piqi/README: -------------------------------------------------------------------------------- 1 | 2 | Compile complex Piqi specification "piqi/piqi.piqi" to produce Erlang coders 3 | and decoders. 4 | 5 | Then build a program which reads and writes back a serialized binary object 6 | which happens to be the serialized "piqi.piqi" specification itself. 7 | 8 | Also testing Piqi imports in Erlang by compiling and linking "piqobj.piqi" which 9 | imports "piqi.piqi". 10 | 11 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/ocaml_piqi/test.ml: -------------------------------------------------------------------------------- 1 | 2 | let t () = 3 | let ich = open_in_bin "piqi.piqi.pb" in 4 | let buf = Piqirun.init_from_channel ich in 5 | let piqi = Piqi_piqi.parse_piqi buf in 6 | 7 | let och = open_out_bin "piqi.piqi.pb.pb" in 8 | let data = Piqi_piqi.gen_piqi piqi in 9 | Piqirun.to_channel och data; 10 | 11 | close_in ich; 12 | close_out och; 13 | () 14 | 15 | 16 | let _ = t () 17 | -------------------------------------------------------------------------------- /pcre-ocaml/lib/Makefile: -------------------------------------------------------------------------------- 1 | .NOTPARALLEL: 2 | 3 | OCAMLMAKEFILE = ../OCamlMakefile 4 | 5 | SOURCES := pcre.mli pcre.ml pcre_stubs.c 6 | CFLAGS := -O2 $(shell pcre-config --cflags) 7 | PCRE_FLAGS := $(shell pcre-config --libs) 8 | OCAMLLDFLAGS := -cclib "$(PCRE_FLAGS)" 9 | OCAMLMKLIB_FLAGS := $(PCRE_FLAGS) 10 | RESULT := pcre 11 | 12 | all: 13 | 14 | install: libinstall 15 | uninstall: libuninstall 16 | 17 | -include $(OCAMLMAKEFILE) 18 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/make/Makefile.dirs: -------------------------------------------------------------------------------- 1 | .PHONY: all dirs clean pre_target post_target 2 | 3 | all: pre_target dirs post_target 4 | 5 | 6 | # Added -j1 to stop parallel makes from blowing up. -ejs 7 | dirs: $(DIRS) 8 | set -e; \ 9 | for dir in $(DIRS); do \ 10 | $(MAKE) -j1 -C $$dir $(MAKECMDGOALS); \ 11 | done 12 | 13 | 14 | clean:: dirs 15 | 16 | 17 | pre_target:: 18 | post_target:: 19 | 20 | 21 | # vim:ft=make 22 | -------------------------------------------------------------------------------- /pcre-ocaml/lib/OMakefile: -------------------------------------------------------------------------------- 1 | OCAML_LIBRARIES = 2 | OCAMLPACKS = 3 | 4 | OCAML_LIB_FLAGS += -cclib -lpcre 5 | 6 | LIB_CNAMES = pcre_stubs 7 | LIB_MLNAMES = pcre 8 | 9 | OCamlMakeLib(pcre) 10 | 11 | 12 | doc: pcre $(OCAMLDOC_PP) 13 | $(OCamlDocs Pcre, *.mli *.ml, \ 14 | "OCaml Pcre bindings.") 15 | 16 | InstantiateOCamlEnv() 17 | 18 | doc: pcre $(OCAMLDOC_PP) 19 | $(OCamlDocs Pcre, *.mli *.ml, "Perl Compatible Regular Expressions.") 20 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/examples/ocaml-piq-config/build.sh: -------------------------------------------------------------------------------- 1 | 2 | set -ex 3 | piqic ocaml-ext --pp config.piqi 4 | ocamlfind ocamlopt -package piqi.lib -c config_piqi.ml 5 | ocamlfind ocamlopt -package piqi.lib -c config_piqi_ext.ml 6 | ocamlfind ocamlopt -package piqi.lib -c config.ml 7 | ocamlfind ocamlopt \ 8 | -package piqi.lib -linkpkg \ 9 | -o config \ 10 | config_piqi.cmx config_piqi_ext.cmx config.cmx 11 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/examples/piq-format.piqi: -------------------------------------------------------------------------------- 1 | % formatted Piq value representations 2 | 3 | .alias [ 4 | .name word 5 | .type string 6 | 7 | % if possible, format as word instead of quoted string literal 8 | .piq-format.word 9 | ] 10 | 11 | .alias [ 12 | .name text 13 | .type string 14 | 15 | % if possible, format as verbatim text instead of quoted string literal 16 | .piq-format.text 17 | ] 18 | 19 | -------------------------------------------------------------------------------- /ocamlgraph/editor/tests/parcours.dot: -------------------------------------------------------------------------------- 1 | digraph g { 2 | 3 | r -> U; 4 | r -> D; 5 | r -> T; 6 | 7 | U -> Ua; 8 | U -> Ub; 9 | Ua -> Uaa; 10 | Ub -> Ubb; 11 | Ua -> Ubb; 12 | Ub -> Uaa; 13 | 14 | D -> Da; 15 | D -> Db; 16 | Da -> Daa; 17 | Db -> Dbb; 18 | Da -> Dbb; 19 | Db -> Daa; 20 | 21 | T -> Ta; 22 | T -> Tb; 23 | Ta -> Taa; 24 | Tb -> Tbb; 25 | Ta -> Tbb; 26 | Tb -> Taa; 27 | 28 | Ua -> Da; 29 | Db -> Ta; 30 | Tb -> Ub; 31 | 32 | } -------------------------------------------------------------------------------- /tests/C/switch.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]) { 2 | 3 | int x = 0; 4 | 5 | switch(argc) { 6 | case 0: 7 | x += 0; 8 | 9 | case 5: 10 | x += 2; 11 | break; 12 | 13 | case 1: 14 | x += 2; 15 | 16 | case 2: 17 | x += 2; 18 | 19 | case 3: 20 | x += 2; 21 | 22 | default: 23 | x = 10; 24 | break; 25 | } 26 | 27 | return x; 28 | } 29 | -------------------------------------------------------------------------------- /utils-proj.example/Makefile: -------------------------------------------------------------------------------- 1 | # Project specific utils Makefile 2 | 3 | # We need to tell the main utils Makefile to include our proj's ocaml 4 | export BAP_PROJ_OCAMLDIR=$(BAP_DIR)/../ocaml-proj 5 | export BAP_PROJ_UTILDIR=$(BAP_DIR)/../utils-proj 6 | 7 | define PROJ_testutil 8 | RESULT=testutil 9 | SOURCES = $(BAP_PROJ_UTILDIR)/testutil.ml 10 | DOC_FILES=$(SOURCES) 11 | endef 12 | export PROJ_testutil 13 | 14 | export PROJUTILS = testutil 15 | -------------------------------------------------------------------------------- /batteries/examples/euler/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: all clean 2 | 3 | SOURCES = $(wildcard euler*.ml) 4 | TARGETS = $(SOURCES:.ml=.byte) 5 | LIBRARIES = mathlib.ml 6 | 7 | all: $(TARGETS) 8 | 9 | clean: 10 | rm *.byte *.native *.cmi *.cmo 11 | 12 | %.byte: $(LIBRARIES) %.ml 13 | ocamlfind ocamlc -thread -package threads,batteries -linkpkg $^ -o $@ 14 | 15 | %.native: $(LIBRARIES) %.ml 16 | ocamlfind ocamlc -thread -package threads,batteries -linkpkg $^ -o $@ -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/piqi_proto1/test: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -ex 4 | 5 | # .piqi -> .piqi.proto 6 | for i in *.piqi 7 | do 8 | piqi to-proto $i 9 | done 10 | 11 | 12 | # test .piqi.proto validity using Protobuf compiler 13 | for i in *.piqi.proto 14 | do 15 | protoc -ot $i 16 | done 17 | 18 | 19 | # .piqi.proto -> .piqi.proto.piqi 20 | for i in *.piqi.proto 21 | do 22 | piqi of-proto $i 23 | done 24 | 25 | -------------------------------------------------------------------------------- /ocaml/disasm.ml: -------------------------------------------------------------------------------- 1 | (** General disassembly stuff *) 2 | 3 | open Arch 4 | 5 | let arch_to_x86_mode = function 6 | | X86_32 -> Disasm_i386.X86 7 | | X86_64 -> Disasm_i386.X8664 8 | 9 | let disasm_instr arch = Disasm_i386.disasm_instr (arch_to_x86_mode arch) 10 | 11 | let is_temp = Var_temp.is_temp 12 | 13 | let is_decode_error = function 14 | | Ast.Special(s, _, _) when BatString.starts_with s "Unknown instruction" -> true 15 | | _ -> false 16 | -------------------------------------------------------------------------------- /ocaml/lnf_interface.mli: -------------------------------------------------------------------------------- 1 | (** Interface to loop nesting forest (LNF) algorithms. *) 2 | 3 | (** Steensgard *) 4 | module Steensgard : Lnf.MakeType 5 | 6 | (** Havlak *) 7 | module Havlak : Lnf.MakeType 8 | 9 | (** Reduced Havlak *) 10 | module Reduced_Havlak : Lnf.MakeType 11 | 12 | (** Sreedhar *) 13 | module Sreedhar : Lnf.MakeType 14 | 15 | (** A list of all supported LNF algorithms. *) 16 | val lnflist : (string * (module Lnf.MakeType)) list 17 | -------------------------------------------------------------------------------- /tests/C/recover-hard-pointer.c: -------------------------------------------------------------------------------- 1 | int f(int *foo) { 2 | int x = 10; 3 | switch (*foo) { 4 | case 0: 5 | x = 5; 6 | break; 7 | case 3: 8 | x = 6; 9 | break; 10 | case 4: 11 | x = 6; 12 | case 5: 13 | x = 6; 14 | break; 15 | case 7: 16 | x = 0; 17 | break; 18 | } 19 | return x; 20 | } 21 | 22 | int main() { 23 | int x = 5; 24 | f(&x); 25 | } 26 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/examples/function.piq: -------------------------------------------------------------------------------- 1 | % input/ouput/error of functions defined in function.piqi 2 | 3 | :function/bar-input [ 10 ] 4 | :function/bar-output 1 5 | :function/bar-error 100.0 6 | 7 | 8 | :function/baz-input [] 9 | 10 | 11 | :function/v-output.i 0 12 | :function/v-output.f 100.0 13 | 14 | 15 | :function/e-error.a 16 | :function/e-error.b 17 | 18 | 19 | :function/l-input [1 2 3] 20 | 21 | 22 | :function/a-input # foo 23 | -------------------------------------------------------------------------------- /ocaml/grammar.mly.mli: -------------------------------------------------------------------------------- 1 | (* grammar.mly.mli 2 | This is a fake .mli file to be appended to that produced by ocamlyacc 3 | There doesn't seem to be a good way to say what gets exposed from the 4 | .mly file, so I cobbled this together. 5 | Of course, this requires some hacking of the build system... 6 | --Ivan 7 | *) 8 | 9 | 10 | type scope 11 | 12 | val scope_create : Var.t list -> scope 13 | let scope_set : scope -> unit 14 | let scope_default : scope 15 | -------------------------------------------------------------------------------- /vagrant/bootstrap.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -x 4 | 5 | INSTALL=/vagrant/INSTALL 6 | 7 | apt-get update 8 | 9 | START=`awk '/__BEGIN_REQUIRED__/ {print NR + 1; exit 0; }' $INSTALL` 10 | END=$((`awk '/__END_REQUIRED__/ {print NR; exit 0; }' $INSTALL` - $START)) 11 | 12 | tail -n+$START $INSTALL | head -n$END | bash 13 | 14 | echo 0 > /proc/sys/kernel/yama/ptrace_scope 15 | 16 | cd /vagrant 17 | ./autogen.sh 18 | ./configure 19 | make test 20 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/deps/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.config 2 | include $(PIQI_ROOT)/make/Makefile.dirs 3 | 4 | 5 | ifndef SKIP-ulex 6 | ULEX_DIR = ulex-1.1 7 | endif 8 | 9 | ifndef SKIP-xmlm 10 | XMLM_DIR = xmlm-1.1.1 11 | endif 12 | 13 | ifndef SKIP-easy-format 14 | EASY_FORMAT_DIR = easy-format-1.0.0 15 | endif 16 | 17 | 18 | DIRS = $(ULEX_DIR) $(XMLM_DIR) $(EASY_FORMAT_DIR) 19 | 20 | 21 | install: dirs 22 | 23 | uninstall: dirs 24 | 25 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/cpp/Makefile: -------------------------------------------------------------------------------- 1 | all: prep test 2 | 3 | 4 | prep: 5 | piqi convert -t pb piqi.piqi 6 | 7 | 8 | test: 9 | piqi to-proto piqi.piqi 10 | protoc --cpp_out=. piqi.piqi.proto 11 | $(MAKE) -f Makefile.cpp 12 | #protoc --decode=piqi_org.piqi.piqi piqi.piqi.proto < piqi.piqi.pb > t.ptext 13 | ./ctest > t.ptext1 14 | #cmp t.ptext* 15 | 16 | 17 | clean: 18 | rm -f piqi.piqi.* t.* 19 | $(MAKE) -f Makefile.cpp clean 20 | 21 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/erlang_perf/test: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ $# -gt 1 ] 4 | then 5 | echo "Usage: $0 []" 6 | exit 1 7 | fi 8 | 9 | 10 | #BOOT="-boot start_sasl" 11 | RUN="test main $1" 12 | ERL_PATH=$PIQI_ROOT/piqi-erlang/ebin 13 | 14 | 15 | erl -pz $ERL_PATH -noshell $BOOT -s piqi start -run $RUN -s erlang halt 16 | #rlwrap erl -oldshell -pz $ERL_PATH -s piqi_tools start -run $RUN #-s erlang halt 17 | 18 | -------------------------------------------------------------------------------- /ocaml/arch.mli: -------------------------------------------------------------------------------- 1 | (** Supported BAP architectures *) 2 | 3 | type arch = 4 | | X86_32 5 | | X86_64 6 | 7 | val arch_to_string : arch -> string 8 | 9 | val arch_of_string : string -> arch 10 | 11 | val type_of_arch : arch -> Type.typ 12 | 13 | val bits_of_arch : arch -> int 14 | 15 | val bytes_of_arch : arch -> int 16 | 17 | val mode_of_arch : arch -> Disasm_i386.mode 18 | 19 | val mem_of_arch : arch -> Var.t 20 | 21 | val sp_of_arch : arch -> Var.t 22 | -------------------------------------------------------------------------------- /ocaml/lnf_interface.ml: -------------------------------------------------------------------------------- 1 | open Lnf 2 | 3 | module Steensgard = Lnf_steensgard.Make 4 | module Havlak = Lnf_havlak.Make 5 | module Reduced_Havlak = Lnf_reduced_havlak.Make 6 | module Sreedhar = Lnf_sreedhar.Make 7 | 8 | let lnflist = 9 | ("steensgard", (module Steensgard : MakeType)) 10 | :: ("havlak", (module Havlak : MakeType)) 11 | :: ("reduced_havlak", (module Reduced_Havlak : MakeType)) 12 | :: ("sreedhar", (module Sreedhar : MakeType)) 13 | :: [] 14 | -------------------------------------------------------------------------------- /batteries/benchsuite/flip.ml: -------------------------------------------------------------------------------- 1 | open BatPervasives 2 | open BatSet 3 | 4 | let of_list l = List.fold_left (flip add) empty l 5 | let of_list2 l = List.fold_left (fun x y -> add y x) empty l 6 | let of_list3 l = BatList.enum l |> BatSet.of_enum 7 | 8 | let wrap f () = f [1;3;5;7;9;2;4;6;8;10; 2; 5; 8; 3; 1; 9; 6] 9 | 10 | let () = Bench.bench ["flip", wrap of_list; 11 | "fun", wrap of_list2; 12 | "enum", wrap of_list3] 13 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | ebin 3 | 4 | *.[oa] 5 | 6 | # OCaml: 7 | *.cm[ioxa] 8 | *.cmxa 9 | 10 | # OCamlMakefile: 11 | *.top 12 | ._d 13 | ._bcdi 14 | ._ncdi 15 | 16 | # vim: 17 | *.swp 18 | 19 | # FIXME: get rid of these symlinks added to be able to run Dialyzer on sources 20 | examples/erlang/piqi-erlang 21 | piqi-rpc/src/piqi-erlang 22 | tests/erlang_piqi/piqi-erlang 23 | 24 | # generated by ./configure 25 | /Makefile.config 26 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/piqi_proto1/Ad.piqi: -------------------------------------------------------------------------------- 1 | .ocaml-module "Ad" .protobuf-package "Ad" 2 | .custom-field ocaml-module 3 | 4 | % testing recursive imported alias generation/ unrolling 5 | .import [ .module T .name Topic ] 6 | 7 | % a test for .proto import deduplication 8 | .import [ .module T ] 9 | 10 | .record [ 11 | .name datastore-entry 12 | .field [ 13 | .name topic-vector 14 | .type Topic/vector 15 | ] 16 | ] 17 | 18 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/src/ocaml/utils/readtrace.ml: -------------------------------------------------------------------------------- 1 | open Trace.Trace_container 2 | open Trace.Frame_piqi_ext 3 | 4 | let print f = 5 | print_frame f 6 | 7 | let print_all f = 8 | 9 | let r = new reader f in 10 | 11 | while not r#end_of_trace do 12 | print r#get_frame 13 | done;; 14 | 15 | let () = 16 | if Array.length Sys.argv = 2 then 17 | print_all Sys.argv.(1) 18 | else 19 | Printf.fprintf stderr "Usage: readtrace \n" 20 | ;; 21 | 22 | -------------------------------------------------------------------------------- /ocaml/piqi/ast_piqi.mli: -------------------------------------------------------------------------------- 1 | (** Convert AST programs to the Piqi serialization format, which can 2 | convert to protobuffers, xml, and json. 3 | 4 | @author Edward J. Schwartz 5 | *) 6 | 7 | (** [to_pb p] converts [p] to protobuffer format. *) 8 | val to_pb : Ast.program -> string 9 | 10 | (** [to_json p] converts [p] to JSON format. *) 11 | val to_json : Ast.program -> string 12 | 13 | (** [to_xml p] converts [p] to XML format. *) 14 | val to_xml : Ast.program -> string 15 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/src/cpp/Makefile.am: -------------------------------------------------------------------------------- 1 | AUTOMAKE_OPTIONS = subdir-objects 2 | AM_CPPFLAGS = -I./pb -I@LIBTRACE_DIR@/src/common -I@LIBTRACE_DIR@/protobuf/src 3 | # enable PIC for x64 support 4 | AM_CXXFLAGS = -fPIC -DPIC 5 | 6 | lib_LIBRARIES = libtrace.a 7 | libtrace_a_SOURCES = pb/frame.piqi.pb.h pb/frame.piqi.pb.cc trace.container.cpp 8 | 9 | # Don't auto-link LIBS coming from autoconf, because we might not have 10 | # 32-bit equivalents! 11 | LIBS = 12 | 13 | SUBDIRS = . utils 14 | -------------------------------------------------------------------------------- /ounit/configure: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # OASIS_START 4 | # DO NOT EDIT (digest: 425187ed8bfdbdd207fd76392dd243a7) 5 | set -e 6 | 7 | FST=true 8 | for i in "$@"; do 9 | if $FST; then 10 | set -- 11 | FST=false 12 | fi 13 | 14 | case $i in 15 | --*=*) 16 | ARG=${i%%=*} 17 | VAL=${i##*=} 18 | set -- "$@" "$ARG" "$VAL" 19 | ;; 20 | *) 21 | set -- "$@" "$i" 22 | ;; 23 | esac 24 | done 25 | 26 | ocaml setup.ml -configure "$@" 27 | # OASIS_STOP 28 | -------------------------------------------------------------------------------- /ounit/examples/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | 4 | TESTS = test_list.ml test_list2.ml test_stack.ml 5 | 6 | test: test_suite example 7 | -./test_suite 8 | -./example 9 | 10 | test_suite: $(TESTS) test_suite.ml 11 | ocamlfind ocamlc -o test_suite -package oUnit -linkpkg \ 12 | test_list.ml test_list2.ml test_stack.ml test_suite.ml 13 | 14 | example: example.ml 15 | ocamlfind ocamlc -o example -package oUnit -linkpkg \ 16 | example.ml 17 | 18 | clean: 19 | -$(RM) *.cmi *.cmo test_suite example 20 | -------------------------------------------------------------------------------- /tests/C/recover-hard.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int f(int input) { 4 | int x = 0; 5 | while (x < 100) { 6 | switch (x) { 7 | case 0: x += input; break; 8 | case 1: x += 1; break; 9 | case 2: x += 6; break; 10 | case 3: x += 5; break; 11 | case 4: x += 4; break; 12 | case 5: x += 3; break; 13 | case 6: x += 2; break; 14 | } 15 | } 16 | 17 | printf("woo\n"); 18 | return x; 19 | } 20 | 21 | int main() { 22 | f(3); 23 | } 24 | -------------------------------------------------------------------------------- /batteries/META.in: -------------------------------------------------------------------------------- 1 | name="batteries" 2 | version="@VERSION@" 3 | description="Batteries Included, the stdlib of choice" 4 | requires ="unix,num,bigarray,str" 5 | requires(mt)+="threads" 6 | archive(toploop) ="batteries.cma batteriesConfig.cmo batteriesHelp.cmo batteriesPrint.cmo" 7 | archive(toploop,mt)+="batteriesThread.cma" 8 | archive(byte) ="batteries.cma" 9 | archive(byte,mt) +="batteriesThread.cma" 10 | archive(native) ="batteries.cmxa" 11 | archive(native,mt) +="batteriesThread.cmxa" 12 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/Makefile: -------------------------------------------------------------------------------- 1 | # Piqi wrapper Makefile 2 | 3 | .PHONY: all clean tags 4 | 5 | all: deps 6 | # Annoying, but we need bash for this because Piqi people don't know 7 | # how to make a Makefile. 8 | bash -c 'cd piqi && source setenv.sh && $(MAKE)' 9 | 10 | deps: 11 | echo Building deps 12 | bash -c 'cd piqi && source setenv.sh && $(MAKE) deps' 13 | touch deps 14 | 15 | clean: 16 | $(RM) deps 17 | bash -c 'cd piqi && source setenv.sh && $(MAKE) distclean' 18 | 19 | tags: 20 | 21 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/protobuf/protobuf-lite.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: Protocol Buffers 7 | Description: Google's Data Interchange Format 8 | Version: @VERSION@ 9 | Libs: -L${libdir} -lprotobuf-lite @PTHREAD_CFLAGS@ @PTHREAD_LIBS@ 10 | Cflags: -I${includedir} @PTHREAD_CFLAGS@ 11 | # Commented out because it crashes pkg-config *sigh*: 12 | # http://bugs.freedesktop.org/show_bug.cgi?id=13265 13 | # Conflicts: protobuf 14 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/protobuf/protobuf.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: Protocol Buffers 7 | Description: Google's Data Interchange Format 8 | Version: @VERSION@ 9 | Libs: -L${libdir} -lprotobuf @LIBS@ @PTHREAD_CFLAGS@ @PTHREAD_LIBS@ 10 | Cflags: -I${includedir} @PTHREAD_CFLAGS@ 11 | # Commented out because it crashes pkg-config *sigh*: 12 | # http://bugs.freedesktop.org/show_bug.cgi?id=13265 13 | # Conflicts: protobuf-lite 14 | -------------------------------------------------------------------------------- /ocaml/var_temp.ml: -------------------------------------------------------------------------------- 1 | let temp_prefix = "T_" 2 | let temp_prefix_len = String.length temp_prefix 3 | 4 | let is_temp_name s = 5 | (* First try VEX style vars *) 6 | (String.length s > temp_prefix_len) && (String.sub s 0 2 = temp_prefix) 7 | 8 | let is_temp (Var.V(_, s, _)) = 9 | is_temp_name s 10 | 11 | let nt s t = 12 | if (is_temp_name s) then 13 | Var.newvar s t 14 | else 15 | let newname = temp_prefix^s in 16 | let () = assert (is_temp_name newname) in 17 | Var.newvar (newname) t 18 | -------------------------------------------------------------------------------- /ounit/examples/test_list2.ml: -------------------------------------------------------------------------------- 1 | open OUnit 2 | 3 | let empty_list = [] 4 | let list_a = [1;2;3] 5 | 6 | let test_list_length _ = 7 | assert_equal 1 (List.length empty_list); 8 | assert_equal 3 (List.length list_a) 9 | (* etc, etc *) 10 | 11 | let test_list_append _ = 12 | let list_b = List.append empty_list [1;2;3] in 13 | assert_equal list_b list_a 14 | 15 | let suite = "Test_list2" >::: ["test_list_length2" >:: test_list_length; 16 | "test_list_append2" >:: test_list_append] 17 | 18 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/ocaml_packed/test_packed.ml: -------------------------------------------------------------------------------- 1 | 2 | let t () = 3 | print_endline "testing packed repeated fields"; 4 | let ich = open_in_bin "test-all.piq.pb" in 5 | let buf = Piqirun.init_from_channel ich in 6 | let piqi = Packed_piqi.parse_r_all buf in 7 | 8 | let och = open_out_bin "test-all.piq.pb.packed" in 9 | let data = Packed_piqi.gen_r_all piqi in 10 | Piqirun.to_channel och data; 11 | 12 | close_in ich; 13 | close_out och; 14 | () 15 | 16 | 17 | let _ = t () 18 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/examples/ocaml-piq-config/config.piqi: -------------------------------------------------------------------------------- 1 | .module config 2 | 3 | .enum [ 4 | .name generator 5 | .option [ .name make ] 6 | .option [ .name latexmk ] 7 | .option [ .name org ] 8 | .option [ .name tensile ] 9 | ] 10 | 11 | .record [ 12 | .name entry 13 | .field [ 14 | .name path 15 | .type string 16 | ] 17 | .field [ 18 | .type generator 19 | ] 20 | ] 21 | 22 | .list [ 23 | .name config 24 | .type entry 25 | ] 26 | 27 | -------------------------------------------------------------------------------- /tests/C/test.c: -------------------------------------------------------------------------------- 1 | int f(int y) { 2 | int i = 0, j = 0; 3 | for (i = 0; i < y; i++) { 4 | j++; 5 | } 6 | 7 | switch(y) { 8 | case 0: j += 1; break; 9 | case 1: j += 2; break; 10 | case 2: j += 3; break; 11 | case 4: j += 4; break; 12 | case 5: j += 4; break; 13 | default: break; 14 | } 15 | 16 | return j; 17 | } 18 | 19 | int g(int y) { 20 | if (y == 42) { return 42; } else { return -1; } 21 | } 22 | 23 | int main(char **argv, int argc) { 24 | return g(42); 25 | } 26 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/deps/ulex-1.1/utf8.mli: -------------------------------------------------------------------------------- 1 | exception MalFormed 2 | 3 | val width: int array 4 | val next: string -> int -> int 5 | val compute_len: string -> int -> int -> int 6 | val blit_to_int: string -> int -> int array -> int -> int -> unit 7 | val to_int_array: string -> int -> int -> int array 8 | 9 | val store: Buffer.t -> int -> unit 10 | val from_int_array: int array -> int -> int -> string 11 | 12 | val from_stream: char Stream.t -> int 13 | val stream_from_char_stream: char Stream.t -> int Stream.t 14 | -------------------------------------------------------------------------------- /batteries/examples/euler/euler009.ml: -------------------------------------------------------------------------------- 1 | let () = 2 | let max_search = 100 in 3 | for n = 1 to max_search do 4 | for m = n+1 to max_search do 5 | let a = 2 * m * n 6 | and b = m * m - n * n 7 | and c = m * m + n * n 8 | in 9 | let s = a + b + c in 10 | if 1000 mod s = 0 then 11 | let m = (1000 / s) in 12 | Printf.printf "mult: %d\n" m; 13 | Printf.printf "a: %d b: %d c: %d\n" (a*m) (b*m) (c*m); 14 | print_int (a * b * c * m * m * m); print_newline (); 15 | exit 0 16 | done; 17 | done 18 | -------------------------------------------------------------------------------- /batteries/examples/euler/euler010.ml: -------------------------------------------------------------------------------- 1 | open Batteries 2 | open Enum 3 | 4 | let max_val = 2_000_000 5 | let max_test = max_val |> float |> sqrt |> Float.to_int 6 | 7 | let () = 8 | let primes = ref (2--max_val) in 9 | let s = ref 0 in 10 | let rec loop () = 11 | match get !primes with 12 | | None -> print_int !s; print_newline () 13 | | Some p -> 14 | s := !s + p; 15 | if p < max_test then 16 | primes := !primes // (fun x -> x mod p != 0); (* damn inefficient *) 17 | loop() 18 | in 19 | loop () 20 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqi/piqi.json.piqi: -------------------------------------------------------------------------------- 1 | % JSON-specific extensions for Piqi self-spec 2 | % 3 | % This file defines some extensions to base Piqi specification enabling fields 4 | % specific to JSON 5 | % 6 | % Copyright 2009, 2010, 2011, 2012, 2013 Anton Lavrik 7 | 8 | 9 | .include [ .module piqi ] 10 | 11 | 12 | .extend [ 13 | (.typedef record field variant option enum alias list) 14 | 15 | .with.field [ 16 | .name json-name 17 | .type string 18 | .optional 19 | ] 20 | ] 21 | 22 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqi-erlang/piqic-erlang-ext/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.config 2 | 3 | PIQIC_PLUGIN = piqic-erlang-ext 4 | 5 | 6 | PIQIC_PLUGIN_BEAMS = \ 7 | ../ebin/piqi.beam \ 8 | ../ebin/piqirun.beam \ 9 | ../ebin/piqi_piqi.beam \ 10 | ../ebin/piqic_erlang_ext.beam 11 | 12 | 13 | all: $(PIQIC_PLUGIN) 14 | 15 | 16 | $(PIQIC_PLUGIN): $(PIQIC_PLUGIN_BEAMS) 17 | $(PIQI_ROOT)/make/make_escript $@ $(PIQIC_PLUGIN_BEAMS) 18 | chmod +x $@ 19 | 20 | 21 | clean:: 22 | rm -f $(PIQIC_PLUGIN) 23 | 24 | -------------------------------------------------------------------------------- /ocaml/steensgard.mli: -------------------------------------------------------------------------------- 1 | (** Steensgard's loop nesting algorithm 2 | 3 | See Steensgaard, B. (1993). Sequentializing Program Dependence 4 | Graphs for Irreducible Programs (No. MSR-TR-93-14). 5 | *) 6 | 7 | (** Loop information for CFGs with vertices of type ['a]. *) 8 | type 'a loopinfo = 9 | | BB of 'a 10 | | Other of 'a loopinfo list 11 | | Loop of 'a loopinfo list (* body of loop *) 12 | 13 | val steensgard_ast : Cfg.AST.G.t -> Cfg.AST.G.V.t loopinfo 14 | 15 | val steensgard_ssa : Cfg.SSA.G.t -> Cfg.SSA.G.V.t loopinfo 16 | -------------------------------------------------------------------------------- /ounit/examples/example.ml: -------------------------------------------------------------------------------- 1 | open OUnit 2 | 3 | let empty_list = [] 4 | let list_a = [1;2;3] 5 | 6 | let test_list_length _ = 7 | assert_equal 1 (List.length empty_list); 8 | assert_equal 3 (List.length list_a) 9 | (* etc, etc *) 10 | 11 | let test_list_append _ = 12 | let list_b = List.append empty_list [1;2;3] in 13 | assert_equal list_b list_a 14 | 15 | let suite = "OUnit Example" >::: ["test_list_length" >:: test_list_length; 16 | "test_list_append" >:: test_list_append] 17 | let _ = 18 | run_test_tt_main suite 19 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/ocaml_array/test.ml: -------------------------------------------------------------------------------- 1 | 2 | let t () = 3 | print_endline "testing Piqi repeated fields and Piqi lists represented as OCaml arrays"; 4 | let ich = open_in_bin "test-all.piq.pb" in 5 | let buf = Piqirun.init_from_channel ich in 6 | let piqi = Packed_piqi.parse_r_all buf in 7 | 8 | let och = open_out_bin "test-all.piq.pb.array" in 9 | let data = Packed_piqi.gen_r_all piqi in 10 | Piqirun.to_channel och data; 11 | 12 | close_in ich; 13 | close_out och; 14 | () 15 | 16 | 17 | let _ = t () 18 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | BAP: The Binary Analysis Platform. For more information see our 2 | project webpage at http://bap.ece.cmu.edu 3 | 4 | For installation instruction see the INSTALL file. 5 | 6 | For copyright information see the COPYING file. 7 | 8 | This is a pre-alpha release. It is completely unsupported. If you need help, 9 | this is not for you; please wait for a later version or learn some problem 10 | solving skills. If you find a bug, please submit them to 11 | https://kestrel.ece.cmu.edu/bugzilla/ Notice that we do not guarantee any 12 | support. 13 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/examples/test_piqi_proto: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -ex 3 | 4 | f=$1 5 | 6 | 7 | # convert .piqi to .piqi.proto 8 | piqi to-proto $f.piqi 9 | 10 | 11 | # don't continue the test if there's no procol (Protocol Buffers compiler) 12 | which protoc || exit 0 13 | 14 | 15 | # check .piqi.proto 16 | protoc -o/dev/null --include_imports $f.piqi.proto 17 | 18 | 19 | # convert .piqi.proto to .piqi.proto.piqi 20 | piqi of-proto $f.piqi.proto 21 | 22 | 23 | # check .piqi.proto.piqi 24 | piqi check $f.piqi.proto.piqi 25 | 26 | -------------------------------------------------------------------------------- /tests/C/Makefile.in: -------------------------------------------------------------------------------- 1 | CSRC=$(wildcard *.c) 2 | CEXECS_SRC = $(CSRC:%.c=%) 3 | CEXECS=$(CEXECS_SRC) recover-hard-opt 4 | CEXECS_64 = $(CEXECS_SRC:%=%_64) 5 | 6 | CFLAGS = -fno-stack-protector 7 | 8 | all: $(CEXECS) 9 | 10 | recover-hard-opt: recover-hard.c 11 | $(CC) -m32 $< -o $@ $(CFLAGS) -O3 12 | 13 | $(CEXECS_SRC): $(CSRC) 14 | gcc -m32 $@.c -o $@ $(CFLAGS) 15 | ifeq (@ARCH_X64@, true) 16 | gcc $@.c -o $@_64 $(CFLAGS) 17 | endif 18 | 19 | 20 | clean: 21 | rm -f $(CEXECS) 22 | ifeq (@ARCH_X64@, true) 23 | rm -f $(CEXECS_64) 24 | endif 25 | -------------------------------------------------------------------------------- /ocamlgraph/view_graph/README: -------------------------------------------------------------------------------- 1 | ====================================================== 2 | ViewGraph is now deprecated. Prefer to use dgraph now. 3 | ====================================================== 4 | 5 | ViewGraph is a small ocaml library that helps to view a graph from a dot file 6 | in a Lablgtk canvas, and interact with it. 7 | 8 | To have more information : 9 | make doc 10 | and browse the documentation starting from doc/index.html 11 | 12 | You can also compile the test file, and try to use it : 13 | make; ./viewgraph file.dot 14 | 15 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/ocaml_perf/README: -------------------------------------------------------------------------------- 1 | Performance tests for serialization and de-serialization of OCaml data 2 | structures to/from Protocol Buffers, JSON, XML and Piq data formats. 3 | 4 | The tests are performed on two different objects. The first one is a relatively 5 | small and not very complicated "addressbook.piq". The second one is the expanded 6 | Piqi self-specification which is 10 times as large as the first one and has more 7 | complex structure. 8 | 9 | To run the tests: 10 | 11 | make 12 | 13 | ./test 14 | 15 | -------------------------------------------------------------------------------- /ocamlgraph/editor/tests/test2_2.gml: -------------------------------------------------------------------------------- 1 | graph [ 2 | comment "This is a sample graph" 3 | directed 1 4 | id 42 5 | label "Hello, I am a graph" 6 | node [ id 1 label "Node 1" ] 7 | node [ id 2 label "node 2" ] 8 | node [ id 3 label "node 3" ] 9 | node [ id 4 label "node 4" ] 10 | node [ id 5 label "node 5" ] 11 | edge [ source 1 target 2 ] 12 | edge [ source 1 target 3 ] 13 | edge [ source 1 target 4 ] 14 | edge [ source 1 target 5 ] 15 | edge [ source 2 target 3 ] 16 | edge [ source 4 target 5 ] 17 | 18 | ] -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/ocaml_packed/test_packed_array.ml: -------------------------------------------------------------------------------- 1 | 2 | let t () = 3 | print_endline "testing packed repeated fields represented as OCaml arrays"; 4 | let ich = open_in_bin "test-all.piq.pb" in 5 | let buf = Piqirun.init_from_channel ich in 6 | let piqi = Packed_array_piqi.parse_r_all buf in 7 | 8 | let och = open_out_bin "test-all.piq.pb.packed-array" in 9 | let data = Packed_array_piqi.gen_r_all piqi in 10 | Piqirun.to_channel och data; 11 | 12 | close_in ich; 13 | close_out och; 14 | () 15 | 16 | 17 | let _ = t () 18 | -------------------------------------------------------------------------------- /ounit/examples/test_list.ml: -------------------------------------------------------------------------------- 1 | open OUnit 2 | 3 | let empty_list = [] 4 | let list_a = [1;2;3] 5 | 6 | let test_list_length _ = 7 | assert_equal 1 (List.length empty_list); 8 | assert_equal 3 (List.length list_a) 9 | (* etc, etc *) 10 | 11 | let test_list_append _ = 12 | let list_b = List.append empty_list [1;2;3] in 13 | assert_equal list_b list_a 14 | 15 | let suite = "OUnit Example" >::: ["test_list_length" >:: test_list_length; 16 | "test_list_append" >:: test_list_append] 17 | 18 | (* 19 | let _ = 20 | run_test_tt_main suite 21 | *) 22 | -------------------------------------------------------------------------------- /batteries/.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | _build 3 | build/META 4 | build/make_suite 5 | src/batteries_config.ml 6 | doc/batteries/html/api/ 7 | hdoc/* 8 | man/* 9 | *.byte 10 | *.native 11 | /.omake* 12 | *.swp 13 | *.opt 14 | *.run 15 | apidocs 16 | batteries.docdir 17 | batteries.odocl 18 | qtest/*_t.ml 19 | qtest/test_mods.mllib 20 | bench.log 21 | qtest/all_tests.ml 22 | qtest2/all_tests.ml 23 | qtest.targets.log 24 | coverage 25 | setup.data 26 | setup.log 27 | src/batUnix.mli 28 | src/batPervasives.mli 29 | src/batInnerPervasives.ml 30 | src/batHashtbl.ml 31 | src/batMarshal.mli -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/erlang_piqi/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: test 2 | 3 | all: prep test 4 | 5 | 6 | prep: 7 | ln -sf ../piqi_misc/piqobj.piqi . 8 | piqi convert --add-defaults -t pb piqi.piqi 9 | 10 | 11 | PIQIC_FLAGS = --gen-defaults --embed-piqi 12 | 13 | 14 | test: 15 | piqic erlang $(PIQIC_FLAGS) piqi.piqi 16 | piqic erlang $(PIQIC_FLAGS) piqobj.piqi 17 | $(MAKE) -f Makefile.erlang 18 | ./test 19 | cmp *.pb 20 | 21 | 22 | clean: 23 | rm -f piqobj.piqi piqi.piqi.* piqi_piqi.* piqobj_piqi.* t.* 24 | $(MAKE) -f Makefile.erlang clean 25 | 26 | -------------------------------------------------------------------------------- /ocaml/ast_mapper.mli: -------------------------------------------------------------------------------- 1 | (** Apply a mapping to all expressions in a program. 2 | 3 | @author Thanassis 4 | *) 5 | 6 | open Ast 7 | open Type 8 | 9 | (** A mapping object. *) 10 | class type map = object 11 | method exp : exp -> exp 12 | method stmt : stmt -> stmt 13 | method prog : program -> program 14 | method cfg : Cfg.AST.G.t -> Cfg.AST.G.t 15 | end 16 | 17 | (** [map_e f] returns a map object for [f]. 18 | 19 | For instance, to map all expressions in a cfg, use [(map_e f)#cfg 20 | cfg]. *) 21 | val map_e : (exp -> exp visit_action) -> map 22 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqi-rpc/examples/addressbook/person.piq: -------------------------------------------------------------------------------- 1 | % this is an object of type "person" which is defined in module "person" 2 | :person/person [ 3 | .name "J. Random Hacker" 4 | .id 0 5 | 6 | .email "j.r.hacker@example.com" 7 | 8 | .phone [ 9 | .number "(111) 123 45 67" 10 | % NOTE: phone is "home" by default 11 | ] 12 | 13 | .phone [ 14 | .number "(222) 123 45 67" 15 | .mobile 16 | ] 17 | 18 | .phone [ 19 | .number "(333) 123 45 67" 20 | .work 21 | ] 22 | ] 23 | 24 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqic/piqi-impl.piqi: -------------------------------------------------------------------------------- 1 | % This is a minimal "-impl.piqi" file for Piqi interface compiler (piqic). 2 | % It includes: 3 | % 4 | % 1) The mandatory piqi specification ("piqic.piqi"). 5 | % 6 | % 2) Implementation-specific extensions ("piqilib/piqi-impl.piqi") used by 7 | % common piqi library (../piqilib). This way, piqic doesn't have any custom 8 | % implementation-specific extensions -- only those required by common piqi 9 | % library. 10 | 11 | .include [ .module piqilib/piqi-impl ] 12 | 13 | .include [ .module piqic/piqi-lang ] 14 | 15 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqicc/piqi-impl.piqi: -------------------------------------------------------------------------------- 1 | % This is a minimal "-impl.piqi" file for Piqi compiler compiler (piqicc). 2 | % It includes: 3 | % 4 | % 1) The mandatory piqi specification ("piqicc.piqi"). 5 | % 6 | % 2) Implementation-specific extensions ("piqilib/piqi-impl.piqi") used by 7 | % common piqi library (../piqilib). This way, piqicc doesn't have any custom 8 | % implementation-specific extensions -- only those required by common piqi 9 | % library. 10 | 11 | .include [ .module piqilib/piqi-impl ] 12 | 13 | .include [ .module piqicc/piqi-lang ] 14 | 15 | -------------------------------------------------------------------------------- /batteries/benchsuite/bench_num.ml: -------------------------------------------------------------------------------- 1 | let lt1 (x:int) y = x < y 2 | let lt2 x y = x < y 3 | let lt3 x y = BatInt.Compare.(<) x y 4 | 5 | let n = 100_000 6 | 7 | let test_array = Array.init n (fun _ -> BatRandom.full_range ()) 8 | 9 | let test_f f niters = 10 | for j = 1 to niters do 11 | for i = 1 to n-1 do 12 | let x = test_array.(i-1) in 13 | let y = test_array.(i) in 14 | ignore (f x y); 15 | done 16 | done 17 | 18 | let () = Bench.bench_n [ 19 | "Specialized", test_f lt1; 20 | "Polymorphic", test_f lt2; 21 | "BatInt.Compare", test_f lt3; 22 | ] 23 | -------------------------------------------------------------------------------- /ounit/ci-main.lua: -------------------------------------------------------------------------------- 1 | 2 | bootstrap = require("bootstrap") 3 | 4 | bootstrap.init() 5 | 6 | oasis = require("oasis") 7 | darcs = require("darcs") 8 | ci = require("ci") 9 | godi = require("godi") 10 | 11 | ci.init() 12 | godi.init() 13 | oasis.init() 14 | darcs.init() 15 | 16 | godi.bootstrap("3.12") 17 | godi.update() 18 | godi.upgrade() 19 | godi.build("godi-findlib") 20 | 21 | ci.exec("ocaml", "setup.ml", "-configure", "--enable-backtrace") 22 | ci.exec("ocaml", "setup.ml", "-build") 23 | ci.exec("ocaml", "setup.ml", "-test") 24 | darcs.create_tag(oasis.package_version()) 25 | -------------------------------------------------------------------------------- /pintraces/getpin.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Download and extract Pin 4 | 5 | set -x 6 | 7 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 8 | 9 | cd $DIR 10 | 11 | # check if pin dir exists first 12 | 13 | wget 'http://software.intel.com/sites/landingpage/pintool/downloads/pin-2.13-61206-gcc.4.4.7-linux.tar.gz' -U "Mozilla/5.0 (compatible; MSIE 10.6; Windows NT 6.1; Trident/5.0; InfoPath.2; SLCC1; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 2.0.50727) 3gpp-gba UNTRUSTED/1.0" -O - | tar -xvz -C .. 14 | rm -rf ../pin 15 | mv ../pin-* ../pin 16 | #make 17 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/deps/xmlm-1.1.1/Makefile: -------------------------------------------------------------------------------- 1 | OCAMLMAKEFILE := ../../make/OCamlMakefile 2 | 3 | 4 | RESULT = xmlm 5 | 6 | 7 | SOURCES = xmlm.ml xmlm.mli 8 | 9 | 10 | # PRE_TARGETS = 11 | # LIBS = 12 | # INCDIRS = 13 | # LIBDIRS = 14 | # ANNOTATE = yes 15 | # INCDIRS = +camlp4 16 | # USE_CAMLP4 = yes 17 | # THREADS = yes 18 | 19 | 20 | #OCAMLFLAGS += -verbose 21 | #OCAMLLDFLAGS += -verbose 22 | 23 | 24 | all: bcl ncl 25 | 26 | 27 | install: libinstall 28 | 29 | 30 | uninstall: libuninstall 31 | 32 | 33 | clean:: 34 | 35 | 36 | include $(OCAMLMAKEFILE) 37 | 38 | -------------------------------------------------------------------------------- /utils/bisect.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Thorough cleaning 4 | git clean -f -x -d || exit 125 5 | 6 | # If PINPATH is set, copy pin into the directory. 7 | if [ "x$PINPATH" != "x" ] 8 | then 9 | cp -r $PINPATH . || exit 125 10 | fi 11 | 12 | # Build bap 13 | ./autogen.sh && ./configure && make -j 14 | 15 | # A build error is not considered 'bad' 16 | if [ $? -ne 0 ] 17 | then 18 | exit 125 19 | fi 20 | 21 | #make -j test | grep -v "Trace should be satisfiable but is unsatisfiable" 22 | 23 | make -j test 24 | RESULT=$? 25 | 26 | git clean -f -x -d || exit 125 27 | 28 | exit $RESULT -------------------------------------------------------------------------------- /batteries/examples/euler/euler001.ml: -------------------------------------------------------------------------------- 1 | open Batteries 2 | open Enum 3 | 4 | let say e = e |> map string_of_int |> print ~last:"\n" IO.nwrite stdout 5 | let print_sum e = e |> reduce (+) |> string_of_int |> print_endline 6 | 7 | let top = 999 8 | 9 | let () = 10 | (1 -- top) 11 | |> filter (fun x -> x mod 3 = 0 or x mod 5 = 0) 12 | |> print_sum 13 | 14 | let () = 15 | let mul3 = (1 -- (top / 3)) |> map ( ( * ) 3) 16 | and mul5 = (1 -- (top / 5)) |> map ( ( * ) 5) 17 | in 18 | (* say (clone mul3); 19 | say (clone mul5); *) 20 | merge (<) mul3 mul5 |> uniq |> print_sum 21 | 22 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/src/ocaml/utils/copytrace.ml: -------------------------------------------------------------------------------- 1 | open Trace.Trace_container 2 | open Trace.Frame_piqi_ext 3 | 4 | let copy_all r w = 5 | 6 | while not r#end_of_trace do 7 | w#add r#get_frame 8 | done 9 | 10 | let () = 11 | if Array.length Sys.argv = 3 then 12 | let r = new reader Sys.argv.(1) in 13 | let w = new writer ~arch:r#get_arch ~machine:r#get_machine ~frames_per_toc_entry:(r#get_frames_per_toc_entry) Sys.argv.(2) in 14 | copy_all r w; 15 | w#finish 16 | else 17 | Printf.fprintf stderr "Usage: copytrace \n" 18 | ;; 19 | -------------------------------------------------------------------------------- /ocamlgraph/INSTALL: -------------------------------------------------------------------------------- 1 | 2 | =========================== 3 | How to create the library ? 4 | =========================== 5 | 6 | You need Objective Caml >= 3.10.2 to compile this library. 7 | 8 | Configure with 9 | 10 | ./configure 11 | 12 | Compile with 13 | 14 | make 15 | 16 | Install (as root if needed) with 17 | 18 | make install 19 | 20 | findlib users may also do 21 | 22 | make install-findlib 23 | 24 | ================================= 25 | How to create the documentation ? 26 | ================================= 27 | 28 | create a local documentation with 29 | 30 | make doc 31 | -------------------------------------------------------------------------------- /batteries/examples/euler/euler023.ml: -------------------------------------------------------------------------------- 1 | open Batteries 2 | open List 3 | 4 | let is_abundant n = n < Mathlib.sum_factors n 5 | 6 | let max_sum = if Array.length Sys.argv > 1 7 | then int_of_string Sys.argv.(1) else 28123 8 | 9 | let () = 10 | let x = BitSet.create_full max_sum in 11 | let found = RefList.empty () in 12 | for i = 12 to max_sum do 13 | if is_abundant i then begin 14 | RefList.push found i; 15 | RefList.iter (fun j -> BitSet.unset x (i+j)) found; 16 | end 17 | done; 18 | 19 | BitSet.enum x 20 | |> Enum.reduce (+) |> print_int; 21 | 22 | print_newline () 23 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqirun-ocaml/test.ocaml: -------------------------------------------------------------------------------- 1 | open Test 2 | (* 3 | #trace test_int;; 4 | #trace test_int32;; 5 | #trace test_int64;; 6 | #trace Piqirun.int64_of_varint;; 7 | #trace test_parse_varint;; 8 | #trace Piqirun.next_varint_byte;; 9 | *) 10 | #trace Piqirun.int_to_zigzag_varint;; 11 | #trace Piqirun.parse_varint;; 12 | #trace Piqirun.int_of_varint;; 13 | #trace test_zigzag_int;; 14 | #trace test_zigzag_int32;; 15 | #trace test_zigzag_int64;; 16 | #trace test_parse_zigzag_varint;; 17 | #trace Piqirun.int_of_zigzag_varint;; 18 | #trace Piqirun.zigzag_varint_of_varint;; 19 | test ();; 20 | -------------------------------------------------------------------------------- /batteries/testsuite/test_multipmap.ml: -------------------------------------------------------------------------------- 1 | open OUnit 2 | open BatPervasives 3 | open BatMultiPMap 4 | 5 | let test_multimap_empty_assoc_lists () = 6 | let map = 7 | add 0 "foo" empty |> add 0 "bar" |> add 0 "sna" |> 8 | remove 0 "foo" |> remove 0 "bar" |> remove 0 "sna" 9 | in 10 | if mem 0 map then 11 | assert_failure 12 | (Printf.sprintf "map[0] should be empty but contains %d bindings\n" 13 | (BatSet.PSet.cardinal (find 0 map))) 14 | 15 | let tests = "MultiPMap" >::: [ 16 | "MultiPMap: removing empty association lists" >:: test_multimap_empty_assoc_lists; 17 | ] 18 | -------------------------------------------------------------------------------- /ocamlgraph/editor/tests/fsm.dot: -------------------------------------------------------------------------------- 1 | digraph finite_state_machine { 2 | LR_0 -> LR_2 [ label = "SS(B)" ]; 3 | LR_0 -> LR_1 [ label = "SS(S)" ]; 4 | LR_1 -> LR_3 [ label = "S($end)" ]; 5 | LR_2 -> LR_6 [ label = "SS(b)" ]; 6 | LR_2 -> LR_5 [ label = "SS(a)" ]; 7 | LR_2 -> LR_4 [ label = "S(A)" ]; 8 | LR_5 -> LR_7 [ label = "S(b)" ]; 9 | LR_5 -> LR_5 [ label = "S(a)" ]; 10 | LR_6 -> LR_6 [ label = "S(b)" ]; 11 | LR_6 -> LR_5 [ label = "S(a)" ]; 12 | LR_7 -> LR_8 [ label = "S(b)" ]; 13 | LR_7 -> LR_5 [ label = "S(a)" ]; 14 | LR_8 -> LR_6 [ label = "S(b)" ]; 15 | LR_8 -> LR_5 [ label = "S(a)" ]; 16 | } 17 | -------------------------------------------------------------------------------- /batteries/examples/tools/gunzip.ml: -------------------------------------------------------------------------------- 1 | (* Open a .gz file and decompress it on the spot. 2 | 3 | Usage: 4 | ./gunzip.byte some_file.gz 5 | (produces some_file, removes some_file.gz) 6 | *) 7 | open File, IO, Filename 8 | 9 | iter f (args ()) 10 | where let f name = 11 | if check_suffix name ".gz" then 12 | with_file_in name (fun inp -> 13 | with_file_out (chop_suffix name ".gz") (fun out -> 14 | Gzip.with_in inp (fun inp'-> 15 | copy inp' out; 16 | Sys.remove name))) 17 | else prerr_endline ("I don't know what to do with file "^name) 18 | -------------------------------------------------------------------------------- /batteries/testsuite/test_dynarray.ml: -------------------------------------------------------------------------------- 1 | open Batteries 2 | open OUnit 3 | 4 | module DA = DynArray 5 | 6 | let s1 = DA.of_list [1;2;3] 7 | let s2 = DA.of_list [1;2] 8 | 9 | let asseq_int = assert_equal ~printer:(DA.print Int.print |> IO.to_string) 10 | let asseq_str = assert_equal ~printer:identity 11 | 12 | let test_dynarray_filter () = 13 | let e = BatDynArray.create () in 14 | BatDynArray.add e "a"; 15 | BatDynArray.add e "b"; 16 | BatDynArray.keep ((=) "a") e; 17 | asseq_str (BatDynArray.get e 0) "a" 18 | 19 | 20 | let tests = "Set" >::: [ 21 | "Dynarray_filter" >:: test_dynarray_filter; 22 | ] 23 | -------------------------------------------------------------------------------- /pcre-ocaml/examples/cloc/cloc.ml: -------------------------------------------------------------------------------- 1 | open Pcre 2 | 3 | let read_whole_channel ch = 4 | let size = 4096 in 5 | let strbuf = String.create size 6 | and buf = Buffer.create 65536 7 | and len = ref size in 8 | while !len <> 0 do 9 | len := input ch strbuf 0 size; 10 | Buffer.add_substring buf strbuf 0 !len; done; 11 | Buffer.contents buf 12 | 13 | let _ = 14 | let str = read_whole_channel stdin in 15 | let str = qreplace ~pat:"/\\*(.|\n)*?\\*/" str in 16 | let str = qreplace_first ~pat:"^(\n|\\s)+" str in 17 | let str = qreplace ~pat:"\n+((\n|\\s)\n)*" ~templ:"\n" str in 18 | print_string str 19 | -------------------------------------------------------------------------------- /tests/ast_suite.ml: -------------------------------------------------------------------------------- 1 | open OUnit 2 | 3 | (*let exp_var = Ast.Exp(Var.newvar(reg_32));;*) 4 | 5 | let is_true = Ast.full_exp_eq Ast.exp_true 6 | let is_false = Ast.full_exp_eq Ast.exp_false 7 | 8 | let test_truth_id _ = 9 | let s = "Ast.exp_true does not evaluate to true!" in 10 | assert_bool s (is_true Ast.exp_true);; 11 | 12 | 13 | let test_false_id _ = 14 | let s = "Ast.exp_true does not evaluate to true!" in 15 | assert_bool s (not(is_false Ast.exp_true));; 16 | 17 | 18 | let suite = "Ast" >::: 19 | [ 20 | "test_truth_id" >:: test_truth_id; 21 | "test_false_id" >:: test_false_id; 22 | ] 23 | 24 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/examples/erlang/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: all erlang test erlang_ext test_ex clean 2 | 3 | 4 | all: erlang test erlang_ext test_ext 5 | 6 | 7 | erlang: 8 | $(MAKE) -f Makefile.erlang 9 | 10 | 11 | test: erlang 12 | ./test 13 | 14 | 15 | erlang_ext: 16 | rm -f addressbook_piqi.beam # forcing make to rebuild it 17 | $(MAKE) -f Makefile.erlang_ext 18 | 19 | 20 | test_ext: erlang_ext 21 | ./io_json_xml_pb addressbook.piq.pb 22 | 23 | 24 | clean: 25 | $(MAKE) -f Makefile.erlang clean 26 | rm -f addressbook.piq.pb addressbook.pb.piq l1 l2 27 | $(MAKE) -f Makefile.erlang_ext clean 28 | 29 | -------------------------------------------------------------------------------- /utils/backtaint.ml: -------------------------------------------------------------------------------- 1 | let usage = "Usage: "^Sys.argv.(0)^" \n\ 2 | Backwards taint analysis on traces" 3 | 4 | let speclist = Input.trace_speclist 5 | 6 | let anon x = raise(Arg.Bad("Unexpected argument: '"^x^"'")) 7 | let () = Arg.parse speclist anon usage 8 | 9 | let prog,scope,arch = 10 | try Input.get_program () 11 | with Arg.Bad s -> 12 | Arg.usage speclist (s^"\n"^usage); 13 | exit 1 14 | 15 | 16 | let input_location = Test_common.backwards_taint (Input.get_arch arch) prog;; 17 | 18 | (* Print out the input locations *) 19 | Traces_backtaint.print_locset input_location;; 20 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/examples/ocaml-piq-config/config.piq: -------------------------------------------------------------------------------- 1 | [ 2 | 3 | % the shortest form 4 | [ "foo" .make ] 5 | 6 | % explicit field name 7 | [ .path "foo" .make ] 8 | 9 | % more explicit field names 10 | [ .path "foo" .generator.make ] 11 | 12 | % alternative notation for representing enums (variants) 13 | [ .path "foo" .generator (.make) ] 14 | 15 | % the longest form 16 | [ 17 | .path "foo" 18 | .generator.make 19 | ] 20 | 21 | % testing other enum values 22 | [ "bar" .latexmk ] 23 | [ "fum" .org ] 24 | [ "baz" .tensile ] 25 | ] 26 | -------------------------------------------------------------------------------- /ocamlgraph/editor/tests/test2,1_2.gml: -------------------------------------------------------------------------------- 1 | graph [ 2 | comment "This is a sample graph" 3 | directed 1 4 | id 42 5 | label "Hello, I am a graph" 6 | node [ id 1 label "Node 1" ] 7 | node [ id 2 label "node 2" ] 8 | node [ id 3 label "node 3" ] 9 | node [ id 4 label "node 4" ] 10 | node [ id 5 label "node 5" ] 11 | node [ id 6 label "node 6" ] 12 | edge [ source 1 target 2 ] 13 | edge [ source 1 target 3 ] 14 | edge [ source 1 target 4 ] 15 | edge [ source 1 target 5 ] 16 | edge [ source 1 target 6 ] 17 | edge [ source 2 target 4 ] 18 | edge [ source 5 target 6] 19 | 20 | ] -------------------------------------------------------------------------------- /batteries/examples/euler/euler012.ml: -------------------------------------------------------------------------------- 1 | open Batteries 2 | let num_div x = 3 | let count = ref 1 in (* already counted 1 *) 4 | let max_test = x |> float |> sqrt |> Float.to_int in 5 | for i = 2 to max_test do 6 | if x mod i = 0 then incr count 7 | done; 8 | count := !count * 2; (* every factor < max_test has a corresponding one > *) 9 | if x mod max_test = 0 then decr count; (* dont double count root if x square *) 10 | !count 11 | 12 | let rec loop i n = 13 | let d = num_div n in 14 | if d > 500 then begin 15 | print_int n; print_newline(); exit 0 16 | end else loop (i+1) (n+i+1) 17 | 18 | let () = loop 1 1 19 | -------------------------------------------------------------------------------- /batteries/examples/snippets/netchan_cat.ml: -------------------------------------------------------------------------------- 1 | (* Yet another (slower) "cat" implementation, it is just meant to be a 2 | showcase for integration with ocamlnet's Netchannels. *) 3 | 4 | let oc = 5 | Netchannels.lift_out 6 | (`Rec (new Netchannels.channel_of_output IO.stdout :> 7 | Netchannels.rec_out_channel)) 8 | let _ = 9 | Netchannels.with_in_obj_channel 10 | (Netchannels.lift_in (`Rec (new Netchannels.channel_of_input IO.stdin))) 11 | (fun ic -> 12 | try 13 | while true do 14 | oc # output_string (ic # input_line () ^ "\n"); 15 | oc # flush () 16 | done 17 | with End_of_file -> ()) 18 | 19 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqi-tools/descriptor.ocaml.piqi: -------------------------------------------------------------------------------- 1 | % OCaml-specific extension of descriptor.proto.piqi (which is converted from 2 | % descriptor.proto -- see Makefile for details) 3 | 4 | .include [ .module descriptor ] 5 | 6 | 7 | .extend [ 8 | .field descriptor-proto-extension-range.end 9 | 10 | .with.ocaml-name "p_end" 11 | ] 12 | 13 | 14 | .extend [ 15 | .field field-descriptor-proto.type 16 | 17 | .with.ocaml-name "p_type" 18 | ] 19 | 20 | 21 | .extend [ 22 | .field service-descriptor-proto.method 23 | 24 | .with.ocaml-name "p_method" 25 | ] 26 | 27 | 28 | .custom-field ocaml-name 29 | 30 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/erlang_perf/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: all erlang test clean 2 | 3 | 4 | all: erlang test 5 | 6 | 7 | erlang: piqi_obj.piqi 8 | $(MAKE) -f Makefile.erlang 9 | 10 | 11 | piqi_obj.piqi: ../../piqi/piqi.piqi 12 | piqi expand $< >$@ 13 | 14 | 15 | test: erlang 16 | piqi convert -t pb addressbook.piq 17 | 18 | echo ":piqi_obj/piqi [" > piqi.piq 19 | cat piqi_obj.piqi >> piqi.piq 20 | echo "]" >> piqi.piq 21 | 22 | piqi convert --add-defaults -t pb --no-warnings piqi.piq 23 | #./test 24 | 25 | 26 | clean: 27 | $(MAKE) -f Makefile.erlang clean 28 | rm -f addressbook.piq.pb piqi.* piqi_obj.* 29 | 30 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqic/.gitignore: -------------------------------------------------------------------------------- 1 | piqic 2 | /piqi_lang_piqi.* 3 | piqobj.ml 4 | piqi_version.ml 5 | 6 | piqi_c_impl.c 7 | piqi_main.ml 8 | piqi.ml 9 | piqi_pp.ml 10 | piq_parser.ml 11 | piqi_graph.ml 12 | piqi_common.ml 13 | piqobj_to_piq.ml 14 | piqi_c.mli 15 | piqi_util.ml 16 | piqi_name.ml 17 | piqi_file.ml 18 | piqobj_common.ml 19 | piqobj_of_protobuf.ml 20 | piqloc.ml 21 | piq_lexer.ml 22 | piqi_config.ml 23 | piq_gen.ml 24 | piqobj_to_protobuf.ml 25 | piqi_iolist.ml 26 | piqi_protobuf.ml 27 | piqobj_of_piq.ml 28 | piqi_db.ml 29 | piqi_c.ml 30 | piq_ast.ml 31 | piqi_objstore.ml 32 | piqi_json_type.mli 33 | piqi_xml_type.mli 34 | -------------------------------------------------------------------------------- /doc/chap-tools/add2.il: -------------------------------------------------------------------------------- 1 | addr 0x0 @asm "add $0x2,%eax" 2 | label pc_0x0 3 | T_t1:u32 = R_EAX_32:u32 4 | T_t2:u32 = 2:u32 5 | R_EAX_32:u32 = R_EAX_32:u32 + T_t2:u32 6 | R_CF:bool = R_EAX_32:u32 < T_t1:u32 7 | R_OF:bool = high:bool((T_t1:u32 ^ ~T_t2:u32) & (T_t1:u32 ^ R_EAX_32:u32)) 8 | R_AF:bool = 0x10:u32 == (0x10:u32 & (R_EAX_32:u32 ^ T_t1:u32 ^ T_t2:u32)) 9 | R_PF:bool = 10 | ~low:bool(let T_acc:u32 := R_EAX_32:u32 >> 4:u32 ^ R_EAX_32:u32 in 11 | let T_acc:u32 := T_acc:u32 >> 2:u32 ^ T_acc:u32 in 12 | T_acc:u32 >> 1:u32 ^ T_acc:u32) 13 | R_SF:bool = high:bool(R_EAX_32:u32) 14 | R_ZF:bool = 0:u32 == R_EAX_32:u32 15 | 16 | 17 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/piqi_proto1/ea.piqi: -------------------------------------------------------------------------------- 1 | % testing enums and aliases imports and functino paraemters -- also see ea1.piqi 2 | 3 | .protobuf-package "t" 4 | 5 | .alias [ 6 | .name s 7 | .type string 8 | ] 9 | 10 | 11 | .enum [ 12 | .name e 13 | .option [ a ] 14 | ] 15 | 16 | .alias [ 17 | .name ea 18 | .type e 19 | ] 20 | 21 | .record [ 22 | .name r 23 | .field [ .name e .type e ] 24 | ] 25 | 26 | 27 | .alias [ 28 | .name ra 29 | .type r 30 | ] 31 | 32 | 33 | .function [ 34 | .name f 35 | .input e 36 | ] 37 | 38 | 39 | .function [ 40 | .name g 41 | .input ea 42 | ] 43 | 44 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqi-rpc/piqic-erlang-rpc/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.config 2 | 3 | PIQIC_PLUGIN = piqic-erlang-rpc 4 | 5 | 6 | PIQIC_PLUGIN_BEAMS = \ 7 | $(PIQI_ROOT)/piqi-erlang/ebin/piqi.beam \ 8 | $(PIQI_ROOT)/piqi-erlang/ebin/piqirun.beam \ 9 | $(PIQI_ROOT)/piqi-erlang/ebin/piqi_piqi.beam \ 10 | $(PIQI_ROOT)/piqi-erlang/ebin/piqic_erlang_ext.beam \ 11 | ../ebin/piqic_erlang_rpc.beam 12 | 13 | 14 | all: $(PIQIC_PLUGIN) 15 | 16 | 17 | $(PIQIC_PLUGIN): $(PIQIC_PLUGIN_BEAMS) 18 | $(PIQI_ROOT)/make/make_escript $@ $(PIQIC_PLUGIN_BEAMS) 19 | chmod +x $@ 20 | 21 | 22 | clean:: 23 | rm -f $(PIQIC_PLUGIN) 24 | 25 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/deps/ulex-1.1/utf8_test.ml: -------------------------------------------------------------------------------- 1 | #load "utf8.cmo";; 2 | 3 | let () = 4 | let b = Buffer.create 10 in 5 | for i = 0 to 0x10ffff do 6 | if (i >= 0xd800) && (i <= 0xdfff) then () 7 | else ( 8 | (try Utf8.store b i with Utf8.MalFormed -> 9 | Printf.eprintf "Conversion failure %x\n" i; exit 1); 10 | let s = Buffer.contents b in 11 | Buffer.clear b; 12 | let j = 13 | try Utf8.next s 0 with Utf8.MalFormed -> 14 | Printf.eprintf "Deconversion failure %x (%S)\n" i s; exit 1 in 15 | if (i != j) then 16 | (Printf.eprintf "Conversion/deconversion error. %x->%x\n" i j; exit 1) 17 | ) 18 | done 19 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/examples/complex.piqi: -------------------------------------------------------------------------------- 1 | 2 | % a handy type abbreviation 3 | .alias [ 4 | .name t 5 | .type complex 6 | ] 7 | 8 | 9 | % complex number 10 | .record [ 11 | .name complex 12 | 13 | .field [ .name re .type float ] 14 | .field [ .name im .type float ] 15 | ] 16 | 17 | 18 | % some record which uses "complex" type 19 | .record [ 20 | .name foo 21 | .field [ 22 | .name bar 23 | .type t 24 | .optional 25 | 26 | % piqi supports structured defaults for optional fields: 27 | .default [.re 1 .im 0] % NOTE: it is possible to skip names and use [1 0] 28 | ] 29 | ] 30 | 31 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/examples/ocaml/addressbook.ocaml.piqi: -------------------------------------------------------------------------------- 1 | % This is an extension for addressbook.proto.piqi module. 2 | % 3 | % This file will be automatically included by "piqic ocaml" when it loads 4 | % addressbook.proto.piqi 5 | % 6 | % After converting addressbook.proto to addressbook.proto.piqi, we need to add 7 | % "ocaml-name" property for field "type" in "person-phone-name" record. This is 8 | % necessary because "type" is a keyword in OCaml. 9 | 10 | .include [ .module addressbook ] 11 | 12 | 13 | .extend [ 14 | .field person-phone-number.type 15 | 16 | .with.ocaml-name "phone_type" 17 | ] 18 | 19 | 20 | .custom-field ocaml-name 21 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqi/piqi.getopt.piqi: -------------------------------------------------------------------------------- 1 | % Piqi extensions for getopt 2 | % 3 | % This file defines extensions to the base Piqi self-specification for 4 | % command-line arguement parsing. 5 | % 6 | % 7 | % Copyright 2009, 2010, 2011, 2012, 2013 Anton Lavrik 8 | 9 | 10 | .include [ .module piqi ] 11 | 12 | 13 | % a single-letter getopt option or flag 14 | .extend [ 15 | (.typedef field option) 16 | 17 | .with.field [ 18 | .name getopt-letter 19 | .type word 20 | .optional 21 | ] 22 | 23 | .with.field [ 24 | .name getopt-doc 25 | .type string 26 | .optional 27 | ] 28 | ] 29 | 30 | -------------------------------------------------------------------------------- /ocaml-proj.example/deployproj.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Deploy sample project specific directories to the directory 3 | # containing BAP 4 | 5 | set -e 6 | 7 | BAPDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd ".." && pwd )" 8 | TARGETDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd "../.." && pwd )" 9 | SCRIPT="$( basename "${BASH_SOURCE[0]}" )" 10 | 11 | function copy { 12 | cp -r $BAPDIR/$1.example $TARGETDIR/$1 13 | } 14 | 15 | copy ocaml-proj 16 | copy utils-proj 17 | copy tests-proj 18 | 19 | # Remove script in ocaml-proj to avoid confusion! 20 | 21 | rm $TARGETDIR/ocaml-proj/$SCRIPT 22 | 23 | echo "Project directories deployed to $TARGETDIR" 24 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/examples/erlang-custom-types/example.piqi: -------------------------------------------------------------------------------- 1 | % 2 | % defining custom Erlang types to be serialized as some Piqi types 3 | % 4 | 5 | .alias [ 6 | .name erlang-bigint 7 | .type string 8 | .erlang-type "piqirun_custom:bigint" 9 | ] 10 | 11 | 12 | .alias [ 13 | .name erlang-term 14 | .type binary 15 | .erlang-type "piqirun_custom:term_t" 16 | ] 17 | 18 | 19 | % a record that uses the above definitions 20 | .record [ 21 | .name r 22 | 23 | .field [ 24 | .name bi 25 | .type erlang-bigint 26 | ] 27 | 28 | .field [ 29 | .name term 30 | .type erlang-term 31 | ] 32 | ] 33 | 34 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/deps/easy-format-1.0.0/README: -------------------------------------------------------------------------------- 1 | +------------------------------------+ 2 | | Easy_format: indentation made easy | 3 | +------------------------------------+ 4 | 5 | 6 | 1. Documentation: http://martin.jambon.free.fr/easy-format.html 7 | 8 | 2. Installation: 9 | 10 | Installation requires ocamlfind: 11 | 12 | make 13 | make install 14 | 15 | Uninstallation: 16 | 17 | make uninstall 18 | 19 | 20 | 3. Examples 21 | 22 | Some examples can be run with 'make test' before installing. 23 | 24 | More examples that require Easy-format to be installed and possibly 25 | dependencies on other packages can be found in the examples/ subdirectory. 26 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/ocaml_piqi/Makefile.ocaml: -------------------------------------------------------------------------------- 1 | include $(PIQI_ROOT)/make/Makefile.ocaml 2 | 3 | RESULT = otest 4 | 5 | 6 | SOURCES = $(PIQI_ML_SOURCES) test.ml 7 | PIQI_ML_SOURCES = piqi_piqi.ml piqobj_piqi.ml 8 | 9 | 10 | PRE_TARGETS = $(PIQI_ML_SOURCES) 11 | 12 | 13 | PIQIC_FLAGS = --pp --gen-defaults 14 | 15 | 16 | PACKS = piqi.runtime 17 | 18 | # LIBS = piqirun 19 | # LIBDIRS = $(PIQI_ROOT)/piqirun-ocaml 20 | # INCDIRS = $(PIQI_ROOT)/piqirun-ocaml 21 | 22 | 23 | all: bc #top 24 | 25 | 26 | $(PIQI_ML_SOURCES): *.piqi 27 | piqic ocaml $(PIQIC_FLAGS) piqi.piqi 28 | piqic ocaml $(PIQIC_FLAGS) piqobj.piqi 29 | 30 | 31 | include $(OCAMLMAKEFILE) 32 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/src/cpp/utils/Makefile.am: -------------------------------------------------------------------------------- 1 | AUTOMAKE_OPTIONS = subdir-objects 2 | AM_CPPFLAGS = -I../pb -I.. -I@LIBTRACE_DIR@/src/common -I@LIBTRACE_DIR@/protobuf/src 3 | # We need protobuf as a 64 bit library to use gentrace as a 64 bit pintool. 4 | # AM_CXXFLAGS += -m32 5 | 6 | utils_LDADD = ../libtrace.a @LIBTRACE_DIR@/protobuf/src/.libs/libprotobuf.a -lpthread 7 | 8 | bin_PROGRAMS = readtrace copytrace 9 | readtrace_SOURCES = readtrace.cpp 10 | readtrace_LDADD = $(utils_LDADD) 11 | copytrace_SOURCES = copytrace.cpp 12 | copytrace_LDADD = $(utils_LDADD) 13 | 14 | # Don't auto-link LIBS coming from autoconf, because we might not have 15 | # 32-bit equivalents! 16 | LIBS = 17 | -------------------------------------------------------------------------------- /ounit/README.txt: -------------------------------------------------------------------------------- 1 | (* OASIS_START *) 2 | (* DO NOT EDIT (digest: ac260da3dc5dbc8b63343daec02e41ac) *) 3 | This is the README file for the ounit distribution. 4 | 5 | (C) 2002-2008 Maas-Maarten Zeeman 6 | 7 | (C) 2010 OCamlCore SARL 8 | 9 | Unit testing framework 10 | 11 | OUnit is a unit testing framework for OCaml, inspired by the JUnit tool for 12 | Java, and the HUnit tool for Haskell. 13 | 14 | More information on [HUnit](http://hunit.sourceforge.net) 15 | 16 | See the files INSTALL.txt for building and installation instructions. See the 17 | file LICENSE.txt for copying conditions. 18 | 19 | Home page: http://ounit.forge.ocamlcore.org 20 | 21 | 22 | (* OASIS_STOP *) 23 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/cpp/test.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | #include "piqi.piqi.pb.h" 10 | 11 | 12 | using namespace std; 13 | using namespace google::protobuf; 14 | 15 | 16 | int main(int argc, char *argv[]) 17 | { 18 | int fd = open("piqi.piqi.pb", O_RDONLY); 19 | 20 | ::piqi_org::piqi::piqi piqi; 21 | piqi.ParseFromFileDescriptor(fd); 22 | 23 | string s; 24 | TextFormat::PrintToString(piqi, &s); 25 | 26 | cout << s; //<< endl; 27 | 28 | close(fd); 29 | return 0; 30 | } 31 | 32 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/erlang_packed/Makefile: -------------------------------------------------------------------------------- 1 | 2 | all: 3 | cat ../piqi_packed/packed.piqi | sed -e 's/\.protobuf-packed//' > unpacked.piqi 4 | cat ../piqi_packed/test-all.piq | sed -e 's/:packed/:unpacked/' > test-all-unpacked.piq 5 | 6 | $(MAKE) -f Makefile.erlang 7 | 8 | piqi convert -t pb test-all.piq 9 | ./test 10 | cmp test-all.piq.pb test-all.piq.pb.pb 11 | 12 | cp test-all.piq.pb test-all.piq.pb.orig 13 | piqi convert -t pb -o test-all.piq.pb test-all-unpacked.piq 14 | ./test 15 | cmp test-all.piq.pb.orig test-all.piq.pb.pb 16 | 17 | 18 | clean: 19 | $(MAKE) -f Makefile.erlang clean 20 | rm -f test-all.piq.* unpacked.piqi test-all-unpacked.piq 21 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/erlang_perf/README: -------------------------------------------------------------------------------- 1 | Performance tests for serialization and de-serialization of Erlang data 2 | structures to/from Protocol Buffers, JSON, XML and Piq data formats. 3 | 4 | The tests are performed on two different objects. The first one is a relatively 5 | small and not very complicated "addressbook.piq". The second one is the expanded 6 | Piqi self-specification which is 10 times as large as the first one and has more 7 | complex structure. 8 | 9 | To run the tests: 10 | 11 | make 12 | 13 | ./test 14 | 15 | 16 | , where is the number of Erlang processes performing the work 17 | in parallel. 18 | 19 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/piqi_packed/packed-nocompat.piqi: -------------------------------------------------------------------------------- 1 | % This module contains "ee" alias which is not compatible with Protocol Buffers. 2 | % 3 | % When mapped to Protobuf, another "ee" enum definition is generated with the 4 | % same enum elements, which is not allowed in Protobuf. 5 | 6 | .include [ .module packed ] 7 | 8 | .alias [ 9 | .name ee 10 | .type e 11 | ] 12 | 13 | 14 | .extend [ 15 | .typedef r-all 16 | 17 | .with.field [ 18 | .name ee 19 | .type ee 20 | .repeated 21 | .protobuf-packed 22 | ] 23 | ] 24 | 25 | 26 | .list [ 27 | .name ee-list 28 | .type ee 29 | .protobuf-packed 30 | ] 31 | 32 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/protobuf/gtest/xcode/Config/FrameworkTarget.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // FrameworkTarget.xcconfig 3 | // 4 | // These are Framework target settings for the gtest framework and examples. It 5 | // is set in the "Based On:" dropdown in the "Target" info dialog. 6 | // This file is based on the Xcode Configuration files in: 7 | // http://code.google.com/p/google-toolbox-for-mac/ 8 | // 9 | 10 | // Dynamic libs need to be position independent 11 | GCC_DYNAMIC_NO_PIC = NO 12 | 13 | // Dynamic libs should not have their external symbols stripped. 14 | STRIP_STYLE = non-global 15 | 16 | // Let the user install by specifying the $DSTROOT with xcodebuild 17 | SKIP_INSTALL = NO 18 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/examples/piq-text.piq: -------------------------------------------------------------------------------- 1 | (:piq-format/text) 2 | 3 | % text literal are separated between subsequent text literals either by some 4 | % other lexical element or by empty vertical space 5 | 6 | # single-line verbatim text 7 | 8 | # multi-line verbatim test 9 | # here's another line 10 | # 11 | # and another one 12 | # 13 | 14 | % 15 | % whitespace before '#' character is discarded 16 | % 17 | 18 | # one more line of text 19 | 20 | # 21 | # that's it 22 | 23 | 24 | % 25 | % verbatim text literals can also be used for representing string values 26 | % 27 | 28 | :string # text line 29 | 30 | :string 31 | # text multi 32 | # line 33 | 34 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqi-erlang/src/piqi.app.src: -------------------------------------------------------------------------------- 1 | {application, piqi, 2 | [{description, "Piqi Library"}, 3 | {vsn, git}, 4 | {modules, [ 5 | piqirun, piqirun_ext, 6 | piqi, piqi_app, piqi_sup, 7 | piqi_tools, 8 | piqi_piqi, piqi_rpc_piqi, piqi_tools_piqi, 9 | piqic_erlang_ext, 10 | piqirun_tests 11 | ]}, 12 | {registered, [piqi_tools, piqi_sup]}, 13 | {applications, [kernel, stdlib]}, 14 | {mod, {piqi_app, []}}, 15 | {env, [ 16 | 17 | % The number of "piqi server" instances that perform "convert" and other 18 | % Piqi tools requests 19 | {worker_pool_size, 1} 20 | 21 | ]} 22 | ]}. 23 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/boot_proto2piqi/Makefile: -------------------------------------------------------------------------------- 1 | 2 | RESULT = proto2piqi 3 | TEST = descriptor.piqi 4 | 5 | CXXFLAGS += -I. 6 | 7 | 8 | all: $(RESULT) test 9 | 10 | 11 | $(RESULT): proto2piqi.cc main.cc 12 | $(CXX) $(CXXFLAGS) -o $@ $^ -lprotobuf -lprotoc -lpthread 13 | 14 | 15 | .PHONY: clean test 16 | 17 | 18 | clean: 19 | rm -f *.o $(RESULT) 20 | rm -f *.pb* 21 | rm -f *.piqi* 22 | 23 | 24 | test: $(TEST) 25 | 26 | 27 | $(TEST): descriptor.proto $(RESULT) 28 | ./proto2piqi $< | sed -e 's/_/-/g' > $@.tmp.piqi 29 | piqi check $@.tmp.piqi 30 | piqi pp -o $@ --normalize-words $@.tmp.piqi 31 | 32 | 33 | # protoc -odescriptor.pb google/protobuf/descriptor.proto 34 | 35 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/piqi_misc/Makefile: -------------------------------------------------------------------------------- 1 | 2 | 3 | PIQI_FILES = \ 4 | piqast.piqi \ 5 | piqobj.piqi \ 6 | piqtype-core.piqi 7 | 8 | 9 | test: test_piqi test_piqtype_core 10 | 11 | 12 | test_piqi: 13 | set -e; \ 14 | for i in $(PIQI_FILES:%.piqi=%); \ 15 | do \ 16 | ../examples/test_piqi $$i --no-warnings >/dev/null; \ 17 | done 18 | 19 | 20 | # test that piqtype-core.piqi can parse itself 21 | test_piqtype_core: 22 | cat piqtype-core.piqi | sed -e 's!\.module.*!(:piqtype-core/typedef)!;s!.piq-format.word!!' >piqtype-core.piq 23 | piqi check piqtype-core.piq 24 | 25 | 26 | clean: 27 | rm -f p.piqi pp.piqi p.piqi.text *.proto *.pib *.pb *.json *.xml piqtype-core.piq 28 | 29 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqi-rpc/examples/addressbook/addressbook.piqi: -------------------------------------------------------------------------------- 1 | .import [ .module person ] 2 | 3 | 4 | .erlang-type-prefix "" 5 | 6 | 7 | .function [ 8 | .name add-person 9 | 10 | .input person/person 11 | 12 | .error string 13 | ] 14 | 15 | 16 | .function [ 17 | .name get-person 18 | 19 | .input [ 20 | .field [ 21 | .name id 22 | .type int 23 | ] 24 | ] 25 | 26 | .output person/person 27 | 28 | .error string 29 | ] 30 | 31 | 32 | .function [ 33 | .name list-people 34 | 35 | .output addressbook 36 | ] 37 | 38 | 39 | .list [ 40 | .name addressbook 41 | .type person/person 42 | ] 43 | 44 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi-files/modloadframe.piqi: -------------------------------------------------------------------------------- 1 | .include [ 2 | .module types 3 | ] 4 | 5 | % Represent an executable module being loaded 6 | .record [ 7 | .name modload-frame 8 | 9 | .field [ 10 | .name module-name 11 | .type string 12 | .code 1 13 | ] 14 | 15 | % The lowest address in this module 16 | .field [ 17 | .name low-address 18 | .type address 19 | .code 2 20 | ] 21 | 22 | % The highest address in this module 23 | .field [ 24 | .name high-address 25 | .type address 26 | .code 3 27 | ] 28 | ] -------------------------------------------------------------------------------- /batteries/examples/benchmark/run_tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ocamlbuild t_list.byte 4 | 5 | TESTS="nth map mapx folr folrx map2" 6 | for a in byte 7 | do 8 | for b in $TESTS 9 | do 10 | # echo -n ${b}_g.$a, 11 | ./t_list.$a -s 200 ${b}_g | tee data/${b}_gallium.$a 12 | # echo -n ${b}_e.$a, 13 | ./t_list.$a -s 200 ${b}_e | tee data/${b}_extlib.$a 14 | done 15 | done 16 | 17 | cd data 18 | 19 | for a in byte 20 | do 21 | for b in $TESTS 22 | do 23 | G_PRE="set logscale x; set logscale y; set terminal png; set xlabel \"List Length\"; set ylabel \"actions per second\";" 24 | echo "$G_PRE set output \"$b.$a.png\"; plot \"${b}_extlib.$a\" w lp, \"${b}_gallium.$a\" w lp" | gnuplot 25 | done 26 | done -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/examples/ocaml-piq-config/config.ml: -------------------------------------------------------------------------------- 1 | 2 | let read_file filename = 3 | let ch = open_in_bin filename in 4 | let len = in_channel_length ch in 5 | let buf = Buffer.create len in 6 | Buffer.add_channel buf ch len; 7 | close_in ch; 8 | Buffer.contents buf 9 | 10 | 11 | let read_config filename = 12 | let contents = read_file filename in 13 | try 14 | Config_piqi_ext.parse_config contents `piq 15 | with 16 | Piqi_common.Error ((file, col, line), error) -> 17 | failwith (Printf.sprintf "error at %s:%d:%d: %s" file col line error) 18 | 19 | 20 | (* test *) 21 | let _ = 22 | let config = read_config "config.piq" in 23 | Config_piqi_ext.print_config config 24 | 25 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqi-erlang/src/piqi.piqi: -------------------------------------------------------------------------------- 1 | 2 | .include [ .module piqic/piqi.erlang ] 3 | .include [ .module piqic/piqi.erlang-extensions ] 4 | 5 | 6 | % remove the "piqi" prefix from generated Erlang type and record names 7 | .erlang-type-prefix "" 8 | 9 | 10 | % now, with prefix being removed, we need to define custom Erlang names for some 11 | % types 12 | .extend [ 13 | .typedef function 14 | .with.erlang-name "func" 15 | ] 16 | 17 | 18 | .extend [ 19 | .typedef any 20 | .with.erlang-name "piqi_any" 21 | ] 22 | 23 | 24 | .extend [ 25 | .typedef piqi-any 26 | 27 | % piqi_any is already taken by "any" (#piqi_any{}) itself 28 | .with.erlang-name "piqi_piqi_any" 29 | ] 30 | 31 | -------------------------------------------------------------------------------- /ocaml/ast_mapper.ml: -------------------------------------------------------------------------------- 1 | (* Apply a mapping to all expressions in a program. 2 | 3 | @author Thanassis 4 | *) 5 | 6 | open Ast 7 | open Ast_visitor 8 | 9 | class type map = object 10 | method exp : exp -> exp 11 | method stmt : stmt -> stmt 12 | method prog : program -> program 13 | method cfg : Cfg.AST.G.t -> Cfg.AST.G.t 14 | end 15 | 16 | let map_e f = 17 | let visitor = object(self) 18 | inherit nop 19 | method visit_exp = f 20 | end 21 | in 22 | let mapper = 23 | object(self) 24 | method exp = exp_accept visitor 25 | method stmt = stmt_accept visitor 26 | method prog = prog_accept visitor 27 | method cfg = cfg_accept visitor 28 | end 29 | in 30 | (mapper :> map) 31 | -------------------------------------------------------------------------------- /ocaml/ssa_cond_simplify.mli: -------------------------------------------------------------------------------- 1 | (** Simplify predicates so that VSA and other abstract interpretations 2 | can use them. *) 3 | 4 | (** Simplify conditions used in edge labels *) 5 | val simplifycond_ssa : Cfg.SSA.G.t -> Cfg.SSA.G.t 6 | 7 | (** Simplify conditions used in edge labels. This version is for 8 | resolving the target expressions passed as arguments. It does so 9 | by never copy propagating beyond one of the variables used in any 10 | of the target expressions. This should ensure that the simplified 11 | conditions are "in terms of" variables in the target expression. 12 | This is important for VSA cfg recovery. *) 13 | val simplifycond_targets_ssa : Ssa.exp list -> Cfg.SSA.G.t -> Cfg.SSA.G.t 14 | -------------------------------------------------------------------------------- /batteries/examples/README: -------------------------------------------------------------------------------- 1 | A few examples of short programs written using OCaml Batteries Included. 2 | 3 | Directory tools/ contains small tools. 4 | Directory snippets/ contains random code extracts. 5 | Directory euler/ contains solution programs to varous eulerproject.com puzzles 6 | Directory pleac/ contains the start of a PLEAC for batteries 7 | 8 | To build all these programs, install batteries and run 9 | 10 | make 11 | 12 | from each directory. If this doesn't work, steal the makefile, _tags 13 | and myocamlbuild from another example directory, make them work for 14 | the files in the new directory and send us the patch. :) Extra points 15 | for implementing a toplevel `make examples` that makes the examples. 16 | 17 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/examples/erlang-custom-types/Makefile: -------------------------------------------------------------------------------- 1 | 2 | ERL_SOURCES = \ 3 | piqirun_custom.erl \ 4 | $(PIQI_ERL_FILES) \ 5 | 6 | 7 | ERL_APP_PATH = $(PIQI_ROOT)/piqi-erlang 8 | ERLC_FLAGS = 9 | EBIN_DIR = . 10 | 11 | 12 | PIQIC = piqic erlang 13 | PIQIC_FLAGS = --gen-defaults 14 | 15 | 16 | PIQI_FILES = example.piqi 17 | 18 | PIQI_ERL_FILES = example_piqi.erl 19 | PIQI_HRL_FILES = example_piqi.hrl 20 | 21 | 22 | PRE_TARGET = $(PIQI_ERL_FILES) $(PIQI_HRL_FILES) 23 | 24 | 25 | all: ebin 26 | 27 | 28 | $(PIQI_ERL_FILES) $(PIQI_HRL_FILES): $(PIQI_FILES) 29 | set -e; \ 30 | for i in $^; do \ 31 | $(PIQIC) $(PIQIC_FLAGS) $$i; \ 32 | done 33 | 34 | 35 | include $(PIQI_ROOT)/make/Makefile.erlang 36 | 37 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/protobuf/gtest/xcode/Config/StaticLibraryTarget.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // StaticLibraryTarget.xcconfig 3 | // 4 | // These are static library target settings for libgtest.a. It 5 | // is set in the "Based On:" dropdown in the "Target" info dialog. 6 | // This file is based on the Xcode Configuration files in: 7 | // http://code.google.com/p/google-toolbox-for-mac/ 8 | // 9 | 10 | // Static libs can be included in bundles so make them position independent 11 | GCC_DYNAMIC_NO_PIC = NO 12 | 13 | // Static libs should not have their internal globals or external symbols 14 | // stripped. 15 | STRIP_STYLE = debugging 16 | 17 | // Let the user install by specifying the $DSTROOT with xcodebuild 18 | SKIP_INSTALL = NO 19 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/examples/ocaml/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: all ocaml test ocaml_ext test_ext clean 2 | 3 | 4 | all: ocaml test ocaml_ext test_ext 5 | 6 | 7 | ocaml: 8 | GOAL=add_person $(MAKE) -f Makefile.ocaml 9 | GOAL=list_people $(MAKE) -f Makefile.ocaml 10 | 11 | 12 | test: 13 | ./test 14 | 15 | 16 | ocaml_ext: 17 | rm -f addressbook_piqi.cm? # forcing make to rebuild it 18 | $(MAKE) -f Makefile.ocaml_ext 19 | 20 | 21 | test_ext: ocaml_ext 22 | ./io_json_xml_pb addressbook.piq.pb 23 | 24 | 25 | clean: 26 | GOAL=add_person $(MAKE) -f Makefile.ocaml clean 27 | GOAL=list_people $(MAKE) -f Makefile.ocaml clean 28 | rm -f addressbook.piq.pb addressbook.pb.piq l1 l2 29 | $(MAKE) -f Makefile.ocaml_ext clean 30 | 31 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/erlang_import/Makefile: -------------------------------------------------------------------------------- 1 | 2 | ERL_SOURCES = \ 3 | $(PIQI_ERL_FILES) \ 4 | 5 | 6 | ERL_APP_PATH = $(PIQI_ROOT)/piqi-erlang 7 | ERLC_FLAGS = 8 | EBIN_DIR = . 9 | 10 | 11 | PIQIC = piqic erlang 12 | #PIQIC_FLAGS = --gen-defaults 13 | 14 | 15 | PIQI_FILES = first.piqi second.piqi 16 | 17 | PIQI_ERL_FILES = first_piqi.erl second_piqi.erl 18 | PIQI_HRL_FILES = first_piqi.hrl second_piqi.hrl 19 | 20 | 21 | PRE_TARGET = $(PIQI_ERL_FILES) $(PIQI_HRL_FILES) 22 | 23 | 24 | all: ebin 25 | 26 | 27 | $(PIQI_ERL_FILES) $(PIQI_HRL_FILES): $(PIQI_FILES) 28 | set -e; \ 29 | for i in $^; do \ 30 | $(PIQIC) $(PIQIC_FLAGS) $$i; \ 31 | done 32 | 33 | 34 | include $(PIQI_ROOT)/make/Makefile.erlang 35 | 36 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/ocaml_perf/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: all ocaml test clean 2 | 3 | 4 | all: ocaml test 5 | 6 | 7 | ocaml: piqi-obj.piqi 8 | $(MAKE) -f Makefile.ocaml 9 | 10 | 11 | piqi-obj.piqi: ../../piqi/piqi.piqi 12 | ln -sf ../../piqic/piqi.ocaml.piqi 13 | piqi expand -e ocaml piqi.piqi > $@ 14 | 15 | 16 | test: ocaml 17 | piqi convert -t pb addressbook.piq 18 | 19 | echo ":piqi-obj/piqi [" > piqi.piq 20 | cat piqi-obj.piqi >> piqi.piq 21 | echo "]" >> piqi.piq 22 | 23 | piqi convert --no-warnings --add-defaults -t pb piqi.piq 24 | #./test 25 | 26 | 27 | clean: 28 | $(MAKE) -f Makefile.ocaml clean 29 | rm -f addressbook.piq.pb piqi-expanded.piqi piqi-obj.* piqi.ocaml.piqi piqi.piq piqi.piq.pb 30 | 31 | -------------------------------------------------------------------------------- /ocamlgraph/editor/tests/test2,1_3.gml: -------------------------------------------------------------------------------- 1 | graph [ 2 | comment "This is a sample graph" 3 | directed 1 4 | id 42 5 | label "Hello, I am a graph" 6 | node [ id 1 label "Node 1" ] 7 | node [ id 2 label "node 2" ] 8 | node [ id 3 label "node 3" ] 9 | node [ id 4 label "node 4" ] 10 | node [ id 5 label "node 5" ] 11 | node [ id 6 label "node 6" ] 12 | node [ id 7 label "node 7" ] 13 | edge [ source 1 target 2 ] 14 | edge [ source 1 target 3 ] 15 | edge [ source 1 target 4 ] 16 | edge [ source 1 target 6 ] 17 | edge [ source 1 target 5 ] 18 | edge [ source 1 target 7 ] 19 | edge [ source 2 target 4 ] 20 | edge [ source 6 target 5 ] 21 | edge [ source 5 target 7 ] 22 | 23 | ] -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqic/piqi-lang.ocaml.piqi: -------------------------------------------------------------------------------- 1 | 2 | .include [ .module piqi/piqi-lang ] 3 | 4 | 5 | .extend [ 6 | .option function-param.list 7 | 8 | .with.ocaml-name "list" 9 | ] 10 | 11 | .extend [ 12 | .typedef include 13 | 14 | .with.ocaml-name "includ" 15 | ] 16 | 17 | .extend [ 18 | .field include.module 19 | 20 | .with.ocaml-name "modname" 21 | ] 22 | 23 | .extend [ 24 | .field extend.with 25 | 26 | .with.ocaml-name "piqi_with" 27 | ] 28 | 29 | .extend [ 30 | .field extend.piqi-any 31 | 32 | .with.ocaml-name "quote" 33 | ] 34 | 35 | .extend [ 36 | .option extend-target.function 37 | 38 | .with.ocaml-name "func" 39 | ] 40 | 41 | 42 | .custom-field ocaml-name 43 | 44 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/erlang_misc/Makefile: -------------------------------------------------------------------------------- 1 | 2 | ERL_SOURCES = \ 3 | $(PIQI_ERL_FILES) \ 4 | 5 | 6 | ERL_APP_PATH = $(PIQI_ROOT)/piqi-erlang 7 | ERLC_FLAGS = 8 | EBIN_DIR = . 9 | 10 | 11 | PIQIC = piqic erlang 12 | PIQIC_FLAGS = --gen-defaults 13 | 14 | 15 | PIQI_FILES = empty-record.piqi 16 | 17 | 18 | PIQI_ERL_FILES = empty_record_piqi.erl 19 | PIQI_HRL_FILES = empty_record_piqi.hrl 20 | 21 | PIQI_ERLANG_FILES = $(PIQI_ERL_FILES) $(PIQI_HRL_FILES) 22 | 23 | 24 | PRE_TARGET = $(PIQI_ERLANG_FILES) 25 | 26 | 27 | all: ebin 28 | 29 | 30 | $(PIQI_ERLANG_FILES): $(PIQI_FILES) 31 | set -e; \ 32 | for i in $^; do \ 33 | $(PIQIC) $(PIQIC_FLAGS) $$i; \ 34 | done 35 | 36 | 37 | include $(PIQI_ROOT)/make/Makefile.erlang 38 | 39 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/ocaml_array/Makefile.ocaml: -------------------------------------------------------------------------------- 1 | include $(PIQI_ROOT)/make/Makefile.ocaml 2 | 3 | RESULT = test 4 | 5 | 6 | SOURCES = $(PIQI_ML_FILES) test.ml 7 | 8 | 9 | PIQI_FILES = packed.piqi 10 | 11 | PIQI_ML_FILES = \ 12 | packed_piqi.ml \ 13 | 14 | 15 | PRE_TARGETS = $(PIQI_ML_FILES) 16 | 17 | 18 | PIQIC = piqic ocaml 19 | PIQIC_FLAGS = --pp --gen-defaults 20 | 21 | 22 | PACKS = piqi.runtime 23 | 24 | # LIBS = piqirun 25 | # LIBDIRS = $(PIQI_ROOT)/piqirun-ocaml 26 | # INCDIRS = $(PIQI_ROOT)/piqirun-ocaml 27 | 28 | 29 | all: nc #top 30 | 31 | 32 | $(PIQI_ML_FILES): $(PIQI_FILES) 33 | set -e; \ 34 | for i in $^; do \ 35 | $(PIQIC) $(PIQIC_FLAGS) $$i ; \ 36 | done 37 | 38 | 39 | 40 | include $(OCAMLMAKEFILE) 41 | -------------------------------------------------------------------------------- /batteries/benchsuite/fsum.ml: -------------------------------------------------------------------------------- 1 | 2 | let rand_float _ = (BatRandom.float 2. -. 1.) *. 2. ** (float (BatRandom.int 80 - 40)) 3 | let nums = Array.init 10000 rand_float 4 | 5 | let test f () = f (BatArray.enum nums) 6 | 7 | let () = 8 | let results = Bench.bench_funs [ 9 | "Enum.reduce", test (BatEnum.reduce (+.)); 10 | "Enum.fsum (Kahan)", test BatEnum.fsum; 11 | "Array.fold", (fun () -> Array.fold_left (+.) 0. nums); 12 | "for loop", (fun () -> let s = ref 0. in for i = 0 to 9_999 do s := !s +. nums.(i); done; !s); 13 | "unsafe for loop", (fun () -> let s = ref 0. in for i = 0 to 9_999 do s := !s +. Array.unsafe_get nums i; done; !s); 14 | ] () in 15 | print_endline "For summing an array of 10K floats,"; 16 | Bench.summarize results 17 | -------------------------------------------------------------------------------- /batteries/examples/euler/euler024.ml: -------------------------------------------------------------------------------- 1 | open Batteries 2 | open Mathlib 3 | 4 | let pos = 1_000_000 5 | 6 | let tokens = [0;1;2;3;4;5;6;7;8;9] 7 | 8 | let rec permute tokens acc pos = 9 | match tokens with 10 | [] -> List.rev (acc) 11 | | [x] -> List.rev (x :: acc) 12 | | t -> 13 | let len = List.length t in 14 | let sub_count = factorial (len-1) in 15 | let token_pos = pos / sub_count 16 | and next_pos = pos mod sub_count in 17 | let found = List.at t token_pos in 18 | Printf.printf "subperm %d: %d (pos %d clust %d) next: %d\n" pos found token_pos sub_count next_pos; 19 | permute (List.remove t found) (found::acc) next_pos 20 | 21 | let () = 22 | permute tokens [] (pos-1) |> List.iter (fun i -> print_int i); 23 | print_newline() 24 | 25 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/examples/erlang/Makefile.erlang: -------------------------------------------------------------------------------- 1 | 2 | ERL_SOURCES = \ 3 | $(PIQI_ERL_FILES) \ 4 | list_people.erl \ 5 | add_person.erl \ 6 | 7 | 8 | ERL_APP_PATH = $(PIQI_ROOT)/piqi-erlang 9 | ERLC_FLAGS = 10 | EBIN_DIR = . 11 | 12 | 13 | PIQIC = piqic erlang 14 | PIQIC_FLAGS = --gen-defaults 15 | 16 | 17 | PIQI_FILES = addressbook.proto.piqi 18 | 19 | PIQI_ERL_FILES = addressbook_piqi.erl 20 | PIQI_HRL_FILES = addressbook_piqi.hrl 21 | 22 | 23 | PRE_TARGET = $(PIQI_ERL_FILES) $(PIQI_HRL_FILES) 24 | 25 | 26 | all: ebin 27 | 28 | 29 | $(PIQI_ERL_FILES) $(PIQI_HRL_FILES): $(PIQI_FILES) 30 | set -e; \ 31 | for i in $^; do \ 32 | $(PIQIC) $(PIQIC_FLAGS) $$i; \ 33 | done 34 | 35 | 36 | include $(PIQI_ROOT)/make/Makefile.erlang 37 | 38 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqicc/piqicc_run.ml: -------------------------------------------------------------------------------- 1 | (* 2 | Copyright 2009, 2010, 2011, 2012, 2013 Anton Lavrik 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | *) 16 | 17 | let _ = 18 | Piqi_main.run () 19 | 20 | -------------------------------------------------------------------------------- /libtracewrap/Makefile.in: -------------------------------------------------------------------------------- 1 | # Wrapper to configure and build libtrace 2 | 3 | .PHONY: default 4 | default: all 5 | 6 | %: 7 | ifeq (@BUILD_LIBTRACE32@, true) 8 | test -d libtrace32 || cp -R libtrace ./libtrace32 9 | endif 10 | $(MAKE) CONFIGURED 11 | $(MAKE) -C libtrace $@ 12 | ifeq (@BUILD_LIBTRACE32@, true) 13 | $(MAKE) -C libtrace32 $@ 14 | endif 15 | 16 | CONFIGURED: libtrace/Makefile.am libtrace/configure.ac 17 | (cd libtrace && INCDIRS="@INCDIRS@" CPPFLAGS="@CPPFLAGS@" ./configure --with-batteries=@BAP_DIR@/batteries/_build/src) 18 | ifeq (@BUILD_LIBTRACE32@, true) 19 | (cd libtrace32 && INCDIRS="@INCDIRS@" CPPFLAGS="@CPPFLAGS@ -m32" CXXFLAGS="-m32" LDFLAGS="@LDFLAGS@ -m32" ./configure --with-batteries=@BAP_DIR@/batteries/_build/src) 20 | endif 21 | touch CONFIGURED 22 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/examples/float.piq: -------------------------------------------------------------------------------- 1 | % floating point values examples 2 | % 3 | % NOTE: "float" and "float64" are the same types with different names (IEEE 754 4 | % double precision). 5 | % 6 | (:float) % all subsequent values have type "float" 7 | 8 | 0.0 -10.0 9 | 10 | 3.14159 11 | 12 | -2e15 13 | 5.6e-10 14 | 15 | 16 | % integer values are converted to floats implicitly 17 | 0 18 | 19 | -100000000000 20 | 21 | 0xffff_ffff_ffff_ffff 22 | 23 | 24 | % not a number, positive and negative infinity 25 | 26 | 0.nan 0.inf -0.inf 27 | 28 | 29 | % 30 | % IEEE 754 single precision 31 | % 32 | (:float32) 33 | 34 | 0.0 3.14159 35 | 36 | 2e15 37 | 0.56e-10 38 | 39 | -100000000000 40 | 41 | 0xffff_ffff_ffff_ffff 42 | 43 | 0.nan 0.inf -0.inf 44 | 45 | 46 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/examples/ocaml-piq-config/README: -------------------------------------------------------------------------------- 1 | This is an example of how to use configuration file in Piq format from OCaml 2 | program. 3 | 4 | This example requires the "piqi.lib" ocamlfind package. Refer to 5 | ../../INSTALL.ocaml for instructions how to build and install it. 6 | 7 | To build the example, run "make". Alternatively, you can use the "build.sh" 8 | script, it contains explicit build commands. 9 | 10 | The resulting "./config" executable will read the config data structure from 11 | "config.piq" and print it on stdout. 12 | 13 | 14 | Files: 15 | config.piqi - the definition of the config file format 16 | config.piq - an example config file 17 | config.ml - an OCaml program that reads the "config.piq" file 18 | 19 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/setenv.sh: -------------------------------------------------------------------------------- 1 | # run this script if you want to run tests; otherwise, use ./configure 2 | 3 | 4 | # base build directory 5 | export PIQI_ROOT="`pwd`" 6 | 7 | # temporary build directory 8 | export PIQI_BUILD="$PIQI_ROOT/build" 9 | 10 | # path to piqi and piqic executables 11 | export PATH="$PIQI_ROOT/bin:$PATH" 12 | 13 | # path to .piqi files 14 | export PIQI_PATH="$PIQI_ROOT" 15 | 16 | 17 | # this is for backward compatibility with older packaging scripts that were 18 | # created before we added ./configure script 19 | if [ ! -f Makefile.config ] 20 | then 21 | ./configure 22 | if [ $? -ne 0 ] 23 | then 24 | echo "./configure command failed" 1>&2 25 | exit 1 26 | fi 27 | fi 28 | 29 | -------------------------------------------------------------------------------- /ocaml/func_boundary.mli: -------------------------------------------------------------------------------- 1 | (** Function boundary identification for x86 2 | 3 | @author Tiffany (Youzhi) Bao 4 | *) 5 | open Asmir 6 | open Type 7 | open Ast 8 | 9 | (** [start_addresses p] identifies a list of function start addresses 10 | in [p] using heuristics. Raises [Invalid_argument] if called on a 11 | non-x86 program. *) 12 | val start_addresses : asmprogram -> addr list 13 | 14 | (** [end_address_at p addr scheme] returns the identified end address 15 | of the function in [cfg]. *) 16 | val end_address_at : Cfg.AST.G.t -> addr 17 | 18 | (** [get_function_ranges p] finds functions using the symbol table, 19 | and if that fails, uses [start_addresses] to identify funtions. *) 20 | val get_function_ranges : asmprogram -> (string * addr * addr) list 21 | -------------------------------------------------------------------------------- /ocamlgraph/editor/tests/test2,1_3tot.gml: -------------------------------------------------------------------------------- 1 | graph [ 2 | comment "This is a sample graph" 3 | directed 1 4 | id 42 5 | label "Hello, I am a graph" 6 | node [ id 1 label "Node 1" ] 7 | node [ id 2 label "node 2" ] 8 | node [ id 3 label "node 3" ] 9 | node [ id 4 label "node 4" ] 10 | node [ id 5 label "node 5" ] 11 | node [ id 6 label "node 6" ] 12 | node [ id 7 label "node 7" ] 13 | edge [ source 1 target 2 ] 14 | edge [ source 1 target 3 ] 15 | edge [ source 1 target 4 ] 16 | edge [ source 1 target 5 ] 17 | edge [ source 1 target 6 ] 18 | edge [ source 1 target 7 ] 19 | edge [ source 2 target 4 ] 20 | edge [ source 5 target 6 ] 21 | edge [ source 6 target 7 ] 22 | edge [ source 5 target 7 ] 23 | 24 | ] -------------------------------------------------------------------------------- /tests/sreedhar_suite.ml: -------------------------------------------------------------------------------- 1 | open BatPervasives 2 | open OUnit 3 | 4 | open Lnf_test 5 | open Lnf 6 | 7 | module L = Lnf_sreedhar.Make(G) 8 | 9 | let n = G.G.V.create;; 10 | 11 | let v0 = n 0 12 | and va = n 1 13 | and vb = n 2 14 | and vc = n 3 15 | and vd = n 4 16 | and ve = n 5 17 | and vf = n 6 18 | and vg = n 7 19 | and vh = n 8 20 | and vend = n 9 21 | 22 | let ramalingam_fig2 : test = (v0, [ 23 | (v0, [va; vend]); 24 | (va, [vb; vc]); 25 | (vb, [vd]); 26 | (vc, [ve]); 27 | (vd, [vb; ve; vend]); 28 | (ve, [vc; vd; vend]); 29 | (vend, []) 30 | ], [ 31 | {headers=[vb; vc; vd; ve]; body=[vb; vc; vd; ve]; children=[]} 32 | ]) 33 | 34 | let suite = "Sreedhar" >::: 35 | [ 36 | "ramalingam_fig2_test" >:: (fun () -> run_test L.lnf ramalingam_fig2); 37 | ] 38 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/examples/erlang/Makefile.erlang_ext: -------------------------------------------------------------------------------- 1 | 2 | ERL_SOURCES = \ 3 | $(PIQI_ERL_FILES) \ 4 | io_json_xml_pb.erl \ 5 | 6 | 7 | 8 | ERL_APP_PATH = $(PIQI_ROOT)/piqi-erlang 9 | ERLC_FLAGS = 10 | EBIN_DIR = . 11 | 12 | 13 | PIQIC = piqic-erlang-ext 14 | PIQIC_FLAGS = --gen-defaults 15 | 16 | 17 | PIQI_FILES = addressbook.proto.piqi 18 | 19 | PIQI_ERL_FILES = addressbook_piqi.erl addressbook_piqi_ext.erl 20 | PIQI_HRL_FILES = addressbook_piqi.hrl 21 | 22 | 23 | PRE_TARGET = $(PIQI_ERL_FILES) $(PIQI_HRL_FILES) 24 | 25 | 26 | all: ebin 27 | 28 | 29 | $(PIQI_ERL_FILES) $(PIQI_HRL_FILES): $(PIQI_FILES) 30 | set -e; \ 31 | for i in $^; do \ 32 | $(PIQIC) $(PIQIC_FLAGS) $$i; \ 33 | done 34 | 35 | 36 | include $(PIQI_ROOT)/make/Makefile.erlang 37 | 38 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqi-tools/piqi_run.ml: -------------------------------------------------------------------------------- 1 | (* 2 | Copyright 2009, 2010, 2011, 2012, 2013 Anton Lavrik 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | *) 16 | 17 | 18 | let _ = 19 | Piqi_main.run () 20 | 21 | 22 | -------------------------------------------------------------------------------- /ocaml/asmir_consts.ml: -------------------------------------------------------------------------------- 1 | (** Constants for asmir.ml. These could go in asmir.ml, but then we'd 2 | need an entry in asmir.mli for each one, and well, I'm just lazy. 3 | *) 4 | 5 | (* bfd defs *) 6 | 7 | let (<<) = (lsl) 8 | 9 | let bsf_global = 1 << 1 10 | let bsf_debugging = 1 << 2 11 | let bsf_function = 1 << 3 12 | 13 | (** no flags *) 14 | let bsec_no_flags = 0x000 15 | (** allocate space when loading *) 16 | let bsec_alloc = 0x001 17 | (** load the section during loading *) 18 | let bsec_load = 0x002 19 | (** section has reloc info *) 20 | let bsec_reloc = 0x004 21 | (** read only *) 22 | let bsec_readonly = 0x008 23 | (** code *) 24 | let bsec_code = 0x010 25 | (** data *) 26 | let bsec_data = 0x020 27 | (** ROM *) 28 | let bsec_rom = 0x040 29 | (* others .... *) 30 | 31 | -------------------------------------------------------------------------------- /pintraces/Makefile.pin: -------------------------------------------------------------------------------- 1 | ############################################################## 2 | # 3 | # DO NOT EDIT THIS FILE! 4 | # 5 | ############################################################## 6 | 7 | # If the tool is built out of the kit, PIN_ROOT must be specified in the make invocation and point to the kit root. 8 | ifdef PIN_ROOT 9 | CONFIG_ROOT := $(PIN_ROOT)/source/tools/Config 10 | else 11 | CONFIG_ROOT := ../Config 12 | endif 13 | include $(CONFIG_ROOT)/makefile.config 14 | include makefile.rules 15 | include $(TOOLS_ROOT)/Config/makefile.default.rules 16 | 17 | ############################################################## 18 | # 19 | # DO NOT EDIT THIS FILE! 20 | # 21 | ############################################################## 22 | -------------------------------------------------------------------------------- /tests/var_suite.ml: -------------------------------------------------------------------------------- 1 | open OUnit 2 | 3 | let var1 = Var.newvar "var1" (Type.Reg(8));; 4 | let var2 = Var.newvar "var2" (Type.Reg(8));; 5 | 6 | let test_identity _ = 7 | assert_equal ~cmp:Var.equal ~msg:"var1 does not equal var1!" var1 var1; 8 | assert_equal ~cmp:Var.equal ~msg:"var2 does not equal var2!" var2 var2;; 9 | 10 | let test_inequality2 _ = 11 | assert_bool "var1 is equal to var2!" (not(Var.equal var1 var2));; 12 | 13 | let suite = "Var" >::: 14 | [ 15 | "test_identity" >:: test_identity; 16 | "test_inequality" >:: 17 | (fun () -> 18 | if(Var.equal var1 var2) 19 | then 20 | assert_failure "var1 is equal to var2!" 21 | else 22 | (* Dummy assert for truth *) 23 | assert_equal 0 0); 24 | "test_inequality2" >:: test_inequality2; 25 | ] 26 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/examples/ocaml/Makefile.ocaml_ext: -------------------------------------------------------------------------------- 1 | include $(PIQI_ROOT)/make/Makefile.ocaml 2 | 3 | 4 | RESULT = io_json_xml_pb 5 | 6 | 7 | SOURCES = \ 8 | $(PIQI_ML_FILES) \ 9 | io_json_xml_pb.ml 10 | 11 | 12 | PACKS = piqi.lib 13 | 14 | 15 | PIQI_FILES = addressbook.proto.piqi 16 | PIQI_ML_FILES = addressbook_piqi.ml addressbook_piqi_ext.ml 17 | 18 | 19 | PRE_TARGETS = $(PIQI_ML_FILES) 20 | 21 | 22 | PIQIC = piqic 23 | PIQIC_FLAGS = --pp --leave-tmp-files --gen-defaults 24 | 25 | 26 | all: native-code #byte-code debug-code 27 | 28 | 29 | $(PIQI_ML_FILES): $(PIQI_FILES) 30 | set -e; \ 31 | for i in $^; do \ 32 | $(PIQIC) ocaml-ext $(PIQIC_FLAGS) $$i ; \ 33 | done 34 | 35 | 36 | clean:: 37 | rm -f *.tmp.ml 38 | 39 | 40 | include $(OCAMLMAKEFILE) 41 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqicc/.gitignore: -------------------------------------------------------------------------------- 1 | piqicc 2 | /piqi_lang_piqi.* 3 | piqobj.ml 4 | piqi_version.ml 5 | 6 | piqi_c_impl.c 7 | piqi_main.ml 8 | piqi.ml 9 | piq_parser.ml 10 | piqi_graph.ml 11 | piqi_common.ml 12 | piqobj_to_piq.ml 13 | piqi_c.mli 14 | piqi_util.ml 15 | piqi_name.ml 16 | piqi_file.ml 17 | piqobj_common.ml 18 | piqobj_of_protobuf.ml 19 | piqloc.ml 20 | piq_lexer.ml 21 | piqic_ocaml_out.ml 22 | piqi_config.ml 23 | piqic_common.ml 24 | piq_gen.ml 25 | piqobj_to_protobuf.ml 26 | piqic_ocaml_types.ml 27 | piqi_iolist.ml 28 | piqi_protobuf.ml 29 | piqic_ocaml.ml 30 | piqobj_of_piq.ml 31 | piqic_ocaml_in.ml 32 | piqi_db.ml 33 | piqi_c.ml 34 | piqic_ocaml_defaults.ml 35 | piqi_pp.ml 36 | piq_ast.ml 37 | piqi_objstore.ml 38 | piqi_xml_type.mli 39 | piqi_json_type.mli 40 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/examples/person.piq: -------------------------------------------------------------------------------- 1 | % this is an object of type "person" which is defined in module "person" 2 | :person/person [ 3 | .name "J. Random Hacker" 4 | .id 0 5 | 6 | .email "j.r.hacker@example.com" 7 | 8 | .phone [ 9 | .number "(111) 123 45 67" 10 | % NOTE: phone is "home" by default 11 | ] 12 | 13 | .phone [ 14 | .number "(222) 123 45 67" 15 | .mobile 16 | ] 17 | 18 | .phone [ 19 | .number "(333) 123 45 67" 20 | .work 21 | ] 22 | ] 23 | 24 | % another object of the same type 25 | :person/person [ 26 | .name "Joe User" 27 | .id 1 28 | 29 | % Joe User doesn't have an email 30 | 31 | .phone [ "(444) 123 45 67" ] 32 | .phone [ "(555) 123 45 67" .work ] 33 | ] 34 | -------------------------------------------------------------------------------- /batteries/examples/snippets/ropes_vs_strings.ml: -------------------------------------------------------------------------------- 1 | open Rope 2 | 3 | let (^^^) = append 4 | 5 | let test_strings num = 6 | let x = ref "" 7 | and s = "a" 8 | in for i = 1 to num do 9 | x := !x ^ s 10 | done 11 | 12 | let test_ropes num = 13 | let x = ref (r"") 14 | and s = r"a" 15 | in for i = 1 to num do 16 | x := !x ^^^ s 17 | done 18 | 19 | let delta f x = 20 | let t0 = Sys.time () in 21 | let _ = f x in 22 | let t1 = Sys.time () in 23 | t1 -. t0 24 | 25 | let _ = 26 | Printf.printf "Strings: %fms\n" (delta (fun () -> 27 | for i = 1 to 10 do 28 | test_strings 10000 29 | done 30 | ) ()); 31 | Printf.printf "Ropes: %fms\n" (delta (fun () -> 32 | for i = 1 to 10 do 33 | test_ropes 1000000 34 | done 35 | ) ()) 36 | 37 | 38 | -------------------------------------------------------------------------------- /tests/reduced_havlak_suite.ml: -------------------------------------------------------------------------------- 1 | open BatPervasives 2 | open OUnit 3 | open Lnf_test 4 | 5 | module L = Lnf_reduced_havlak.Make(G) 6 | 7 | open Lnf 8 | 9 | let n = G.G.V.create;; 10 | 11 | let v0 = n 0 12 | and va = n 1 13 | and vb = n 2 14 | and vc = n 3 15 | and vd = n 4 16 | and ve = n 5 17 | and vf = n 6 18 | and vg = n 7 19 | and vh = n 8 20 | and vend = n 9 21 | 22 | let ramalingam_fig2 : test = (v0, [ 23 | (v0, [va; vend]); 24 | (va, [vb; vc]); 25 | (vb, [vd]); 26 | (vc, [ve]); 27 | (vd, [vb; ve; vend]); 28 | (ve, [vc; vd; vend]); 29 | (vend, []) 30 | ], [ 31 | {headers=[vb; vd; ve]; body=[vb; vc; vd; ve]; children=[]} 32 | ]) 33 | 34 | let suite = "ReducedHavlak" >::: 35 | [ 36 | "ramalingam_fig2_test" >:: (fun () -> run_test L.lnf ramalingam_fig2); 37 | ] 38 | 39 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/examples/erlang/addressbook.erlang.piqi: -------------------------------------------------------------------------------- 1 | % This is an extension for addressbook.proto.piqi module. 2 | % 3 | % This file will be automatically included by "piqic erlang" when it loads 4 | % addressbook.proto.piqi 5 | % 6 | % After converting addressbook.proto to addressbook.proto.piqi, we extend the 7 | % Piqi module with "erlang-type-prefix" top-level property. 8 | % 9 | % If we didn't do that, all Erlang types and records would be prefixed with 10 | % "addressbook_". Such prefixing is done by default to avoid type and record 11 | % name conflicts across several modules. We don't need prefixes at all for this 12 | % simple example. 13 | 14 | .include [ .module addressbook ] 15 | 16 | 17 | .erlang-type-prefix "" 18 | 19 | 20 | .custom-field erlang-type-prefix 21 | 22 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/tests/ocaml_packed/Makefile: -------------------------------------------------------------------------------- 1 | 2 | all: 3 | cat ../piqi_packed/packed.piqi | sed -e 's/\.protobuf-packed//' > unpacked.piqi 4 | cat ../piqi_packed/test-all.piq | sed -e 's/:packed/:unpacked/' > test-all-unpacked.piq 5 | 6 | $(MAKE) -f Makefile.ocaml 7 | 8 | piqi convert -t pb test-all.piq 9 | ./test 10 | cmp test-all.piq.pb test-all.piq.pb.packed 11 | cmp test-all.piq.pb test-all.piq.pb.packed-array 12 | 13 | cp test-all.piq.pb test-all.piq.pb.orig 14 | piqi convert -t pb -o test-all.piq.pb test-all-unpacked.piq 15 | ./test 16 | cmp test-all.piq.pb.orig test-all.piq.pb.packed 17 | cmp test-all.piq.pb.orig test-all.piq.pb.packed-array 18 | 19 | 20 | clean: 21 | $(MAKE) -f Makefile.ocaml clean 22 | rm -f test-all.piq.* unpacked.piqi test-all-unpacked.piq 23 | -------------------------------------------------------------------------------- /ocaml/var_temp.mli: -------------------------------------------------------------------------------- 1 | (** Recognizing and creating temporary variables 2 | 3 | A temporary is a variable introduced by BAP's lifting process that 4 | is only referenced inside one assembly block. The evaluator (and 5 | other BAP analyses) use this information to throw away any state 6 | stored for these temporaries once the temporary becomes out of 7 | scope (i.e., out of that assembly block). 8 | *) 9 | 10 | (** [is_temp_name s] returns true iff s denotes a temporary variable 11 | name. 12 | *) 13 | val is_temp_name : string -> bool 14 | 15 | (** [is_temp v] is equivalent to [is_temp_name (Var.name v)]. *) 16 | val is_temp : Var.t -> bool 17 | 18 | (** [nt n t] creates a new temporary variable with name [n] and type 19 | [t]. *) 20 | val nt : string -> Type.typ -> Var.t 21 | -------------------------------------------------------------------------------- /pcre-ocaml/Makefile: -------------------------------------------------------------------------------- 1 | .NOTPARALLEL: 2 | 3 | -include Makefile.conf 4 | 5 | EXAMPLES = $(filter-out examples/OMakefile examples/CVS, $(wildcard examples/*)) 6 | 7 | .PHONY: all 8 | all: 9 | @cd lib && $(MAKE) byte-code-library native-code-library 10 | 11 | .PHONY: examples 12 | examples: 13 | @for dir in $(EXAMPLES); do (cd $$dir && $(MAKE)); done 14 | 15 | .PHONY: doc 16 | doc: 17 | @cd lib && $(MAKE) $@ 18 | ln -sf lib/doc 19 | 20 | .PHONY: htdoc 21 | htdoc: 22 | @cd lib && $(MAKE) $@ 23 | 24 | .PHONY: install 25 | install: 26 | @cd lib && $(MAKE) $@ 27 | 28 | .PHONY: uninstall 29 | uninstall: 30 | @cd lib && $(MAKE) $@ 31 | 32 | .PHONY: clean 33 | clean: 34 | @cd lib && $(MAKE) clean 35 | @for dir in $(EXAMPLES); do (cd $$dir && $(MAKE) $@); done 36 | @rm -f doc 37 | 38 | tags: 39 | - -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqi-erlang/src/Makefile.piqi: -------------------------------------------------------------------------------- 1 | .PHONY: all clean 2 | 3 | 4 | PIQI_FILES = piqi-rpc.piqi piqi-tools.piqi piqi.piqi 5 | 6 | PIQI_ERL_FILES = piqi_rpc_piqi.erl piqi_tools_piqi.erl piqi_piqi.erl 7 | PIQI_HRL_FILES = piqi_rpc_piqi.hrl piqi_tools_piqi.hrl piqi_piqi.hrl 8 | 9 | PIQI_ERLANG_FILES = $(PIQI_ERL_FILES) $(PIQI_HRL_FILES) 10 | 11 | 12 | PIQIC = $(PIQI_APP_DIR)/priv/bin-$(shell uname -s)-$(shell uname -m)/piqic 13 | PIQIC_FLAGS= -I ../.. # add Piqi root diretory to the Piqi module search path 14 | 15 | 16 | all: $(PIQI_ERLANG_FILES) 17 | 18 | 19 | $(PIQI_ERLANG_FILES): $(PIQI_FILES) 20 | set -e; \ 21 | for i in $^; do \ 22 | $(PIQIC) erlang $(PIQIC_FLAGS) $$i; \ 23 | done 24 | 25 | 26 | clean: 27 | rm -f $(PIQI_ERLANG_FILES) 28 | 29 | 30 | # vim:ft=make 31 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | # Work around buggy Debian ocaml patch 2 | # See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=678577 3 | export OCAML_COMPAT='c' 4 | 5 | AUTOMAKE_OPTIONS = subdir-objects 6 | 7 | if HAVE_PIN 8 | PINTRACES=pintraces 9 | endif 10 | 11 | 12 | BAPDIRS=libasmir ocaml utils tests $(PINTRACES) 13 | SUBDIRS=batteries zarith ounit pcre-ocaml ocamlgraph libtracewrap $(BAPDIRS) 14 | 15 | test: all 16 | $(MAKE) -C tests test 17 | 18 | install: 19 | @echo "BAP does not support the install target" 20 | @false 21 | 22 | .PHONY: cscope 23 | 24 | cscope: 25 | cscope -b `find . -name "*.[ch]" -or -name "*.hh" -or -name "*.cc" -or -name "*.cpp"` 26 | 27 | .PHONY: bap-clean 28 | bap-clean: 29 | for d in $(BAPDIRS); do $(MAKE) -C $$d clean; done 30 | 31 | if HAVE_ETAGS 32 | all-local: tags 33 | endif 34 | -------------------------------------------------------------------------------- /batteries/examples/snippets/parallelsort.ml: -------------------------------------------------------------------------------- 1 | open Threads, Event 2 | 3 | let tasks = 5 4 | 5 | let main = 6 | let input = Sys.argv in 7 | let input_len = Array.length input in 8 | let channels = Array.init tasks (fun _ -> new_channel ()) in 9 | let part_size = input_len / tasks in 10 | let gen_part i = 11 | let len = if i=tasks-1 then (input_len) - (i * part_size) else part_size in 12 | Array.sub input (i*part_size) len 13 | in 14 | let partitions = Array.init tasks gen_part in 15 | let task (c,arr) = Array.sort compare arr; send c arr |> sync in 16 | let make_thread c arr = ignore (Thread.create task (c,arr)) in 17 | Array.iter2 make_thread channels partitions; 18 | let get_print c = c |> receive |> sync |> Array.iter print_endline in 19 | Array.iter get_print channels 20 | -------------------------------------------------------------------------------- /batteries/src/extlib.ml: -------------------------------------------------------------------------------- 1 | module Base64 = BatBase64 2 | module BitSet = BatBitSet 3 | module Dllist = BatDllist 4 | module DynArray = BatDynArray 5 | module Enum = BatEnum 6 | module ExtArray = struct 7 | module Array = struct include Array include BatArray end 8 | end 9 | module ExtHashtbl = struct 10 | module Hashtbl = BatHashtbl 11 | end 12 | module ExtList = struct 13 | module List = struct include List include BatList end 14 | end 15 | module ExtString = struct 16 | module String = BatString 17 | end 18 | module Global = BatGlobal 19 | module IO = BatIO 20 | module OptParse = BatOptParse 21 | module Option = BatOption 22 | module PMap = BatMap 23 | module RefList = BatRefList 24 | module Std = BatPervasives 25 | module UChar = BatUChar 26 | module UTF8 = BatUTF8 27 | (* module Unzip = NOT AVAILABLE *) 28 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/piqi/piqi/piqic/piqi.erlang.piqi: -------------------------------------------------------------------------------- 1 | 2 | .include [ .module piqi/piqi ] 3 | 4 | 5 | % 6 | % types 7 | % 8 | 9 | .extend [ 10 | (.typedef int int32 int64) 11 | 12 | .with.erlang-type "integer" 13 | ] 14 | 15 | .extend [ 16 | (.typedef uint uint32 uint64) 17 | 18 | .with.erlang-type "non_neg_integer" 19 | ] 20 | 21 | 22 | % 23 | % names 24 | % 25 | 26 | .extend [ 27 | .typedef record 28 | 29 | .with.erlang-name "piqi_record" 30 | ] 31 | 32 | .extend [ 33 | .typedef list 34 | 35 | .with.erlang-name "piqi_list" 36 | ] 37 | 38 | .extend [ 39 | .typedef piqi-list 40 | 41 | % erlang-name "piqi-list" is already defined for record "list" 42 | .with.erlang-name "piqi_bundle" 43 | ] 44 | 45 | 46 | (.custom-field erlang-type erlang-name) 47 | 48 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | Disassembly: 2 | * Include symbols in disassembly 3 | * Include section names in disassembly 4 | * Include data? 5 | 6 | Design issues: 7 | * Change attributes from attribute list to a set of attribute. 8 | * When optimizing code, try to keep the more meaningful variable names. 9 | * Inter-procedural analysis 10 | 11 | Features: 12 | * Function boundary identification for x86-64 13 | * Enable (re-)lifting of resolved indirect jumps in BIL 14 | 15 | Other: 16 | * Fix up documentation. 17 | * Write more .mli files. 18 | * Depgraphs.ml: Make a separate graph type for depgraphs.ml with 19 | Lang.exp = unit 20 | * Cfg.mli: How can we make expressions more structured? 21 | * Should we add edge conditions to the visitor? 22 | * Do we really want to_astvar and to_astloc? I don't think we are 23 | using them right now. 24 | -------------------------------------------------------------------------------- /libtracewrap/libtrace/protobuf/examples/addressbook.proto: -------------------------------------------------------------------------------- 1 | // See README.txt for information and build instructions. 2 | 3 | package tutorial; 4 | 5 | option java_package = "com.example.tutorial"; 6 | option java_outer_classname = "AddressBookProtos"; 7 | 8 | message Person { 9 | required string name = 1; 10 | required int32 id = 2; // Unique ID number for this person. 11 | optional string email = 3; 12 | 13 | enum PhoneType { 14 | MOBILE = 0; 15 | HOME = 1; 16 | WORK = 2; 17 | } 18 | 19 | message PhoneNumber { 20 | required string number = 1; 21 | optional PhoneType type = 2 [default = HOME]; 22 | } 23 | 24 | repeated PhoneNumber phone = 4; 25 | } 26 | 27 | // Our address book file is just one of these. 28 | message AddressBook { 29 | repeated Person person = 1; 30 | } 31 | --------------------------------------------------------------------------------