Error with command gdb version cannot run program gdb launching failed

Espressif ESP32 Official Forum

Alen59

Posts: 25
Joined: Mon Mar 19, 2018 12:00 pm

Error with command: gdb —version

Hi,

i can run debugger using command line but i can’t run it using eclipse, i get the following error, could you please help, i attached my eclipse debugger configuration snapshot

Error with command: gdb —version
Cannot run program «gdb»: Launching failed

Attachments
eclipse debugger setting.pdf
(73.42 KiB) Downloaded 992 times


ESP_igrr

Posts: 1969
Joined: Tue Dec 01, 2015 8:37 am

Re: Error with command: gdb —version

Postby ESP_igrr » Sat Dec 15, 2018 9:19 am

The screenshots are of two different debugging configuration wizards. First two pages are from GDB Hardware Debugging, which is the correct one to use. However the last screenshot is for some different debugging configuration, which you seem to be launching. At least, it has «gdb» as the debugger, which matches the error message you are getting.
You need to launch «gdb hardware debugging» configuration (i.e. the one set up by the first two screens).


Alen59

Posts: 25
Joined: Mon Mar 19, 2018 12:00 pm

Re: Error with command: gdb —version

Postby Alen59 » Tue Dec 18, 2018 1:15 pm

ok thanks, if i use the first one, these are the error i get

Error in final launch sequence
Failed to execute MI command:
-target-select remote localhost:3333

Error message from debugger back end:
localhost:3333: The system tried to join a drive to a directory on a joined drive.
localhost:3333: The system tried to join a drive to a directory on a joined drive.


ESP_igrr

Posts: 1969
Joined: Tue Dec 01, 2015 8:37 am

Re: Error with command: gdb —version

Postby ESP_igrr » Tue Dec 18, 2018 1:22 pm

Is OpenOCD program running at the time you are trying to start GDB? Did you get any prompts from Windows firewall about allowing OpenOCD to open ports?


Alen59

Posts: 25
Joined: Mon Mar 19, 2018 12:00 pm

Re: Error with command: gdb —version

Postby Alen59 » Tue Dec 18, 2018 1:57 pm

sorry i did not know i need to run OpenOCD when running eclipse debugger, i just did and now i am getting the following error

Error in final launch sequence
Reset command not defined for device ‘Generic TCP/IP’


Alen59

Posts: 25
Joined: Mon Mar 19, 2018 12:00 pm

Re: Error with command: gdb —version

Postby Alen59 » Tue Dec 18, 2018 2:24 pm

ok, when i removed check marks in startup tab from «RESET» and «delay and Halt» it seems solved the problem


Who is online

Users browsing this forum: Bing [Bot], ghost23, spadespwnz and 37 guests

Diana Popova wrote on Wed, 23 September 2015 21:44

Eclipse Luna on Mac Yosemite, CDT, XCode7.
HelloWorld with makefile:
— Copied from Eclipse Tutorial main.cpp and makefile for HelloWorld;
— Ran ‘Build Project’ and got the console:
»
11:39:25 **** Build of configuration Debug for project HelloWorldMakefile ****
make all
Building file: ../main.cpp
Invoking: GCC C++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF»main.d» -MT»main.d» -o «main.o» «../main.cpp»
Finished building: ../main.cpp

Building target: HelloWorldMakefile
Invoking: MacOS X C++ Linker
g++ -o «HelloWorldMakefile» ./main.o
Finished building target: HelloWorldMakefile

11:39:25 Build Finished (took 330ms)
»
— Tried to run Debug, and got the error that ‘gdb’ cannot run.
Question:
Why no .exe file was built?

1. The run files on OS X are not .exe files, but files without a specific extension.

2. The XCode packege does not use GDB as standard debugger. You have to install it into the system separately.

3. It seems that your run firl has been built under the name HelloWorldMakefile.

Источник

Error with command gdb version eclipse

Community

Participate

Eclipse IDE

Breadcrumbs

Home » Language IDEs » C / C++ IDE (CDT) » Error while launching command: gdb —version

