-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
4,807 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>erlide_debugger_19</name> | ||
<comment></comment> | ||
<projects> | ||
<project>erlide_common</project> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.erlide.core.erlbuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.erlide.core.erlnature</nature> | ||
</natures> | ||
</projectDescription> |
2 changes: 2 additions & 0 deletions
2
debugger/erlide_debugger_20/.settings/org.eclipse.core.resources.prefs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
eclipse.preferences.version=1 | ||
encoding/<project>=ISO-8859-1 |
17 changes: 17 additions & 0 deletions
17
debugger/erlide_debugger_20/.settings/org.erlide.core.prefs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
backend_version=19.0 | ||
compiler/warn_deprecated_function=true | ||
compiler/warn_export_all=true | ||
compiler/warn_export_vars=true | ||
compiler/warn_obsolete_guard=true | ||
compiler/warn_shadow_vars=true | ||
compiler/warn_unused_function=true | ||
compiler/warn_unused_import=true | ||
compiler/warn_unused_record=true | ||
compiler/warn_unused_vars=true | ||
eclipse.preferences.version=1 | ||
external_includes= | ||
external_modules= | ||
include_dirs=include; | ||
output_dir=ebin | ||
source_dirs=src; | ||
use_pathz=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
builderData=INTERNAL|compile|clean|test| | ||
configType=INTERNAL | ||
eclipse.preferences.version=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#! /bin/bash | ||
|
||
source ../../build_utils.sh | ||
|
||
dir=`pwd` | ||
prj=`basename $dir` | ||
|
||
build_project ../../rebar3 $prj 20 "$@" |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{require_otp_vsn, "20.*"}. | ||
|
||
{plugins, []}. | ||
|
||
{erl_opts, []}. | ||
{edoc_opts,[{todo,true}]}. | ||
|
||
{eunit_opts, [verbose, {report,{eunit_surefire,[{dir,"."}]}}]}. | ||
|
||
{cover_export_enabled, true}. | ||
{cover_enabled, false}. | ||
{cover_print_enable, true}. | ||
|
||
{covertool_eunit, {".eunit/cover.coverdata", "eunit.coverage.xml"}}. | ||
{covertool_prefix_len, 0}. | ||
|
||
{xref_checks,[ | ||
undefined_function_calls, | ||
undefined_functions, | ||
locals_not_used, | ||
%exports_not_used, | ||
deprecated_function_calls, | ||
deprecated_functions | ||
]}. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[]. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
%% | ||
%% %CopyrightBegin% | ||
%% | ||
%% Copyright Ericsson AB 1998-2016. All Rights Reserved. | ||
%% | ||
%% Licensed under the Apache License, Version 2.0 (the "License"); | ||
%% you may not use this file except in compliance with the License. | ||
%% You may obtain a copy of the License at | ||
%% | ||
%% http://www.apache.org/licenses/LICENSE-2.0 | ||
%% | ||
%% Unless required by applicable law or agreed to in writing, software | ||
%% distributed under the License is distributed on an "AS IS" BASIS, | ||
%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
%% See the License for the specific language governing permissions and | ||
%% limitations under the License. | ||
%% | ||
%% %CopyrightEnd% | ||
-module(dbg_debugged). | ||
|
||
%% External exports | ||
-export([eval/3]). | ||
|
||
%%==================================================================== | ||
%% External exports | ||
%%==================================================================== | ||
|
||
%%-------------------------------------------------------------------- | ||
%% eval(Mod, Func, Args) -> Value | ||
%% Main entry point from external (non-interpreted) code. | ||
%% Called via the error handler. | ||
%%-------------------------------------------------------------------- | ||
eval(Mod, Func, Args) -> | ||
SaveStacktrace = erlang:get_stacktrace(), | ||
Meta = dbg_ieval:eval(Mod, Func, Args), | ||
Mref = erlang:monitor(process, Meta), | ||
msg_loop(Meta, Mref, SaveStacktrace). | ||
|
||
%%==================================================================== | ||
%% Internal functions | ||
%%==================================================================== | ||
|
||
msg_loop(Meta, Mref, SaveStacktrace) -> | ||
receive | ||
|
||
%% Evaluated function has returned a value | ||
{sys, Meta, {ready, Val}} -> | ||
erlang:demonitor(Mref, [flush]), | ||
|
||
%% Restore original stacktrace and return the value | ||
try erlang:raise(throw, stack, SaveStacktrace) | ||
catch | ||
throw:stack -> | ||
case Val of | ||
{dbg_apply,M,F,A} -> | ||
apply(M, F, A); | ||
_ -> | ||
Val | ||
end | ||
end; | ||
|
||
%% Evaluated function raised an (uncaught) exception | ||
{sys, Meta, {exception,{Class,Reason,Stacktrace}}} -> | ||
erlang:demonitor(Mref, [flush]), | ||
|
||
%% ...raise the same exception | ||
erlang:error(erlang:raise(Class, Reason, Stacktrace), | ||
[Class,Reason,Stacktrace]); | ||
|
||
%% Meta is evaluating a receive, must be done within context | ||
%% of real (=this) process | ||
{sys, Meta, {'receive',Msg}} -> | ||
receive Msg -> | ||
Meta ! {self(), rec_acked}, | ||
ok | ||
end, | ||
msg_loop(Meta, Mref, SaveStacktrace); | ||
|
||
%% Meta needs something evaluated within context of real process | ||
{sys, Meta, {command,Command}} -> | ||
Reply = handle_command(Command), | ||
Meta ! {sys, self(), Reply}, | ||
msg_loop(Meta, Mref, SaveStacktrace); | ||
|
||
%% Meta has terminated | ||
%% Must be due to int:stop() (or -heaven forbid- a debugger bug) | ||
{'DOWN', Mref, _, _, Reason} -> | ||
|
||
%% Restore original stacktrace and return a dummy value | ||
try erlang:raise(throw, stack, SaveStacktrace) | ||
catch | ||
throw:stack -> | ||
{interpreter_terminated, Reason} | ||
end | ||
end. | ||
|
||
handle_command(Command) -> | ||
try | ||
reply(Command) | ||
catch Class:Reason -> | ||
Stacktrace = stacktrace_f(erlang:get_stacktrace()), | ||
{exception,{Class,Reason,Stacktrace}} | ||
end. | ||
|
||
reply({apply,M,F,As}) -> | ||
{value, erlang:apply(M,F,As)}; | ||
reply({eval,Expr,Bs}) -> | ||
%% Bindings is an orddict (sort them) | ||
erl_eval:expr(Expr, lists:sort(Bs)). % {value, Value, Bs2} | ||
|
||
%% Fix stacktrace - keep all above call to this module. | ||
%% | ||
stacktrace_f([]) -> []; | ||
stacktrace_f([{?MODULE,_,_,_}|_]) -> []; | ||
stacktrace_f([F|S]) -> [F|stacktrace_f(S)]. |
Oops, something went wrong.