0

Having difficulties running GDB with Eclipse CDT on Mac OS X Mojave.

When I try to debug the project, GDB behaves chaotic: I am able to debug a few times, but then it starts stalling at the begining of the next debug session with the message "Configuring GDB".

Executable is /Users/jd/Work/myapp.

When I list the processes ps -al I see there are hanging processes:

/Users/jd/Library/Caches/gdb/bin/bash -c exec /Users/jd/Work/myapp  
/Users/jd/Library/Caches/gdb/bin/bash -c exec /Users/jd/Work/myapp   
/Users/jd/Library/Caches/gdb/bin/bash -c exec /Users/jd/Work/myapp
/Users/jd/Work/myapp    
/Users/jd/Library/Caches/gdb/bin/bash -c exec /Users/jd/Work/myapp
/Users/jd/Library/Caches/gdb/bin/bash -c exec /Users/jd/Work/myapp
/Users/jd/Work/myapp
/usr/local/bin/gdb --interpreter mi2 --nx
/usr/local/bin/gdb --interpreter mi2 --nx
/usr/local/bin/gdb --interpreter mi2 --nx
/usr/local/bin/gdb --interpreter mi2 --nx

What could be the problem? Is it GDB or Bash?

Edit

The hanging myapp processes have a TXs+ state, which, according to man pspage means:

  • T, marks a stopped process
  • X, the process is being traced or debugged
  • s, the process is a session leader
  • "+", the process is in the foreground process group of its control terminal

The hanging ggdbprocesses have a state:

  • S, process that is sleeping for less than about 20 seconds (never turns to I, which means it sleeps more than 20 seconds, idle.)
Danijel
  • 8,198
  • 18
  • 69
  • 133
  • 4
    It could also be Eclipse for all we know. – n. m. could be an AI Oct 10 '19 at 10:16
  • Are you sure that your app quit? – the busybee Oct 10 '19 at 11:15
  • @thebusybee App is simple "hello world". – Danijel Oct 11 '19 at 07:16
  • Eclipse has a view to show all running debuggees. Normally this marks all your tries as finished, but this might be different here. – the busybee Oct 11 '19 at 07:23
  • Did you search for the issue(s) with GCC on Mojave? In the past time I read about several problems with this combination, on SO, too. Because I don't have a Mac I didn't save the URLs. – the busybee Oct 11 '19 at 07:26
  • @thebusybee How could it be GCC? I mean the same app once executes OK, and the next time not, without recompiling. – Danijel Oct 14 '19 at 06:29
  • Well, it could be the combination of GCC and GDB, or GDB and Eclipse, or GCC compiled application run from Eclipse, I don't know. I just remember that the keyword "GCC" was involved. – the busybee Oct 14 '19 at 06:34
  • @thebusybee What did you mean by "running debuggees"? What is the exact location on the menu `Window/ShowView/`? – Danijel Oct 14 '19 at 06:38
  • It's the "Debug" view. If you don't find this view directly in the menu, open "Other..." in the menu. – the busybee Oct 14 '19 at 06:43
  • Yes, I ment in the "Other...", did you mean "Debugger Console" or something else? – Danijel Oct 14 '19 at 06:48
  • I'd try to use `gdb` directly from a terminal. – AProgrammer Nov 20 '19 at 16:34
  • 1
    Try not using Eclipse. – S.S. Anne Nov 20 '19 at 19:35
  • `MacOS` doesn't use `gdb` (not since Mavericks), it uses `lldb`. If you've installed `gdb` on your own then you should provide all that info in the question. – l'L'l Nov 21 '19 at 09:04
  • I have experienced a similar issue, After starting GDB, used to see messages like, "launching gdb aborting configuring gdb." My environment was Mac with Eclipse + gdb (ggdb downloaded from macports). Solution that worked for me was to start eclipse as root. Found it somewhere in SO some time ago! – Vignesh Vedavyas Nov 25 '19 at 12:48
  • If the above comment fixed the issue then you can use this answer to the question below to make sure that you don't have to use sudo every time in eclipse, https://stackoverflow.com/questions/37982876/mac-c-mars-eclipse-gdb-debug-hangs-at-launching-test-96/38882835#38882835 And this was of course the reason :) – Vignesh Vedavyas Nov 25 '19 at 12:56

1 Answers1

0

From the details in the question and from my past experience of a similar issue this is all I have for you,

After starting GDB, I saw a message, "launching gdb aborting configuring gdb." My environment was Mac with Eclipse + gdb (ggdb downloaded from macports).

Temporary solution that worked for me was to start eclipse as root.

To fix the issue permanenty, Use the below link to see how to create a certificate or cross check if already configured,

Mac C++/Mars eclipse gdb debug hangs at Launching Test 96%

If my response above and link were not helpful then try the below eclipse forum to check and compare your problems to others posted and see if you can identify and curate the question further with more relevant info.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=509737

Vignesh Vedavyas
  • 369
  • 2
  • 10