Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Problems with GDB with Eclipse for C/C++ on MacOS & Windows(GDB 9.1, MacOS 10.15 or Windows 10.1909, Eclipse 2020/06, CDT 9.11.1.202004040713)
Problems with GDB with Eclipse for C/C++ on MacOS & Windows [message #1826503] Sun, 26 April 2020 04:09 Go to next message
Sam Warner is currently offline Sam WarnerFriend
Messages: 40
Registered: April 2020
Member
I found that >50% of the time when I attempt to debug, the system progress hangs. I'll keep debug as I have time.

When I hit the 'debug' button, the progress indicator will stall around 96%. The the debugger is started, and can be terminated or relaunched. Whether relaunched or using the 'debug' button, the % success is no better then 50% of the time. Once successful, the debugging session is 100% functional.

I've attached a list of the installed Eclipse components, a picture showing that I'm only using local debugging, and a picture showing the "debug" windows stalled and functioning processes.

Any suggestions on debugging further?

sw config
GDB 9.1, MacOS 10.15, Eclipse 2020/06, CDT 9.11.1.202004040713, Java 1.8.0_131-b11

[Updated on: Mon, 27 April 2020 04:41]

Report message to a moderator

Re: Problems with GDB with Eclipse for C/C++ on MacOS [message #1826546 is a reply to message #1826503] Mon, 27 April 2020 02:13 Go to previous messageGo to next message
Sam Warner is currently offline Sam WarnerFriend
Messages: 40
Registered: April 2020
Member
I am going to use the exact same software configuration on Windows and see if the Gdb - CDT/Eclipse is different in reliably starting.

Re: Problems with GDB with Eclipse for C/C++ on MacOS [message #1826552 is a reply to message #1826546] Mon, 27 April 2020 04:40 Go to previous messageGo to next message
Sam Warner is currently offline Sam WarnerFriend
Messages: 40
Registered: April 2020
Member
On Windows 10 (1909) with Java 8u241 and GDB 9.1-1 and the same Eclipse 2020-06 (CDT 9.11.1) release, I am consistently getting:

Error in final launch sequence:
Failed to execute MI command
-exec-run
Error message from debugger back end:
During startup program existed with code 0xc0000135

I'd say :) cool :) - cause

a) Eclipse / CDT launched GDB
b) seems to have tried a few MI commands
c) fails on the exec-run for unknown reason

I'd prefer to stick with MacOS, though, anyone know how to monitor the communication between Eclipse and GDB so I can see what's happening more (either OS)?

