Parcourir la source

Recommend LLDB over GDB for VSCode

developer il y a 3 ans
Parent
commit
1b104744a9
1 fichiers modifiés avec 33 ajouts et 4 suppressions
  1. 33 4
      development/cpp/configuring_an_ide/visual_studio_code.rst

+ 33 - 4
development/cpp/configuring_an_ide/visual_studio_code.rst

@@ -85,12 +85,30 @@ To run and debug the project you need to create a new configuration in the ``lau
 - Within the ``launch.json`` file find the ``"configurations"`` array and add a new section to it:
 
 .. tabs::
-  .. code-tab:: js Linux/X11
+  .. code-tab:: js X11
+
+    {
+      "name": "Launch Project",
+      "type": "lldb",
+      "request": "launch",
+      // Change to godot.x11.tools.64.llvm for llvm-based builds.
+      "program": "${workspaceFolder}/bin/godot.x11.tools.64",
+      // Change the arguments below for the project you want to test with.
+      // To run the project instead of editing it, remove the "--editor" argument.
+      "args": [ "--editor", "--path", "path-to-your-godot-project-folder" ],
+      "stopAtEntry": false,
+      "cwd": "${workspaceFolder}",
+      "environment": [],
+      "externalConsole": false,
+      "preLaunchTask": "build"
+    }
+  .. code-tab:: js X11_gdb
 
     {
       "name": "Launch Project",
       "type": "cppdbg",
       "request": "launch",
+      // Change to godot.x11.tools.64.llvm for llvm-based builds.
       "program": "${workspaceFolder}/bin/godot.x11.tools.64",
       // Change the arguments below for the project you want to test with.
       // To run the project instead of editing it, remove the "--editor" argument.
@@ -98,9 +116,9 @@ To run and debug the project you need to create a new configuration in the ``lau
       "stopAtEntry": false,
       "cwd": "${workspaceFolder}",
       "environment": [],
-      "externalConsole": true,
-      "MIMode": "gdb",
-      "setupCommands": [
+      "externalConsole": false,
+      "setupCommands":
+      [
         {
           "description": "Enable pretty-printing for gdb",
           "text": "-enable-pretty-printing",
@@ -134,6 +152,17 @@ To run and debug the project you need to create a new configuration in the ``lau
 
    An example of a filled out ``launch.json``.
 
+
+.. note::
+
+    Due to sporadic performance issues, it is recommended to use LLDB over GDB on Unix-based systems.
+    Make sure that the `CodeLLDB extension <https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb>`_
+    is installed.
+
+    If you encounter issues with lldb, you may consider using gdb (see the X11_gdb configuration).
+
+    Do note that lldb may work better with llvm-based builds. See :ref:`doc_compiling_for_linuxbsd` for further information.
+
 The name under ``program`` depends on your build configuration,
 e.g. ``godot.x11.tools.64`` for 64-bit X11 platform with ``tools`` enabled.