Allow the use of GDB/LLDB for debugging If the environment variable USE_GDB exists this plugin will pause before the EUNIT tests so that you can attach a debugger to the VM.
Project: http://git-wip-us.apache.org/repos/asf/couchdb-jiffy/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-jiffy/commit/c5c794ea Tree: http://git-wip-us.apache.org/repos/asf/couchdb-jiffy/tree/c5c794ea Diff: http://git-wip-us.apache.org/repos/asf/couchdb-jiffy/diff/c5c794ea Branch: refs/heads/upstream Commit: c5c794eaf4fff4e5578fa1330c43c9fd7ba2ce73 Parents: ec97d3d Author: Paul J. Davis <paul.joseph.da...@gmail.com> Authored: Thu Jun 12 16:58:34 2014 -0500 Committer: Paul J. Davis <paul.joseph.da...@gmail.com> Committed: Fri Jun 13 16:55:09 2014 -0500 ---------------------------------------------------------------------- plugins/rebar_gdb_plugin.erl | 13 +++++++++++++ rebar.config | 5 +++++ 2 files changed, 18 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-jiffy/blob/c5c794ea/plugins/rebar_gdb_plugin.erl ---------------------------------------------------------------------- diff --git a/plugins/rebar_gdb_plugin.erl b/plugins/rebar_gdb_plugin.erl new file mode 100644 index 0000000..f27645d --- /dev/null +++ b/plugins/rebar_gdb_plugin.erl @@ -0,0 +1,13 @@ +-module(rebar_gdb_plugin). +-compile(export_all). + +pre_eunit(_Config, _AppFile) -> + case os:getenv("USE_GDB") of + false -> + ok; + _ -> + Prompt = io_lib:format("GDB Attach to: ~s~n", [os:getpid()]), + io:get_line(Prompt) + end, + ok. + http://git-wip-us.apache.org/repos/asf/couchdb-jiffy/blob/c5c794ea/rebar.config ---------------------------------------------------------------------- diff --git a/rebar.config b/rebar.config index f992d04..67625e9 100644 --- a/rebar.config +++ b/rebar.config @@ -32,3 +32,8 @@ eunit_surefire, [{dir,"."}] }} ]}. + +{plugins, [ + rebar_gdb_plugin +]}. +