Re: Problems with GDB with Eclipse for C/C++ on MacOS [message #1826553 is a reply to message #1826552] Mon, 27 April 2020 04:52 Go to previous messageGo to next message
Sam Warner is currently offline Sam WarnerFriend
Messages: 40
Registered: April 2020
Member
seems I am having a different issue than Kirk Bailey had, as gdb is a running process (see attachment) under windows.

I also found two IBM articles, with some details, yet no description of tools to monitor the communications between eclipse and gdb.

Anyone have info on how to monitor?
I will do on either Windows or MacOS, yet prefer to stay on MacOS.

[Updated on: Mon, 27 April 2020 05:19]

Report message to a moderator

Re: Problems with GDB with Eclipse for C/C++ on MacOS [message #1826554 is a reply to message #1826553] Mon, 27 April 2020 05:38 Go to previous messageGo to next message
Sam Warner is currently offline Sam WarnerFriend
Messages: 40
Registered: April 2020
Member
I see from Shadi's message on remote-docker debugging the Eclipse <-> GDB communication is via localhost. I'll take a sniff/wireshark trace, and see what's similar/different between Windows and MacOS.

Re: Problems with GDB with Eclipse for C/C++ on MacOS [message #1826996 is a reply to message #1826554] Wed, 06 May 2020 00:23 Go to previous messageGo to next message
Sam Warner is currently offline Sam WarnerFriend
Messages: 40
Registered: April 2020
Member
More info, in case anyone else is encountering the same issue.

In the "error.log" tab (once shown via selecting under "Show View") there is a record for every failed launch of GDB with:

Request for monitor: 'RequestMonitor
org.eclipse.cdt.dsf.mi.service.MIRunControl$9@e0fbf58):
Status ERROR:
org.eclipse.cdt.dsf.gdb code=10001
Context cannot be suspended.
null' resulted in an error.

and "An exception stack trace is not available."

with session data of:
eclipse.buildId=4.16.0.I20200409-0200
java.version=1.8.0_131
java.vendor=Oracle Corporation
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
Framework arguments: -keyring /Users/samwarner/.eclipse_keyring
Command-line arguments: -os macosx -ws cocoa -arch x86_64 -data
file:/Users/samwarner/Projects/ -keyring
/Users/samwarner/.eclipse_keyring
Re: Problems with GDB with Eclipse for C/C++ on MacOS [message #1827007 is a reply to message #1826996] Wed, 06 May 2020 06:08 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
Quote:
On Windows 10 (1909) with Java 8u241 and GDB 9.1-1 and the same Eclipse 2020-06 (CDT 9.11.1) release, I am consistently getting:
...
Error message from debugger back end:
During startup program existed [exited?] with code 0xc0000135


0xC0000135 is a Windows error code.
It's often caused by a missing DLL or a DLL that didn't initialize properly.
It's seems to be occurring when GDB tries to start the program to debug
see exec-run in
https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Program-Execution.html#GDB_002fMI-Program-Execution

You'll have to figure out what went wrong and fix it.
Fixing Windows problems is out side the scope of this forum.

Re: Problems with GDB with Eclipse for C/C++ on MacOS [message #1827009 is a reply to message #1827007] Wed, 06 May 2020 06:30 Go to previous messageGo to next message
Sam Warner is currently offline Sam WarnerFriend
Messages: 40
Registered: April 2020
Member
Trouble is GDB works fine, on it's own with the application produced with Eclipse/CDT. The issue is when I try to use Eclipse/CDTs integrated development environment (communication pipe via the debugger command interface (CDI)).

The problem is not happening 100% of the time, but higher than 50%.

As far as the "exec-run" command, that's the way the debugger (GDB) starts the application. prior to issuing the exec-run, the breakpoint for 'main' is set. this initial breakpoint is set using the Eclipse/CDT dialog boxes, and communicated via CDI to GDB. It's only between setting this break point and Eclipse/CDT sending the 'exec-run' that the monitor side of Eclipse/CDT seems to get lost. (aka the data on the prior post).

Fortunately ;) this isn't a 'Windows' problem cause I am running on a Mac using MacOS 10.15 too.

Though - I am curious - given the frequency of my issues - if anyone has encountered this too?
Re: Problems with GDB with Eclipse for C/C++ on MacOS [message #1827010 is a reply to message #1827009] Wed, 06 May 2020 06:32 Go to previous messageGo to next message
Sam Warner is currently offline Sam WarnerFriend
Messages: 40
Registered: April 2020
Member
btw - I am also asking for info to enable me to fix :). Though, yeh, I am sort of not treating this as my primary task. I'll get to it though, if someone doesn't beat me to the resolution. In the mean time, I hope everyone doesn't mind if I post the progress of my analysis/debug here.
Re: Problems with GDB with Eclipse for C/C++ on MacOS [message #1827013 is a reply to message #1827010] Wed, 06 May 2020 07:02 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
Quote:
Trouble is GDB works fine on it's own with the application produced with Eclipse/CDT

Yet it is GDB issuing the message after attempting a start.
Clearly, the environments are different if standalone GDB works but fails when started by CDT.
Something only you can know, access and fix.

Try googling: gdb fails with 0xC0000135

https://www.eclipse.org/forums/index.php?t=msg&th=1095806&goto=1797344&#msg_1797344
https://blogs.msdn.microsoft.com/joshpoley/2011/06/13/common-process-termination-values/

[Updated on: Wed, 06 May 2020 07:32]

Report message to a moderator

Re: Problems with GDB with Eclipse for C/C++ on MacOS [message #1827022 is a reply to message #1827013] Wed, 06 May 2020 08:35 Go to previous messageGo to next message
Sam Warner is currently offline Sam WarnerFriend
Messages: 40
Registered: April 2020
Member
yeh, I am on MacOS 10.15 not Windows. I went to Windows to see if the issue occurred there too, and when it did, went back to doing the software work on the Mac.

Also, when I am initiating the debugger and there's a failed GDB launch, the error log within Eclipse/CDT shows the attached (a null pointer in Java).

Sam


[Updated on: Wed, 06 May 2020 08:36]

Report message to a moderator

Re: Problems with GDB with Eclipse for C/C++ on MacOS [message #1827024 is a reply to message #1827022] Wed, 06 May 2020 08:42 Go to previous messageGo to next message
Sam Warner is currently offline Sam WarnerFriend
Messages: 40
Registered: April 2020
Member
btw, that other eclipse post - I think the user was encounter the 0xc0000135 error on Windows 100% of the time. For my Windows redo of the Mac configuration using Eclipse/CDT/GDB, the error was only occurring >50% of the time. That there are consistent debug launches sometimes has me mildly productive. There must be a valid path sometimes :), , unlike the other fella's post where he had to fixe the path to eliminate the 0xc0000135 error.
Re: Problems with GDB with Eclipse for C/C++ on MacOS [message #1827048 is a reply to message #1827024] Wed, 06 May 2020 11:57 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
Quote:
On Windows 10 (1909) with Java 8u241 and GDB 9.1-1 and the same Eclipse 2020-06 (CDT 9.11.1) release, I am consistently getting:
https://www.eclipse.org/forums/index.php?t=msg&th=1103519&goto=1826552&#msg_1826552
Quote:
For my Windows redo of the Mac configuration using Eclipse/CDT/GDB, the error was only occurring >50% of the time.


We have different definitions of the word consistent
I tend to call the latter intermittent

You seem to be focusing on Eclipse's response to GDB giving up.
Granted, it could be better.

That you got the Windows error at all is a big clue.
It's not being caused by Eclipse although possibly caused by the runtime setup.
It really means Windows encountered a problem and GDB is telling you it happens at program start.

Fixing the execution and load path is only one of the possible solutions.
It's an old fallback error message which used to result in a blue screen on occasion.
https://wikifixes.com/errors/0x/0xc0000135/
https://stefanoborini.com/windows-dll-search-path/

That same problem is likely causing the similar Mac response as well.

But do feel free to spin your wheels.
Good luck.

Re: Problems with GDB with Eclipse for C/C++ on MacOS & Windows [message #1829729 is a reply to message #1826503] Thu, 09 July 2020 15:34 Go to previous messageGo to next message
Gordon Doughman is currently offline Gordon DoughmanFriend
Messages: 10
Registered: December 2018
Junior Member
I'm having the same problem as Sam using Eclipse Version: 2020-06 (4.16.0), GDB version 9.2 and macOS 10.15.5 on a 2020 MacBook Air. Sometimes debugging works, sometime it doesn't. When it doesn't work, Eclipse just hangs at 96%. Unlike Sam, when Eclipse hangs, I get no entry in the Error Log view. But there is a difference in what appears in the Debugger Console. When debugging works, the following appears in the Debugger Console:

GNU gdb (GDB) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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-apple-darwin19.5.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
BFD: /usr/lib/dyld(i386:x86-64): unknown load command 0x34
BFD: /usr/lib/dyld(i386:x86-64): unknown load command 0x34
[New Thread 0x2303 of process 4822]
[New Thread 0x2a03 of process 4822]
warning: unhandled dyld version (16)

Thread 2 hit Temporary breakpoint 1, main (argc=1, argv=0x7ffeefbff600) at ../Source/main.c:24
24 printf("\nELF2Hex v1.0.1, Copyright 2012 by MicroDialects\n\n");


When debugging doesn't work, the Debugger Console displays the following:

GNU gdb (GDB) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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-apple-darwin19.5.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
BFD: /usr/lib/dyld(i386:x86-64): unknown load command 0x34
BFD: /usr/lib/dyld(i386:x86-64): unknown load command 0x34
[New Thread 0x1d03 of process 4949]


GDB is properly signed with the following entitlements:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
<key>com.apple.security.cs.disable-executable-page-protection</key>
<true/>
<key>com.apple.security.cs.debugger</key>
<true/>
<key>com.apple.security.get-task-allow</key>
<true/>
</dict>
</plist>


and .gdbinit contains the following:

set startup-with-shell off

I'm currently at a loss as to why this doesn't work all of the time. GDB was downloaded using MacPorts and I followed Thomas Vitale's guide (https://www.thomasvitale.com/how-to-setup-gdb-and-eclipse-to-debug-c-files-on-macos-sierra/) for setting up GDB in Catalina.

Any help in debugging this issue would be appreciated.

Re: Problems with GDB with Eclipse for C/C++ on MacOS & Windows [message #1830697 is a reply to message #1829729] Fri, 31 July 2020 17:41 Go to previous messageGo to next message
Sam Warner is currently offline Sam WarnerFriend
Messages: 40
Registered: April 2020
Member
Hi,
About the only help/suggestion I have is to work-around. What I did was install all of the tools again in a virtualized MacOS (using Parallels). All that does, though is to isolate the issue from affecting other Eclipse projects I am using. Then, when the debugger fails to launch, I just keep re-trying until a successful launch occurs. Once I debugged, then I go through and terminate all the residual launches that failed, clear out all the old entries in the error log, and march on to the next debug effort.

Next time I am debugging I'll look to see if I obtain the same "dlyd" version message. I did use the same Thomas Vitale's page for setup.

I plan to look further into this, though at the moment am a bit taxed for time.

Sam
Re: Problems with GDB with Eclipse for C/C++ on MacOS & Windows [message #1831387 is a reply to message #1830697] Tue, 18 August 2020 22:25 Go to previous message
Gordon Doughman is currently offline Gordon DoughmanFriend
Messages: 10
Registered: December 2018
Junior Member
For macOS at least, this appears to be an issue with GDB as reported here:

https://sourceware.org/bugzilla/show_bug.cgi?id=24069#c6

Previous Topic: Problem with debugging the C++ code with eclipse on Mac
Next Topic:Managing and collaborating with inter-project dependencies
Goto Forum:
  


Current Time: Thu Apr 25 17:32:10 GMT 2024

Powered by FUDForum. Page generated in 0.03307 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top