I am using Eclipse on a Windows system (64-bit) for C++ code and the compiler is GCC/G++. I have created a .exe and in the end it is showing as amd64/le, and I am not able to debug. When I am trying to debug, I am getting the error as
Error while launching command: gdb —version
CreateProcess error=2, The system cannot find the file specified
- Can you please let me know what is that amd64/le?
- What is need to be done to debug?
asked Jul 26, 2016 at 13:48
You can have a look at this link. It helped me solve this problem just now,
The steps to follow are:
- Select Debug Configurations
- and click the Debugger tab
- now choose a GDB debugger by clicking Browse and selecting
gdb.exe
from the «bin» folder of your MinGW folder. Ifgdb
is not present, navigate the command prompt to the bin folder and runmingw-get.exe install gdb
.
(Mostly it should be in something like C:Min_GW
).
IAbstract
19.5k15 gold badges96 silver badges144 bronze badges
answered Dec 19, 2016 at 10:10
werber bangwerber bang
1733 silver badges11 bronze badges
1
AMD64/LE shows architecture / endianness. In your case architecture is X86-64 alias AMD64 and endianness is little (fixed on x86[64]).
As for your error message. It is possible that you did not install GDB when you installed your toolchain. Verify that you have it installed.
It is also possible that you have bumped into this bug. Workaround is to check your path and remove any instances of ;; (like for example in c:;;d:, which is valid for most uses, but eclipse/cdt has issues with it).
answered Jul 27, 2016 at 7:02
dbrank0dbrank0
8,7362 gold badges40 silver badges55 bronze badges
1
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
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
-
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: CKiamy and 32 guests
If you work on a Mac OS X 10.9 Mavericks or later, you will run into
the problem of Eclipse refusing to interactively debug problems that
otherwise build and run fine:
An attempt to start a debugging session by selecting
from the menu will result in Eclipse complaining that an
Error with command: gdb —version
has occurred.
The problem is caused by Apple switching away from GDB, the GNU
debugger, to LLDB, the LLVM debugger, in their Xcode toolchain (along
with the transition from GCC to Clang). Unfortunately, Eclipse is not
capable of communicating with any debugger other than GDB (yet).
Here is a step-by-step guide for installing and configuring GDB.
Installing GDB
As with GCC, the easiest way to install GDB is through Homebrew.
In a Terminal window, run the command
brew install gdb
,
and wait for it to complete.
(As usual, it may ask for your password.)
Now, we need to code-sign the GDB executable, so it will be allowed to
control other processes, as necessary for a debugger.
For that, we will first create a new certificate in Keychain.
Creating a Certificate
Open the Keychain Access application (can be found in
Applications/Utilities directory or through Spotlight).
Select in the application menu
().
An assistant window will appear for guiding you through the process.
-
First, you will be asked for the name and type of the certificate.
You may choose the name arbitrarily, but to simplify its future use in
command line, prefer names without spaces or other fancy characters,
e.g.,gdbcert
. -
Make sure that
is set to ,
change
to ,
check the
checkbox, and click .
Click again in the popup
prompt warning about the certificate being self-signed. -
On the next page, leave
to be 1, and set
to a large enough number of days to cover the duration of the class
or more, say, 365.
(Certificates cannot last forever; the maximum validity period
is 20 years.) -
Then click once again, and keep
doing so to skip the next six screens until you see the one entitled
.
For the only property, , choose
from the drop-down list.
Lastly, click , type in your
password, if prompted, and click . -
Back in the main window, choose the
keychain in the sidebar on the left, and select the newly created
certificate from the list.
Open the context menu and select
.
In the information window that will appear, expand the
section and set the
property to
.
Close this window (you may be asked for your password),
and quit Keychain Access.
Signing GDB
Our new certificate is now ready to be used.
In order to make it immediately available for signing, we need to
restart the Taskgate access-control service.
You can use Activity Monitor to do this (also found in
Applications/Utilities).
Open it and filter the list of processes by typing
taskgated
in the search field in the toolbar.
(If you cannot find it, make sure the menu item is checked.)
There should be exactly one process left in the list.
Highlight it, then select
from the menu, and click
in the popup prompt.
The Taskgate process will be terminated and, consequently, should
disappear from the list.
In a few seconds, it will be restarted by the system and should
reappear in the list. Please wait for this to happen (it may take up to
a minute or two, at worst).
Finally, in a Terminal window, run
codesign -s gdbcert /usr/local/bin/gdb
(if you named your certificate differently, replace
gdbcert
with its name here).
Once again, you will be prompted for you username and password.
If the command does not produce any output, then GDB is
successfully signed.
Configuring Eclipse
The only thing left to do is to point Eclipse to the GDB executable.
Open from the
main menu (not to be confused with
).
In the tree of options listed in the sidebar, navigate to
, and set
the field to
/usr/local/bin/gdb
.
If there is no section
in the subtree,
close the preferences window, and try to first start a debugging
session for any project that you can already run without problems.
You can do it by either clicking the
button on the toolbar, or selecting
from the main menu.
This attempt will, of course, fail with an error message about
the gdb
command, but it will force
the said
settings to appear in the preferences.
This will change the GDB executable for new projects; for all existing
ones (that you are going to use debugging for), you will need to
manually update their debug configurations.
To do that, select
from the menu.
In the window that appears, one after another, select every project
under the section in
the sidebar.
For each of them, open the tab,
set the field to the same path
/usr/local/bin/gdb
, and click the
button.
After repeating this change for all listed projects, click .
❦
If the above steps do not solve the issue on your machine, or you
encounter a problem while following them, please do not hesitate to
come to one of the upcoming common labs for help.
У меня есть проект C ++, импортированный в Eclipse CDT. Я могу собрать и запустить проект, используя Makefile и настройки аргументов. Однако, когда я попытался добавить точку отладки и запустить «debug as local c / c ++ application», он выдает ошибку "Launching projectName" has encountered a problem. Error with command gdb --version
Расширяя Детали, это дает: Error with command: gdb --version
Cannot run program "gdb": Unknown reason
Я установил GDB Macports раньше. Если я введу команду ggdb
возвращает информацию о версии. Если я наберу which ggdb
, это дает /opt/local/bin/ggdb
, Я пытался добавить «PATH» для отладки конфигурации -> переменных окружения и указать для него значение пути, но это не сработало. Как я должен установить путь и связать путь, пожалуйста? И каким должно быть имя переменной.
Версия GDB на моей машине — GNU GDB (GDB) 7.7.1
Добавлено: я посмотрел вверх which ggdb
и использовал ссылку, предоставленную Джеймсом, чтобы изменить отладчик gdb для перехода по этому пути. Но это не сработало до сих пор.
Благодарю.
13
Решение
Похоже, Eclipse использует по умолчанию gdb
это было в системе до того, как вы установили ggdb
из макпорта. это ссылка на сайт показывает, как изменить настройки отладчика, измените его на ggdb
это имя Макпорт использует.
После установки ggdb
из Macports вам нужно будет подписать его сертификатом, чтобы иметь возможность контролировать другие процессы, взгляните на «Сертификация GDB» Вот. После создания сертификата убедитесь, что вы выбрали правильное имя при подписании:
$ codesign -s gdb-cert $(which ggdb) /// 'ggdb'
3
Другие решения
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
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
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
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
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
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
Check as well in the debugger launch configuration if the settings are correct:
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
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
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
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 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
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
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
Also check in the debugger launch configuration to see if the settings are correct:
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
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
You can fix this by specifying the full path to gdb. You can do this separately for each debug configuration, and you can also set the default gdb location in the preferences under C/C++ > GDB. For example, if you installed gdb via Homebrew, then it’s probably located under /usr/local/bin
:
And here’s a screenshot of the Preferences:
I still don’t know why Eclipse can’t find GDB even though it is on my path. I guess it doesn’t use my .bash_profile
or my .bashrc
? You could try symlinking gdb into /usr/bin
. Maybe Eclipse will look there.
Edit: I tried the symbolic link idea and now Eclipse can debug, but it crashes inexplicably while doing so! So, I guess… don’t do that?
answered Jan 24 ’14 at 2:33
This guide from a UC Irvine Computer Science professor’s page is a very well-written, detailed, and Mac-specfic description of all the steps involved in installing GDB, creating a certificate, signing GDB using that certificate, and finally configuring Eclipse. I was found this very helpful as someone unfamiliar with each of these steps.
GDB Installation on Mac OS X
answered Jul 18 ’16 at 3:51
I had the same problem. I solved it by:
- Install a gdb — ( I used 7.8.1) — compile and install it. It got installed in
usr/local/bin
- Codesigning certificate
- Open eclipse executable using
sudo
. Otherwise I still get the error.
I am on OS X.
Hope this helps.
answered Dec 7 ’14 at 0:52
I had this error too now, and spent more than an hour looking for it.
In my case, the path was correct, and eclipse seemed to fail to start «any» executable as debugger. (I tested with gksudo cat, but it clearly never got to effectively running it).
The final reason was that I had put in my eclipse.ini -Xms1G and -Xmx1G. It seemed to already use the full memory for the indexer, and trying to allocate some more memory to start the debugger failed with an «unkown» error. Removing the memory limitations fixed the issue.
Hope this helps someone
answered Jan 21 ’16 at 11:57
Mac OS Sierra 10.13.6 gdb 8.0.1
had the same error as topic-starter.
first, I set the path as Neil Traft (here in the answers) explains to usr/local/bin/gdb;
But it didn’t work.
I found these instructions:
https://gist.github.com/gravitylow/fb595186ce6068537a6e9da6d8b5b96d
and I discovered that I already had gdbcert1 in my System. So I followed everything from 7. Works!
answered May 31 at 9:16
Not the answer you’re looking for? Browse other questions tagged c++ eclipse macos gdb or ask your own question.
У меня есть проект С++, импортированный в Eclipse CDT. Я могу создать и запустить проект с использованием параметров Makefile и параметров. Однако, когда я попытался добавить точку отладки и запустить «debug как локальное приложение c/С++», это порождает ошибку "Launching projectName" has encountered a problem. Error with command gdb --version
Расширяя Детали, он дает: Error with command: gdb --version
Cannot run program "gdb": Unknown reason
Я установил gdb в Macports раньше. Если я введу команду ggdb
, она вернет информацию о версии. Если я набираю which ggdb
, он дает /opt/local/bin/ggdb
. Я попытался добавить «PATH» для отладки конфигурации → переменных окружения и указать для него значение пути, но это не сработало. Как мне установить путь и связать путь, пожалуйста? И каково должно быть имя переменной.
Версия gdb на моей машине — GNU gdb (GDB) 7.7.1
Добавлено: Я посмотрел which ggdb
и использовал ссылку Джеймса, чтобы изменить отладчик gdb, чтобы перейти к этому пути. Но это не сработало.
Благодарю.