'How to add source directories when remote debugging a core dump in vscode?

When remote debugging a core dump in vscode (via gdb) and clicking on some lines in the stack trace I get Unable to open '...': File not found messages for some of the files.
Those source files do exist on the (remote) machine. How can I point vscode to their right directories?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source