Error while launching command: gdb —version [message #1155311] Fri, 25 October 2013 21:02
Jamie Lahowetz
Messages: 3
Registered: August 2013
When I try to debug i get this error:
Error while launching command: gdb —version

If I change the path to the debugger it will run but it skips lines and «step over» doesnt seem to work all the time.

If I type the same into the console I get this:
jlahowetz2@snr-1770 /usr/bin $ gdb —version
GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type «show copying»
and «show warranty» for details.
This GDB was configured as «x86_64-linux-gnu».
For bug reporting instructions, please see:

I’m using Eclipse Kepler

Re: Error while launching command: gdb —version [message #1202600 is a reply to message #1155311] Fri, 22 November 2013 08:13
Ben Alex
Messages: 2
Registered: November 2013

I’m also getting the following error while launching the debugger.

Error while launching command: gdb —version

Please help if anybody knows the solution.

Re: Error while launching command: gdb —version [message #1207011 is a reply to message #1155311] Sun, 24 November 2013 10:36
Matteo Olivi
Messages: 1
Registered: November 2013
I am experiencing the very same problem, please someone help us.

The only difference is that I am using Eclipse on a Mac OS X 10.9

I can run programs normally, but whenever I try to debug them I get this message: error while launching command: gdb —version.

If I try to run that command from terminal it states that the command could not be found, but i can see all the gdb settings on Eclipse so It should be installed.

Re: Error while launching command: gdb —version [message #1219077 is a reply to message #1209023] Sun, 01 December 2013 05:27
Ben Alex
Messages: 2
Registered: November 2013
I have already installed gdb from cygwin and if I use the command in cygwin terminal

$ gdb —version
GNU gdb (GDB) 7.6.50.20130728-cvs (cygwin-special)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later

So I don’t think its an issue with installation. may be the path .

Источник

Error with command gdb version eclipse

Community

Participate

Eclipse IDE

Breadcrumbs

Home » Language IDEs » C / C++ IDE (CDT) » Can’t debug on Eclipse C/C++ on Windows ( «Error while launching command: gdb —version»)

Can’t debug on Eclipse C/C++ on Windows [message #499346] Sat, 21 November 2009 00:41
yyy
Messages: 2
Registered: November 2009
I’ve just installed Eclipse on Windows XP and when I click the debug buttons I get the following message: «Error while launching command: gdb —version»

Any idea what the problem could be?

[Updated on: Sat, 21 November 2009 00:42]

Re: Can’t debug on Eclipse C/C++ on Windows [message #544460 is a reply to message #499391] Fri, 02 July 2010 18:10
Issmail
Messages: 1
Registered: July 2010

Thank you for your explanation. It was util and helped me to solve a problem.

Re: Can’t debug on Eclipse C/C++ on Windows [message #646050 is a reply to message #499346] Tue, 21 December 2010 17:39
Janos Kutscherauer
Messages: 9
Registered: July 2009
Hello,
i’ve had the same 2 problems:
1. Eclipse Helios/CDT on Windows XP, and the error «Error while launching command: gdb —version».
2. No gdb.exe in «mingw/bin».

(I might have one day deleted the gdb.exe myself from that place to resolve conflicting paths with Cygwin or MSPGcc or something like that).

So here is how i solved it:
1. Re-installed MinGW: Downloaded and ran the installer from http://sourceforge.net/projects/mingw/files/Automated%20MinG W%20Installer/mingw-get/. I just overwrote my existing MinGw directory/installation.
2. Made sure, that «C:/MinGw/bin» is on the PATH. (tried typing «gdb» into the windows command prompt to verify that gdb.exe is there).
3. In the Eclipse Debug configuration, at the «Debugger» tab, i simply entered «gdb» as the «GDB debugger». Supplying the full path will of course also do.

Hope that helps,
Cheers
Janosch

Re: Can’t debug on Eclipse C/C++ on Windows [message #1818200 is a reply to message #499346] Tue, 10 December 2019 07:45
Saeed Almazrouei
Messages: 1
Registered: December 2019
Anyone installed MinGW (Windows), can get gdb.exe with the following:

  1. From «Start» menu go to «MinGW Installation Manager».
  2. Search in the «Package» list for «mingw32-gdb-bin» and mark it for installation.
  3. Go to «Installation» menu from the menu-bar choose «Apply Changes» in there.
  4. Again click on «Apply» button to proceed.

After that you will be able to find the gdb.exe.

As mentioned previously, don’t forget to add the «C:/MinGW/bin»(

Источник

Adblock
detector

If you prefer watching videos to reading articles, Cody Henrichsen has created a video walkthrough of this procedure.


With its new OS release, Apple has discontinued the use of GDB in OS X. Since 2005 Apple has steadily been moving away from the GNU toolchain in favor of LLVM. This means that Xcode now uses LLDB instead.

LLDB looks to be a very nice replacement for GDB, and I hope to use it in the future, but currently Xcode is the only graphical front-end that supports its use; pretty much every other debugging GUI uses GDB under the hood, including Eclipse. So, if you want to debug C/C++ code in Eclipse CDT on the Mac, you must install GDB.1

Here is the procedure that worked for me.2 Others have reported issues with this, so please do let me know in the comments if it doesn’t work for you.

Known Issues

GDB will not be able to breakpoint inside any template function, though it should be able to step into it. This problem may be resolved if you use the MacPorts installation procedure (below) but it may only work if you also compile with Apple’s GCC.

It was also reported in the comments that it cannot breakpoint into a shared library function. I have not confirmed this issue myself.

On OS X Yosemite, the MacPorts version will require some extra hoops to jump through. See below.

Installing GDB

You can install via MacPorts or Homebrew. MacPorts has Apple’s official GDB distribution, which is modified for OS X. This is probably the best option (thanks to CC’s comment for this tip). However, on my machine this only seems to work if the program is compiled using Apple’s GCC, which is no longer supported by Apple. All things being equal, I vastly prefer to avoid MacPorts altogether. So I installed with Homebrew, despite recommending MacPorts. If you have no preference either way, go with MacPorts.

Update for Yosemite users: I haven’t upgraded to Yosemite yet, but some folks have reported problems in the comments below (and for some, it worked fine). It seems that Apple’s GDB (the MacPorts install) is currently broken on Yosemite. If you know what you’re doing, you can apply the Portfile patch from this ticket. It seems like a bit of a pain, though, so you might switch to plain vanilla GDB, which can be installed with either MacPorts or Homebrew.

Install with MacPorts

  1. Install Xcode and MacPorts, if not already installed.
  2. Now install the Apple GCC and GDB from MacPorts:

    $ sudo port install gdbapple

    $ sudo port install applegcc42

  3. For the remainder of the tutorial, use /opt/local/bin/gdb-apple as the GDB executable
  4. Remember if you want breakpoints in template functions to work, you’ll need to change your compiler to g++-apple-4.2 instead of g++! This can be done in your Makefiles or in your IDE settings.

Install with Homebrew

  1. Install Xcode and Homebrew, if not already installed.
  2. Now install GDB from Homebrew:

    $ brew tap homebrew/dupes

    $ brew install gdb

  3. For the remainder of the tutorial, use /usr/local/bin/gdb as the GDB executable

If that worked, then lucky you! Getting it compiled is where many people seem to have trouble. Now you just need to sign it to give it permission to control OS X processes.

Certifying GDB

Open up the Keychain Access application (/Applications/Utilities/Keychain Access.app). Navigate via the menu to Keychain Access > Certificate Assistant > Create Certificate…

create-cert-menu

Enter a name for the certificate. For this how-to, I’ll call it «gdb-cert». Set the fields exactly as shown below.

create-cert-1

The maximum validity period is 999 days. I don’t really want to deal with this again, so I’m going to max it out.

create-cert-2

Keep clicking the «Continue» button until you are asked for a location. Set it to «System».3

create-cert-3

Success!

create-cert-4

Now make sure the cert is always trusted. Right-click the new certificate and select Get Info. Under the Trust section, set Code Signing to Always Trust.

cert-get-info

cert-always-trust

Now that we have a certificate, we need to use it to sign GDB. First, we’ll restart the taskgated process to make sure it picks up the new certificate. Quit Keychain Access (you must quit Keychain Access!) and return to the Terminal for these final commands.

Find the taskgated process.

$ ps e | grep taskgated

56822 ??         0:03.11 /usr/libexec/taskgated s

60944 ttys002    0:00.00 grep color=auto taskgated

The first number in the above output is the PID. Use this to kill the process (it will immediately restart itself).

Now you can finally code sign GDB.

# MacPorts version

$ codesign s gdbcert $(which gdbapple)

# Homebrew version

$ codesign s gdbcert $(which gdb)

Now you should be all set! The OS X Keychain may ask for your password the first time you attempt to debug a program, but it should work!

Getting it to Work with Eclipse

There’s one more step for Eclipse users. You need to specify where Eclipse can find the new GDB. Specify the path to GDB in Preferences > C/C++ > Debug > GDB:

eclipse-gdb-pref

If you already have some debug configurations, you may need to edit them individually to point to the correct place (under Run > Debug Configurations…):

eclipse-gdb-debug


  1. The CDT developers are planning to support LLDB, but they will have to write a whole new interface, and I think most of them only work on Eclipse in their spare time, so it will likely be at least some months before LLDB support is there.
  2. The procedure is derived from this StackOverflow post and this GDB Wiki page.
  3. If you are unable to save it to the System keychain, then save it to the login keychain. You can later export the cert, and then import it into the System keychain. I didn’t have to do this, so comment if you have any problem.

Three years ago I published “Debugging Failure: Check List and Hints” and unfortunately this article is one of the most popular ones: obviously debugging problems are very common. Debugging with GDB works usually fine, but if things are failing, then it can be hard to find the cause for it. Recently I have been asked to check some failures, so here are two more hints about what could go wrong…

Error while launching command: arm-none-eabi-gdb --version

Error while launching command: arm-none-eabi-gdb –version

I’m assuming a cross-debugging environment with Eclipse, the Eclipse GDB client and an external GDB server (see “GDB Client and Server: Unlocking GDB“) with the GNU MCU Eclipse plugins (although behaviour can be very similar for other combinations).

GDB Debugger Version

Debugger Console

Debugger Console

As a diagnostic hint: check the version of the debugger/gdb in the Debugger console view. Verify that this version matches what you *think* you are using.

One common problem is that cygwin or other tool chains are installed and have changed the global system path, and the wrong toolchain and GDB gets used. Mixing different GNU versions (compiler/debugger) is always a bad thing.

💡 see the next sections about which GNU tools are used.

Error while launching command: arm-none-eabi-gdb –version

Error while launching command: arm-none-eabi-gdb --version

Error while launching command: arm-none-eabi-gdb –version

If you get that error, this basically means that the gdb has not been found and cannot be launched.

Check your global toolchain folder if the gdb executable really exists in that path. Below is the setting for the machine:

Global Toolchain Folder

Global Toolchain Folder

There is the possibility to overwrite the global setting with a setting for the workspace. I keep it usually empty (so it uses the global setting), but check that path as well:

Workspace Toolchain Path

Workspace Toolchain Path

Lastly, there is setting for each project. If it is empty, then it uses the workspace setting. So check that project setting too:

Project Toolchain Path

Project Toolchain Path

Check as well in the debugger launch configuration if the settings are correct:

Debugger Launch Configuration

Debugger Launch Configuration

For the GDB Client executable, you might consider directly to point to the gdb executable to avoid any path search issues.

Global System Path used in Eclipse

The other thing to check is the global system path used by Eclipse when it launches an executable. You can find this in the screenshot below in the workspace settings:

System Path in Eclipse Workspace Settings

System Path in Eclipse Workspace Settings

With this, I hope you can find the problem. Otherwise have a read in the articles listed in the Links section below.

Happy Debugging 🙂

Links

  • Debugging Failure: Check List and Hints
  • Troubleshooting Tips for FreeRTOS Thread Aware Debugging in Eclipse
  • Board Bring-Up Tips, GDB Logs and Traces in Eclipse
  • Solving “Launching: Configuring GDB Aborting Configuring GDB”

Join the DZone community and get the full member experience.

Join For Free

Three years ago, I published “Debugging Failure: Checklist and Hints” and unfortunately, that article is one of my most popular ones: Obviously, debugging problems are very common. Debugging with GDB usually works fine, but if things are failing, then it can be hard to find the cause for it. Recently, I was asked to check some failures, so here are two more hints about what could go wrong…

Error while launching command: arm-none-eabi-gdb --version

Error while launching command: arm-none-eabi-gdb –version

For this post, I’m assuming a cross-debugging environment with Eclipse, the Eclipse GDB client, and an external GDB server (see GDB Client and Server: Unlocking GDB) with the GNU MCU Eclipse plugins (although the behavior can be very similar for other combinations).

GDB Debugger Version

Debugger Console

Debugger console

As a diagnostic hint: Check the version of the debugger/GDB in the debugger console view. Verify that this version matches what you think you are using.

One common problem is that cygwin or other toolchains are installed and have changed the global system path — leading to the wrong toolchain and GDB being used. Mixing different GNU versions (compiler/debugger) is always a bad thing.

Error While Launching the Command: arm-none-eabi-gdb –version

Error while launching command: arm-none-eabi-gdb --version

Error while launching the command: arm-none-eabi-gdb –version

If you get that error, this basically means that the GDB has not been found and cannot be launched.

Check your global toolchain folder to see if the GDB executable really exists in that path. Below is the setting for the machine:

Global Toolchain Folder

Global toolchain folder

There is the possibility to overwrite the global setting with a setting for the workspace. I usually keep it empty (so it uses the global setting), but check that path as well:

Workspace Toolchain Path

Workspace toolchain path

Lastly, there is the setting for each project. If it is empty, then it uses the workspace setting. So check that project setting, too:

Project Toolchain Path

Project toolchain path

Also check in the debugger launch configuration to see if the settings are correct:

Debugger Launch Configuration

Debugger launch configuration

For the GDB client executable, you might consider directly pointing to the GDB executable to avoid any path search issues.

Global System Path Used in Eclipse

The other thing to check is the global system path used by Eclipse when it launches an executable. You can find this in the screenshot below in the workspace settings:

System Path in Eclipse Workspace Settings

System path in Eclipse workspace settings

With this, I hope you can find the problem. Otherwise, read the articles listed in the Links section below.

Happy debugging!

Links

  • Debugging Failure: Checklist and Hints
  • Troubleshooting Tips for FreeRTOS Thread Aware Debugging in Eclipse
  • Board Bring-Up Tips, GDB Logs, and Traces in Eclipse
  • Solving “Launching: Configuring GDB Aborting Configuring GDB”

Eclipse

Понравилась статья? Поделить с друзьями:
  • Error wiping device failed to probe the device dev sdb udisks error quark 0
  • Error winsock h has already been included
  • Error winmain cpp 68
  • Error winhttp secure failure geekbench
  • Error winhttp name not resolved