classdef MacHostDebuggerManager < rtw.connectivity.HostDebuggerManager
    %MACHOSTDEBUGGERMANAGER utility class to create an instance of
    % rtw.connectivity.LLDBSILDebugger
    %
    %   This is an undocumented class. Its methods and properties are
    %   likely to change without warning from one release to the next.
    
    %   Copyright 2020 The MathWorks, Inc.
    
    methods
        function this = MacHostDebuggerManager()
            compilerID = {'Clang'};
            % No restriction on Clang version, set to empty
            compilerVersionPairs = {...
                {'Clang', ''}};
            this = this@rtw.connectivity.HostDebuggerManager(compilerID, compilerVersionPairs);
        end
    end
    
    methods(Access = protected)    
        function checkDebuggerIsAvailable(~, ~)
            % check that LLDB is available and issue an error if
            % not
            if ~rtw.connectivity.HostSILDebugger.commandExists('lldb')
                error(message('PIL:pil:SILDebuggingLLDBNotFound'));
            end
        end
        
        function debugger = createDebugger(~, componentArgs, topContext, silDebuggingInfo)
            debugger = rtw.connectivity.LLDBSILDebugger(componentArgs, ...
                topContext, ...
                silDebuggingInfo);
        end
        
        function populateToolchainInfo(this, defaultComp)
            if strcmp(defaultComp.compStr, 'Apple-x')
                this.populateBasicToolchainInfo(defaultComp);
            end
        end
    end
end