Community
Participate
Working Groups
Hi, I managed to install gdb via home brew on sierra 10.12.2 and I codesigned it. Now I can run via command line the build executable from eclipse inside the debug folder. But when I try to run it directly inside eclispe it hangs at 62% saying: Launching: Initializing debugger services. When I check the processes with top I can see that gdb is running so it has been called and it is the correct one. But then it does not continue.
Ah my eclipse cdt version is NEON.2
Stopping the debug process fails and the gdb process remains in the top list.
What are the arguments passed to the GDB executable when it was started?
The gdb at the shell is called just with the program name and afterwards run to start the program. Inside eclipse the gdb is called just with ".gdbinit" which is empty.
You mentioned you can see the GDB started by eclipse when using top. I'd like to know the command line options for that GDB. On Linux you can do ps -ef | grep gdb Maybe it also works on Mac.
ok, the output is the follwing: 501 1005 1 0 Tue09PM ?? 0:00.05 /usr/local/Cellar/gdb/7.12_1/bin/gdb armadillaTest 501 3615 3385 0 5:26PM ttyp2 0:00.04 /usr/local/Cellar/gdb/7.12_1/bin/gdb --interpreter mi2 --nx -q --interpreter console -ex new-ui mi /dev/ttyp1 -ex set pagination off -ex show version 501 3634 3618 0 5:26PM ttys000 0:00.00 grep gdb
The same project with the same debugger is running under eclispe mars with the following command output: 501 1005 1 0 27Dec16 ?? 0:00.05 /usr/local/Cellar/gdb/7.12_1/bin/gdb armadillaTest 501 24936 24924 0 1:05PM ?? 0:00.09 /usr/local/Cellar/gdb/7.12_1/bin/gdb --interpreter mi2 --nx 501 24961 24611 0 1:06PM ttys000 0:00.00 grep gdb Why has the call changed?
(In reply to Constantin Wiesener from comment #6) > ok, the output is the follwing: > > /usr/local/Cellar/gdb/7.12_1/bin/gdb --interpreter mi2 --nx -q --interpreter > console -ex new-ui mi /dev/ttyp1 -ex set pagination off -ex show version These new arguments are used to trigger the new full GDB console (https://wiki.eclipse.org/CDT/User/NewIn92#Full_GDB_Console) We are now able to reproduce the hanging issue on Mac. The problem seems to be that GDB 7.12 does not accept commands until the console is created in CDT, but that CDT needs to send an MI command before creating the console. This does not happen on Linux. We're looking into how to get this fixed properly. Sadly, this means GDB 7.12 cannot be used with CDT 9.3 on Mac. I recommend using GDB 7.11 until a fix is available.
*** Bug 509702 has been marked as a duplicate of this bug. ***
(In reply to Marc Khouzam from comment #8) > Sadly, this means GDB 7.12 cannot be used with CDT 9.3 on Mac. > I recommend using GDB 7.11 until a fix is available. Another way to workaround this is to pretend GDB 7.12 is actually version 7.11 as suggested by Norbert Lange in https://bugs.eclipse.org/bugs/show_bug.cgi?id=509812#c0
Hi, I definitely do not think that this is the issue because when I use the same gdb 7.12 under mac osx with eclipse mars I can debug without a problem. This what I was commenting before. So could you please check if you could run the test with eclipse mars and gdb 7.12 on a MAC. Best regards, Constantin
(In reply to Constantin Wiesener from comment #11) > So could you please check if you could run the test with eclipse mars and > gdb 7.12 on a MAC. It worked with the version of CDT that came with Mars because this version did not have support for the full GDB console yet. In fact, you could run Eclipse *Platform* 4.6.2 (Neon.2) and CDT 9.1 (slightly older than latest) and it would work. If you want to do that, you can download the Eclipse Platform here: https://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops4/R-4.6.2-201611241400/eclipse-platform-4.6.2-macosx-cocoa-x86_64.tar.gz then install CDT 9.1 (Install new software) using this update site: http://download.eclipse.org/tools/cdt/releases/9.1/
Funny story running gdb7.11 under sierra 10.12.2 does not work because the gdb throws: During startup program terminated with signal SIG113, Real-time event 113. Even at the console the same problem happens. That's why I moved to 7.12_2 Did you already opened up a bug at gdb.
New Gerrit change created: https://git.eclipse.org/r/88189
(In reply to Constantin Wiesener from comment #13) > Funny story running gdb7.11 under sierra 10.12.2 does not work because the > gdb throws: > > During startup program terminated with signal SIG113, Real-time event 113. > > Even at the console the same problem happens. That's why I moved to 7.12_2 > Did you already opened up a bug at gdb. You will then either need to use GDB 7.10 or use the version spoofing trick: https://bugs.eclipse.org/bugs/show_bug.cgi?id=509812#c0 There will be a release of CDT 9.2.1 which will fix this problem, but it will only be available in March.
Gerrit change https://git.eclipse.org/r/88189 was merged to [master]. Commit: http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=6adc3c29a61c628b4268675e7c5d89e488cf4f96
New Gerrit change created: https://git.eclipse.org/r/88203
Gerrit change https://git.eclipse.org/r/88203 was merged to [cdt_9_2]. Commit: http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=fed5bbe01e6c64591e424f5e70c5404e8d727e30
The full console is disabled for Mac on the cdt_9_2 and master branches for now. At least the next releases won't freeze (9.2.1 in March). But we'll try to re-enable it by then.
After further investigation, GDB on Mac does not support MI asynchronous communication, which is necessary for the full GDB console; without it, it is not possible to interrupt the inferior. Therefore, until MI async support is added to GDB for Mac, we will need to keep the full console disable for Mac.
(In reply to Marc Khouzam from comment #20) > After further investigation, GDB on Mac does not support MI asynchronous > communication, which is necessary for the full GDB console; without it, it > is not possible to interrupt the inferior. > > Therefore, until MI async support is added to GDB for Mac, we will need to > keep the full console disable for Mac. Mac as a host or Mac as a target? Let me check if our cross debugger for QNX on Mac sees the same issue.
(In reply to Doug Schaefer from comment #21) > (In reply to Marc Khouzam from comment #20) > > After further investigation, GDB on Mac does not support MI asynchronous > > communication, which is necessary for the full GDB console; without it, it > > is not possible to interrupt the inferior. > > > > Therefore, until MI async support is added to GDB for Mac, we will need to > > keep the full console disable for Mac. > > Mac as a host or Mac as a target? Let me check if our cross debugger for QNX > on Mac sees the same issue. I do not see any issue on the Mac with our 7.12 qnx gdb cross debugger. Actually works pretty good :). So please be careful how you turn this off. Thank!
Oh, it's already turned off, never mind. :) And we override the backend anyway. Carry on.
(In reply to Doug Schaefer from comment #21) > Mac as a host or Mac as a target? Let me check if our cross debugger for QNX > on Mac sees the same issue. MI asynchronous communication is on the host only, from CDT to GDB. The communication from GDB to gdbserver seems independent of that.
(In reply to Marc Khouzam from comment #8) > (In reply to Constantin Wiesener from comment #6) > > ok, the output is the follwing: > > > > /usr/local/Cellar/gdb/7.12_1/bin/gdb --interpreter mi2 --nx -q --interpreter > > console -ex new-ui mi /dev/ttyp1 -ex set pagination off -ex show version > > These new arguments are used to trigger the new full GDB console > (https://wiki.eclipse.org/CDT/User/NewIn92#Full_GDB_Console) > > We are now able to reproduce the hanging issue on Mac. > > The problem seems to be that GDB 7.12 does not accept commands until the > console is created in CDT, but that CDT needs to send an MI command before > creating the console. This does not happen on Linux. We're looking into how > to get this fixed properly. > > Sadly, this means GDB 7.12 cannot be used with CDT 9.3 on Mac. > I recommend using GDB 7.11 until a fix is available. How do I change it?
(In reply to Mordechay Sternlicht from comment #25) > How do I change it? I personally don't know much about Macs, so I can't help on that point. However, you can install a newer CDT instead, where we fixed the issue. The 9.2.1 release will be available officially March 23rd, but if you want it right now you can upgrade your installation using the following update site: http://download.eclipse.org/tools/cdt/builds/neon/milestones/ur3-rc4 or download the zip file and install from there zipfile: http://download.eclipse.org/tools/cdt/builds/neon/milestones/ur3-rc4/cdt-9.2.1rc4.zip
Created attachment 267344 [details] Error (In reply to Marc Khouzam from comment #26) > (In reply to Mordechay Sternlicht from comment #25) > > > How do I change it? > > I personally don't know much about Macs, so I can't help on that point. > > However, you can install a newer CDT instead, where we fixed the issue. > The 9.2.1 release will be available officially March 23rd, but if you want > it right now you can upgrade your installation using the following update > site: > > http://download.eclipse.org/tools/cdt/builds/neon/milestones/ur3-rc4 > > or download the zip file and install from there > > zipfile: > http://download.eclipse.org/tools/cdt/builds/neon/milestones/ur3-rc4/cdt-9.2. > 1rc4.zip I am still with problems. I installed cdt-9.2.1 and now I get "Error in final launch sequence". I did it: 1- brew install gdb (7.12.1) 2- create gdb-cert on keychain Access 3- echo "set startup-with-shell off" >> ~/.gdbinit 4- codesign -s gdb-cert /usr/local/Cellar/gdb/7.12.1/bin/gdb 5- eclipse installer > eclipse IDE for C/C++ 6- debugger config -> Debugger -> GDB Debugger: /usr/local/Cellar/gdb/7.12.1/bin/gdb 7- Run debug: Crash on 62% 8- Help -> Install new software -> http://download.eclipse.org/tools/cdt/builds/neon/milestones/ur3-rc4 9- Download and install CDT 9.2.1. Then, Restart eclipse 10- Run debugger again 11- Error: "Error in final launch sequence Failed to execute MI command: -exec-run"
(In reply to Victor Catão from comment #27) > I am still with problems. I installed cdt-9.2.1 and now I get "Error in > final launch sequence". Hi Victor. Are you using Sierra (10.12) ? If so, you're probably seeing https://sourceware.org/bugzilla/show_bug.cgi?id=20266 You can try to do "set startup-with-shell off" in a .gdbinit but for me it hasn't helped that much.
(In reply to Marc-André Laperle from comment #28) > (In reply to Victor Catão from comment #27) > > I am still with problems. I installed cdt-9.2.1 and now I get "Error in > > final launch sequence". > > Hi Victor. Are you using Sierra (10.12) ? If so, you're probably seeing > https://sourceware.org/bugzilla/show_bug.cgi?id=20266 > You can try to do "set startup-with-shell off" in a .gdbinit but for me it > hasn't helped that much. Yes. More specifacally Sierra 10.12.3 I made a .gdbinit on ~/ with "set startup-with-shell off". But it also doesn't works :/
i've had similar problem, it was because eclipse wasn't using .gdbinit from my home folder, i've change gdbinit path in debug config to ~/.gdbinit from .gdbinit and it worked fine. (on CDT 9.2.1 and sierra)