Wednesday, May 25, 2016

2016-05-25 Wednesday - Fixing my GDB (and Eclipse CDT Debugging capability)

I previously had my Windows 10 development machine configured to successfully develop and debug C++ programs from within Mars Eclipse - leveraging CDT and Cygwin.

I recently made some changes to my system configuration - and broke my Cygwin GDB debugging functionality.

After spending a few hours exploring the problem, I thought sharing this post might help someone else minimize their cycle time if they have a similar problem...

The first clue was in a Windows Command Prompt, I got the following error when trying to launch GDB:
"ImportError: No module named site"
Also, in Eclipse, when attempting to launch the debugger for a C++ program, I encountered this error message:
 "Could not determine DGB version using command gdb --version"
I  read several forum postings - and these were the relevant takeaways:
Now, in my environment, I had setup Python 2.7.11 and Python 3.5.1 - and since GDB relies on Python 2.7 - I thought, "ah, perhaps one of my library installs / updates has resulted in a broken dependency situation". So, I uninstalled and re-installed them both. 
No joy.
I then uninstalled and re-installed Cygwin.
No joy.
Then I tried alternating where PYTHONHOME and PYTHONPATH pointed...to 2.7 vs 3.5
No joy.
Finally, I removed the System Variables for PYTHONHOME and PYTHONPATH.
Success. 
When in the Cygwin bash shell (or Windows Command Prompt window) - the Windows System Variables for PYTHONHOME and PYTHONPATH were conflicting with the Python 2.7 version that is bundled with Cygwin - and a dependency for GDB.

So I then just added the dir for Python 3.5 directly to the PATH environment variable. 

Problem solved.

No comments:

Copyright

© 2001-2021 International Technology Ventures, Inc., All Rights Reserved.