Change:
OpenDebug does not work. vscode-cpptools working opendebug -not work !
correct path ) !

Discussion:
{ lib, vscode-utils <del> , fetchurl, mono, writeScript, runtimeShell </del> <ins> , fetchurl, writeScript, runtimeShell </ins> , jq, clang-tools , gdbUseFixed ? true, gdb # The gdb default setting will be fixed to specified. Use version from `PATH` otherwise. <ins> , autoPatchelfHook, makeWrapper, stdenv, lttng-ust, libkrb5, zlib </ins> }: /*

let gdbDefaultsTo = if gdbUseFixed then "${gdb}/bin/gdb" else "gdb"; <del> openDebugAD7Script = writeScript "OpenDebugAD7" '' #!${runtimeShell} BIN_DIR="$(cd "$(dirname "$0")" && pwd -P)" ${if gdbUseFixed then '' export PATH=''${PATH}''${PATH:+:}${gdb}/bin '' else ""} ${mono}/bin/mono $BIN_DIR/bin/OpenDebugAD7.exe $* ''; </del> in vscode-utils.buildVscodeMarketplaceExtension rec { mktplcRef = { name = "cpptools"; publisher = "ms-vscode"; <del> version = "1.9.1"; </del> <ins> version = "1.11.0"; sha256 = "c0725d3914aeb2515627691727455cc27e7a75031fa02ca957be02cc210bd64d"; arch = "linux-x64"; </ins> }; <del> vsix = fetchurl { name = "${mktplcRef.publisher}-${mktplcRef.name}.gz"; url = "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/${mktplcRef.publisher}/vsextensions/${mktplcRef.name}/${mktplcRef.version}/vspackage?targetPlatform=linux-x64"; sha256 = "sha256-BtTl9DR8hnwNpO5k99M4dtqcTQ2hTzVbjR8VZh+tdDI="; }; unpackPhase = '' runHook preUnpack gzip -d $src --stdout &> temporary.zip unzip temporary.zip rm temporary.zip cd extension/ runHook postUnpack ''; </del> <ins> nativeBuildInputs = [ autoPatchelfHook makeWrapper ]; </ins> buildInputs = [ jq <ins> lttng-ust libkrb5 zlib stdenv.cc.cc.lib </ins> ]; postPatch = ''

# Prevent download/install of extensions touch "./install.lock" <del> # Mono runtimes from nix package (used by generated `OpenDebugAD7`). mv ./debugAdapters/bin/OpenDebugAD7 ./debugAdapters/bin/OpenDebugAD7_orig cp -p "${openDebugAD7Script}" "./debugAdapters/bin/OpenDebugAD7" </del> # Clang-format from nix package. <del> mv  ./LLVM/ ./LLVM_orig </del> <ins> mv ./LLVM/ ./LLVM_orig </ins> mkdir "./LLVM/" find "${clang-tools}" -mindepth 1 -maxdepth 1 | xargs ln -s -t "./LLVM" <del> # Patching  cpptools and cpptools-srv elfInterpreter="$(cat $NIX_CC/nix-support/dynamic-linker)" patchelf --set-interpreter "$elfInterpreter" ./bin/cpptools patchelf --set-interpreter "$elfInterpreter" ./bin/cpptools-srv chmod a+x ./bin/cpptools{-srv,} </del> <ins> # Patching binaries chmod +x bin/cpptools bin/cpptools-srv bin/cpptools-wordexp debugAdapters/bin/OpenDebugAD7 patchelf --replace-needed liblttng-ust.so.0 liblttng-ust.so.1 ./debugAdapters/bin/libcoreclrtraceptprovider.so </ins> ''; <del> meta = with lib; { license = licenses.unfree; maintainers = [ maintainers.jraygauthier ]; # A 32 bit linux would also be possible with some effort (specific download of binaries + # patching of the elf files with 32 bit interpreter). platforms = [ "x86_64-linux" ]; }; </del> <ins> postFixup = lib.optionalString gdbUseFixed '' wrapProgram $out/share/vscode/extensions/ms-vscode.cpptools/debugAdapters/bin/OpenDebugAD7 --prefix PATH : ${lib.makeBinPath [ gdb ]} ''; meta = with lib; { description = "The C/C++ extension adds language support for C/C++ to Visual Studio Code, including features such as IntelliSense and debugging."; homepage = "https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools"; license = licenses.unfree; maintainers = with maintainers; [ jraygauthier stargate01 ]; platforms = [ "x86_64-linux" ]; }; </ins> }

<del> { publisher, name, version, sha256 ? "" }: </del> <ins> { publisher, name, version, arch ? "", sha256 ? "" }: let archurl = (if arch == "" then "" else "?targetPlatform=${arch}"); in </ins> { <del> url = "https://${publisher}.gallery.vsassets.io/_apis/public/gallery/publisher/${publisher}/extension/${name}/${version}/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage"; </del> <ins> url = "https://${publisher}.gallery.vsassets.io/_apis/public/gallery/publisher/${publisher}/extension/${name}/${version}/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage${archurl}"; </ins> sha256 = sha256; # The `*.vsix` file is in the end a simple zip file. Change the extension # so that existing `unzip` hooks takes care of the unpacking.