Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix some bugs in Concuerror's GUI

  • Loading branch information...
commit 9d706cdc09467e87d5076bd0d22e38b0e708da64 1 parent 8fdc014
@iliastsi iliastsi authored
View
12 src/concuerror.erl
@@ -128,7 +128,10 @@ cliAux(Options) ->
concuerror_util:timer_init(),
%% Start the log manager.
_ = concuerror_log:start(),
- %% Parse options
+ %% Create table to save options
+ ?NT_OPTIONS = ets:new(?NT_OPTIONS, [named_table, public, set]),
+ ets:insert(?NT_OPTIONS, Options),
+ %% Handle options
case lists:keyfind('gui', 1, Options) of
{'gui'} -> gui(Options);
false ->
@@ -161,6 +164,8 @@ cliAux(Options) ->
end
end
end,
+ %% Remove options table
+ ets:delete(?NT_OPTIONS),
%% Stop event handler
concuerror_log:stop(),
%% Destroy timer table.
@@ -503,9 +508,6 @@ analyze(Options) ->
Res.
analyzeAux(Options) ->
- %% Create table to save options
- ?NT_OPTIONS = ets:new(?NT_OPTIONS, [named_table, public, set]),
- ets:insert(?NT_OPTIONS, Options),
%% Get target
Result =
case lists:keyfind(target, 1, Options) of
@@ -523,8 +525,6 @@ analyzeAux(Options) ->
concuerror_sched:analyze(Target, Files, Options)
end
end,
- %% Remove options table
- ets:delete(?NT_OPTIONS),
%% Return result
Result.
View
30 src/concuerror_gui.erl
@@ -665,7 +665,11 @@ analyze_aux(Module, Function, Args, Files) ->
end,
Include = {'include', ref_lookup(?PREF_INCLUDE)},
Define = {'define', ref_lookup(?PREF_DEFINE)},
- Opts = [Include, Define, Preb],
+ Dpor = case ets:lookup(?NT_OPTIONS, 'dpor') of
+ [] -> {'dpor', 'none'};
+ [Flavor] -> Flavor
+ end,
+ Opts = [Include, Define, Preb, Dpor],
Result = concuerror_sched:analyze(Target, Files, Opts),
ref_add(?ANALYSIS_RET, Result),
analysis_cleanup().
@@ -1092,18 +1096,18 @@ remove() ->
%% Kill the analysis process.
stop() ->
try
- ?RP_SCHED ! stop_analysis,
- wxMenuItem:enable(ref_lookup(?STOP_MENU_ITEM), [{enable, false}]),
- StopButton = ref_lookup(?STOP),
- Parent = wxWindow:getParent(StopButton),
- StopGauge = wxGauge:new(Parent, ?wxID_ANY, 100,
- [{style, ?wxGA_HORIZONTAL}]),
- ref_add(?STOP_GAUGE, StopGauge),
- AnalStopSizer = ref_lookup(?ANAL_STOP_SIZER),
- wxSizer:replace(AnalStopSizer, StopButton, StopGauge),
- wxWindow:destroy(StopButton),
- wxSizer:layout(AnalStopSizer),
- start_pulsing(StopGauge)
+ ?RP_SCHED ! stop_analysis
+%% wxMenuItem:enable(ref_lookup(?STOP_MENU_ITEM), [{enable, false}]),
+%% StopButton = ref_lookup(?STOP),
+%% Parent = wxWindow:getParent(StopButton),
+%% StopGauge = wxGauge:new(Parent, ?wxID_ANY, 100,
+%% [{style, ?wxGA_HORIZONTAL}]),
+%% ref_add(?STOP_GAUGE, StopGauge),
+%% AnalStopSizer = ref_lookup(?ANAL_STOP_SIZER),
+%% wxSizer:replace(AnalStopSizer, StopButton, StopGauge),
+%% wxWindow:destroy(StopButton),
+%% wxSizer:layout(AnalStopSizer),
+%% start_pulsing(StopGauge)
catch
error:badarg -> continue
end.
View
4 src/concuerror_sched.erl
@@ -121,8 +121,8 @@ analyze({Mod,Fun,Args}=Target, Files, Options) ->
%% Unregister some key processes
%% inet_gethos_native will run without supervisor
%% (Icky fallback)
- unregister(kernel_safe_sup),
- unregister(net_sup),
+ catch unregister(kernel_safe_sup),
+ catch unregister(net_sup),
%% Run all possible interleavings
{T1, _} = statistics(wall_clock),
Result = interleave(NewTarget, PreBound, Dpor, Options),
Please sign in to comment.
Something went wrong with that request. Please try again.