Click to See Complete Forum and Search --> : Anyone familiar with Cygwin?


John E
March 9th, 2008, 01:47 PM
For the past year or so I've been involved in a large Linux project. Like all OS's, Linux is an acquired taste (and, sad to say, it hasn't really suited my tastes at all). Nevertheless, I'm stuck with it.

One thing that particularly grates is the difficulty of doing single-step debugging within a multithreaded app. For those with an enquiring mind this article (http://www.sourceware.org/ml/gdb/2006-03/msg00170.html) describes a fundamental feature (weakness?) of POSIX that effectively makes it incompatible with multithreaded debugging. That item refers specifically to gdb - but I've tried other Linux debuggers too and they're all just as bad. The problem is basically within POSIX.

Single-stepping is such an integral part of the way I work that I've even considered installing Cygwin (under Windows) and debugging my code within Windows. Cygwin (if I understand it correctly) emulates a POSIX environment within Windows (thereby allowing POSIX dependent apps to be built with Linux tools (e.g. gcc/minGW) but run under Windows). But does Cygwin emulate POSIX "warts and all?" In other words, if I were to try this route, would I be on a fool's errand? Would I still end up with the same problems?

I just wondered if there's anyone here who uses Cygwin - and what are your experiences with single-step debugging?

Lindley
March 9th, 2008, 05:31 PM
You'd probably have all the same problems. Since code compiled under Cygwin can only run under Cygwin, most likely it's not simply wrapping the WinAPI functions directly.

Perhaps if you told us your debugging problems we could suggest alternate solutions. Valgrind, and it's sub-tool helgrind, for example----tools available on Linux which really have no equal in usefulness on Windows.

John E
March 10th, 2008, 02:23 AM
Thanks Lindley. I've considered Valgrind in the past but from the descriptions I've read, it doesn't offer the crucial feature that I'm looking for. I simply want to be able to single-step through my code - reliably and without the debugger crashing at every break point. AFAICT this is quite literally impossible in a POSIX based architecture (unless the application is very simple and single threaded).

Lindley
March 10th, 2008, 06:38 AM
That seems rather unlikely. I've had no problems using gdb on multithreaded programs.