Search in sources :

Example 1 with CPPToolchains

use of com.jetbrains.cidr.cpp.toolchains.CPPToolchains in project intellij by bazelbuild.

the class ToolchainUtils method setDefaultDebuggerPath.

public static void setDefaultDebuggerPath(String debuggerPath) {
    ApplicationManager.getApplication().runWriteAction(() -> {
        CPPToolchains cppToolchains = CPPToolchains.getInstance();
        Toolchain toolchain = cppToolchains.getDefaultToolchain();
        if (toolchain != null) {
            cppToolchains.beginUpdate();
            toolchain.setDebuggerKind(DebuggerKind.CUSTOM_GDB);
            toolchain.setCustomGDBExecutablePath(debuggerPath);
            cppToolchains.endUpdate();
            return;
        }
        Toolchain newToolchain = createDefaultToolchain();
        newToolchain.setDebuggerKind(DebuggerKind.CUSTOM_GDB);
        newToolchain.setCustomGDBExecutablePath(debuggerPath);
        cppToolchains.beginUpdate();
        cppToolchains.addToolchain(newToolchain);
        cppToolchains.endUpdate();
    });
}
Also used : Toolchain(com.jetbrains.cidr.cpp.toolchains.CPPToolchains.Toolchain) CPPToolchains(com.jetbrains.cidr.cpp.toolchains.CPPToolchains)

Aggregations

CPPToolchains (com.jetbrains.cidr.cpp.toolchains.CPPToolchains)1 Toolchain (com.jetbrains.cidr.cpp.toolchains.CPPToolchains.Toolchain)1