Add support for custom gdbHost in jlink servertype#1174
Conversation
|
We don't have a good way to support WSL and how servers and ports are managed. The way that seems to work for most people is using USBIP. You can search issues for this. Also for JLink users, using their JLink server method is a generic, good way of supporting remote (from a WSL perspective, everything else is remote). https://www.segger.com/products/debug-probes/j-link/tools/j-link-remote-server/ We are not going to do a partial fix. Something like this, even if done, should figure out if the session is in WSL-nat mode (doesn't apply for WSL mirrored mode, as that does not need any changes and will just work) and check /etc/resolve.conf. Have you tried WSL mirrored mode and what issues did you have? So, I cannot accept this PR. |
|
This PR only enabled the option of using something else than localhost as the target when the servertype was set to jlink, with WSL as an example usage scenario where it could be useful. As the PR cannot be accepted I have closed it. |
|
Full wsl/docker/ssh support is coming, this part is already implemented/working. But in a new repo... https://github.com/mcu-debug/mcu-debug Not ready for even a beta release, complete rewrite. |
This adds support for specifying the host for GDB when running with "servertype": "jlink".
This is to allow running the build environment and GDB runs in WSL, while having JLinkGDBServerCL run in Windows and thus avoiding mapping the USB device into WSL.
If not set, it defaults to localhost to maintain backwards compatibility.
In my setup I have the following lines in settings.json:
{ "cortex-debug.JLinkGDBServerPath": "/mnt/c/Program Files/SEGGER/JLink/JLinkGDBServerCL.exe", "cortex-debug.gdbPath": "/path/to/bin/arm-none-eabi-gdb" }And add the following lines to launch.json:
But as the WSL IP might change, it can be automatically updated, for example by using the
augustocdias.tasks-shell-inputextension and: