Bug 532242 - Error with command: gdb --version Cannot run program "gdb": Unknown reason
Summary: Error with command: gdb --version Cannot run program "gdb": Unknown reason
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug (show other bugs)
Version: 9.2.0   Edit
Hardware: PC Linux
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: cdt-debug-inbox@eclipse.org CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-09 09:31 EST by Claude Robitaille CLA
Modified: 2020-09-04 15:16 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Claude Robitaille CLA 2018-03-09 09:31:06 EST
I know this is an old error message and that 2 bug were filed for this and closed. However, my case is different...

I can debug using gdb just fine. But after a couple of debug runs, I get this error. At that point, I just restart eclipse (using the menu item under File) and things just work fine again. But just for a few runs. I can repeat the restart ad nauseam and the behavior is the same.

This problem has been around for long time in previous eclipse, it just is much more frequent now (before it was every few days, now it is every few runs).

I am not sure if my configuration is cdi-gdb or dsf-gdb but it is pretty plain vanilla.

This is the exception stack:

java.io.IOException: Cannot run program "gdb": Unknown reason
	at org.eclipse.cdt.utils.spawner.Spawner.exec(Spawner.java:349)
	at org.eclipse.cdt.utils.spawner.Spawner.<init>(Spawner.java:91)
	at org.eclipse.cdt.utils.spawner.Spawner.<init>(Spawner.java:120)
	at org.eclipse.cdt.utils.spawner.ProcessFactory.exec(ProcessFactory.java:71)
	at org.eclipse.cdt.dsf.gdb.launching.GdbLaunch.getGDBVersion(GdbLaunch.java:524)
	at org.eclipse.cdt.dsf.gdb.launching.GdbLaunchDelegate.launchDebugSession(GdbLaunchDelegate.java:142)
	at org.eclipse.cdt.dsf.gdb.launching.GdbLaunchDelegate.launchDebugger(GdbLaunchDelegate.java:101)
	at org.eclipse.cdt.dsf.gdb.launching.GdbLaunchDelegate.launch(GdbLaunchDelegate.java:90)
	at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:885)
	at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:739)
	at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1039)
	at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1256)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Comment 1 Harry Coin CLA 2020-08-21 13:14:19 EDT
CDT debugging is entirely broken on the latest Ubuntu LTS release.  No matter what other settings I can think of, 9 of 10 times every attempt to launch the debugger fails with:

Could not determine GDB version using command: gdb --version

I can put in the whole fully qualified path to the debugger, same thing.  I can create a profile for the program, same thing.  I can put in a blank gdbinit and a path to that, same thing. I can run eclipse as super user, same thing.