Skip to main content
MikeDB
Senior II
May 1, 2019
Question

STM32CubeIDE Cannot run program "gdb": Launching failed

  • May 1, 2019
  • 32 replies
  • 23917 views

I'm sure it's something silly and I can't believe I'm the only person who has seen this message but searching this site doesn't yield any clues. Can someone point me to what I am setting up wrong, presumably in the Debug Configuration menu ?

32 replies

Markus GIRDLAND
ST Employee
May 6, 2019

Could be quite a few things. Could you activate the gdb server log in the "Debugger" tab there's a "Log to file:" that you can click and then paste here.

Mike Hill
Visitor II
November 5, 2019

0690X00000AriqlQAB.pngI am having the same problem on a project I converted from Atollic TrueStudio 9.1.0. It compiles just fine, but I can't debug now.

Where exactly is the option to log to a file? I can't find what you mean.

I did find this error log about the problem:

!ENTRY org.eclipse.cdt.dsf.gdb 4 5012 2019-11-05 16:04:49.906

!MESSAGE Error with command: gdb --version

!STACK 0

java.io.IOException: Cannot run program "gdb": Launching failed

   at org.eclipse.cdt.utils.spawner.Spawner.exec(Spawner.java:352)

   at org.eclipse.cdt.utils.spawner.Spawner.<init>(Spawner.java:94)

   at org.eclipse.cdt.utils.spawner.Spawner.<init>(Spawner.java:124)

   at org.eclipse.cdt.utils.spawner.ProcessFactory.exec(ProcessFactory.java:73)

   at org.eclipse.cdt.dsf.gdb.launching.LaunchUtils.getGDBVersion(LaunchUtils.java:320)

   at org.eclipse.cdt.dsf.gdb.launching.GdbLaunch.getGDBVersion(GdbLaunch.java:511)

   at org.eclipse.cdt.dsf.gdb.launching.GdbLaunchDelegate.launchDebugSession(GdbLaunchDelegate.java:147)

   at org.eclipse.cdt.dsf.gdb.launching.GdbLaunchDelegate.launchDebugger(GdbLaunchDelegate.java:106)

   at org.eclipse.cdt.dsf.gdb.launching.GdbLaunchDelegate.launch(GdbLaunchDelegate.java:94)

   at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:860)

   at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:719)

   at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1017)

   at org.eclipse.debug.internal.ui.DebugUIPlugin$2.run(DebugUIPlugin.java:1220)

   at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

Thanks

KModi.1074
Associate
November 11, 2019

Looks like you don't have it pointed to the correct exe. In the "Debugger" tab give full path of the gdb.exe(Windows machine) of the cross compiler that you might have installed as the "GDB command".

For me it is "C:\Program Files (x86)\GNU Tools Arm Embedded\7 2018-q2-update\bin\arm-none-eabi-gdb.exe"

Mike Hill
Visitor II
November 11, 2019

You are correct, but I think the underlying issue is that Atollic installed gdb.exe and STM32CubeIDE does not. At least not for me. I have searched the install path and I can't find it. I assumed it would install everything that was needed just like Atollic did.

RMcCa
Senior II
November 5, 2019

I get errors like that when the debugger isn't connected and i try to start it. Usually saying 'Doh!' and plugging the debugger into the target board and turning it on fixes everything.​

Mike Hill
Visitor II
November 11, 2019

That's definitely not my problem. It has something to do with the new installation of the IDE. My old Atollic version still works just fine.

MikeDB
MikeDBAuthor
Senior II
November 11, 2019

As the original creator of this thread, and just for the record, after six months I still haven't solved this problem. Compilation works but debugging in CubeIDE just doesn't ... at least on my system.

KModi.1074
Associate
November 12, 2019

I think @Community member​ 's problem is solved, can you check if you are also facing the same issue?

Mike Hill
Visitor II
November 12, 2019

Actually it did not fix my problem. I pointed to gdb.exe from a previous installation and it gave me different errors. The gdb.exe is supposed to be installed with the IDE and for some reason on my machine it is not getting installed.

DEise
Associate
January 5, 2020

I installed STM32CubeIDE and also get the

Error with command: gdb --version

Cannot run program "gdb": Launching failed 

message. Perhaps an explanation of how to install gdb and set up STM32CubeIDE to use it would be usefull. Documentation is usefull.

KnarfB
Super User
January 5, 2020

UM2563 STM32CubeIDE installation guide ?

All external tools are installed during STM32CubeIde install in the plugins folder. On a recent Win10 install, compiler+debugger are in C:\ST\STM32CubeIDE_1.1.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610.

Avoid complications in the install path: no spaces, no long path, all ASCII.

DEise
Associate
January 5, 2020

 I changed GDB debugger from gdb to arm-none-eabi-gdb, and enabled Serial Wirer Viewer. Thank you.

DEise
Associate
January 5, 2020

Hello - I was going to come back here and update. I went to Debug Configurations, and changes Debugger from gdb to arm-none-eabi-gdb, enabled Serial Wirer Viewer. That got me running. Just now commented out the " __HAL_AFIO_REMAP_SWJ_DISABLE()" call. I am running what I believe to be commonly known as the Blue Pill STM32F103C8 board. I am running my code now ..... thank you for making STM32CubeIDE available to hobbyists such as myself !