Marus / cortex-debug

Visual Studio Code extension for enhancing debug capabilities for Cortex-M Microcontrollers
MIT License
1.02k stars 240 forks source link

Using a custom GDB server #970

Closed erlingrj closed 10 months ago

erlingrj commented 10 months ago

Hi, thanks for this great project! I want to use this with LinkServer from NXP. It is their own GDB server. Is there any way of configuring a custom GDB server? LinkServer will expose a GDB server on a configurable port and accept connections from GDB clients.

If this is not possible. Could I just run the GDB server myself and have Cortex-Debug just start a GDB client with a initial commands?

haneefdm commented 10 months ago

Multiple answers to this question.

  1. Sure you can start the server manually and use the "servertype": "external" and"gdbPort"`. You are now responsible for starting and shutting down your server. You are also responsible for specifying all the commands to launch, attach, reset, and restart. Lots of people do this. See this document for all the override options. You could also document this in our Wiki so it can help others.
  2. What might be better is to add it officially as a known servertype if you don't want everyone to figure out how to do the above. Look at one of our existing source code like JLink. Downside, is that you have to learn Typescript and commit to maintain any issues that might crop up. We need you to maintain it for the longer term, as I cannot do that as I don't have the HW or knowhow for these custom gdb servers. Perhaps you can ask NXP to donate some time and commitment.