Fixing Mismatching Environment

When you run Linux programs remotely over SSH, it uses a special SSH command mode. In this mode the remote machine skips some of the initialization scripts (e.g. ~/.bashrc). If those scripts set some of the critical environment variables (e.g. LD_LIBRARY_PATH), your programs may not work properly under VisualGDB even when they run correctly from the regular SSH session.

VisualGDB automatically detects this condition by comparing the environments in the command mode (used by VisualGDB to launch commands) and the regular SSH console (used when connecting manually). If differences are found, VisualGDB will suggest automatically compensating them. Below is an example of this mechanism:

In this example the LD_LIBRARY_PATH (unset originally) is modified in ~/.bashrc as shown below: 

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/bin/extrapath

This means that the "/bin/extrapath" part will apply to programs launched from the regular console, but not to programs launched via the SSH command mode. VisualGDB will detect this during toolchain testing and will suggest fixing it:

If you choose "fix", VisualGDB will remember the difference between 2 modes and will automatically apply it when launching your programs. You can review and modify it later via Tools->VisualGDB->SSH Host Manager:

Selecting "ignore" will ignore the variable difference until the next toolchain testing. Selecting "Ignore Globally" will add it to a global list of ignored variables (applied to all remote machines). You can change it via Tools->Options->VisualGDB->General->Ignored Mismatching Environment Variables: