10

Trying to setup remote gdb debugging in eclipse. When I try to debug I get:

 Error in final launch sequence
 Failed to execute MI command: -target-select remote LOCALHOST:2345
 Error message from debugger back end:
  LOCALHOST:2345: Connection timed out.
  LOCALHOST:2345: Connection timed out.

My gdb debugger is set up correctly

 /carambola/carambola/build_dir/toolchain-mipsel_r2_gcc-4.6-linaro_uClibc-0.9.33.2/gdb-linaro-7.2-2011.03-0/gdb/gdb

(when executing this I can get gdb shell)

Any idea what I am doing wrong ?

7 Answers 7

13

This happens if the gdb client ( inside eclipse ) is not compiled for the same architecture as the gdb server. Setting the correct gdb in eclipse debugging solved this issue.

2
  • 1
    Can you please suggest the steps to correct the gdb setting.
    – kapilddit
    Nov 19, 2015 at 9:20
  • 1
    @kapilddit open edebug settings --> Debugger --> Main Tab --> Browse to gdb compiled for the same platform ( it is usually part of the toolchain for that platform ) . For example, this is how remote debugging is configured for debugging c++ program on a raspberry pi : i.imgur.com/z4Ul4or.png Nov 20, 2015 at 1:53
1

Switched to Debug view (upper right button), then in the top menu bar towards the left I clicked the red box Terminate button. Then I was able to launch debug again.

1

The connection is using localhost instead of the remote host. To correct, in eclipse go to

Run->Debug Configurations..

Here choose the Debugger tab, inside there are three additional tabs (Main, Shared Libraries, Connections). In "Connections" you can give the proper IP for the remote machine.

1
  • Yes, if gdb cannot reach the remote machine (which is running gdbserver) due to many various reasons, you could get this error message.
    – wisbucky
    Jun 27, 2018 at 21:35
1

I am using Eclipse and bellow is how I managed to fix it when it happens.

  1. At the most top right corner of your IDE click on the debug button (debug button) to view the debug mode.
  2. Once in the debug mode, Right click on where project tree is (usually in the left most column) (Project tree)
  3. Select "terminate and remove"
  4. Rebuild your code
0

I tried changing my workspace to the main folder where the project is placed and checked if my ST Link device was scanned (debug configurations) and checked if under run configurations, under main, the .elf file was selected under c/c++: Then my code started working. Hope this helps

0

I have had the same problem, searched here, but the solution was: The ...\Cygwin\bin was not in the system's PATH. I think gdb was not found.

set PATH=C:\pathto\Cygwin\bin;%PATH% 

before start of eclipse was helpfull (set PATH and start eclipse.exe in a batch file). But the compiler were found (gcc, g++), I don't know why. It may be that the compiler should match to the debugger gdb, see answer above.

-1

This issue is created because of two reason:

  1. If break point is enabled, go to Run and skip breakpoint.
  2. If debug device is not set correctly, go to Debug configure as and check for Debugger option is filled correctly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.