title: Can't set LD_LIBRARY_PATH to launch gdb, from toolchain, from Visual Studio Code
body: <p>I tried on both:</p>
  <ol>
  <li>Windows 10, VSCode 1.52.1, Remote - WSL v0.52.0, Ubuntu 18.04 LTS</li>
  <li>Virtual Ubuntu 20.04 LTS, VSCode 1.52.1</li>
  </ol>
  <p>And wasn't able to run GDB from VS Code, because I need to specify LD_LIBRARY_PATH for it.<br />
  I can run it from console as:<br />
  <code>LD_LIBRARY_PATH=/opt/toolchain/vararm/lib /opt/toolchain/vararm/bin/arm-linux-gdb</code><br />
  or</p>
  <pre class="lang-sh prettyprint-override"><code>export LD_LIBRARY_PATH=/opt/toolchain/vararm/lib
  # doesn't work without export.
  /opt/toolchain/vararm/bin/arm-linux-gdb
  </code></pre>
  <p>and it's working fine.</p>
  <p>I tried to use</p>
  <ul>
  <li>&quot;environment&quot;</li>
  <li>&quot;linux&quot; { &quot;environment&quot; }</li>
  <li>&quot;env&quot;</li>
  <li>&quot;additionalSOLibSearchPath&quot;</li>
  <li>&quot;envFile&quot;</li>
  </ul>
  <p>but not a single one was working.<br />
  I changed miDebuggerPath to my custom script that is printing env and there was no LD_LIBRARY_PATH.<br />
  After some testing I found out, that LD_LIBRARY_PATH is somehow used AFTER gdb started to load other libraries, but it's not used to start GDB itself.</p>
  <p>In the end I make workaround with script:</p>
  <pre class="lang-sh prettyprint-override"><code>#!/bin/sh                                                                                                               
  #/opt/toolchain/vararm/bin/arm-linux-gdb.sh
  # Set Toolchain's path before running debugger
  export LD_LIBRARY_PATH=/opt/toolchain/vararm/lib
  exec /opt/toolchain/vararm/bin/arm-linux-gdb &quot;$@&quot;
  </code></pre>
  <p><strong>But I would like to be able to run GDB from VS Code without any workaround, can somebody help me?</strong></p>
  <p>My configuration in launch.json:</p>
  <pre class="lang-json prettyprint-override"><code>{
              &quot;name&quot;: &quot;[vararm] 192.168.168.112&quot;,
              /*&quot;preLaunchTask&quot;: &quot;[vararm] 192.168.168.112&quot;,*/
              &quot;type&quot;: &quot;cppdbg&quot;,
              &quot;request&quot;: &quot;launch&quot;,
              &quot;program&quot;: &quot;${workspaceFolder}/../target/vararm/bin/sqlite_checkpoint&quot;,
              /*&quot;args&quot;: [ &quot;-c&quot;, &quot;${workspaceFolder}/../target/conf/sqlite_checkpoint.cfg&quot; ],*/
              &quot;stopAtEntry&quot;: true,
              &quot;cwd&quot;: &quot;${workspaceFolder}&quot;,
              /*&quot;envFile&quot;: &quot;${workspaceFolder}/vararm.env&quot;,*/
              &quot;environment&quot;: [
                  {
                      &quot;name&quot;:&quot;LD_LIBRARY_PATH&quot;,
                      &quot;value&quot;:&quot;${LD_LIBRARY_PATH}:/opt/toolchain/vararm/lib&quot;,
                  },
                  {
                      &quot;name&quot;:&quot;LD_TEST&quot;,
                      &quot;value&quot;: &quot;LD_TEST&quot;
                  }
              ],
              &quot;externalConsole&quot;: false,
              &quot;MIMode&quot;: &quot;gdb&quot;,
              &quot;setupCommands&quot;: [
                  {
                      &quot;description&quot;: &quot;Enable pretty-printing for gdb&quot;,
                      &quot;text&quot;: &quot;-enable-pretty-printing&quot;,
                      &quot;ignoreFailures&quot;: true
                  }
              ],
              /*&quot;additionalSOLibSearchPath&quot;: &quot;/opt/toolchain/vararm/lib&quot;,*/
              &quot;miDebuggerServerAddress&quot;: &quot;192.168.168.112:54321&quot;,
              &quot;miDebuggerPath&quot;: &quot;/opt/toolchain/vararm/bin/arm-linux-gdb.sh&quot;,
              &quot;logging&quot;: { &quot;engineLogging&quot;: true, &quot;moduleLoad&quot;: true, &quot;exceptions&quot;: true, &quot;trace&quot;: true }
          }
  </code></pre>