gdb + cygwin

Earnie Boyd
Mon May 24 09:57:00 GMT 1999

--- Charles Wilson <> wrote:
> I'm trying to port GAA (GPL Argument Analyzer) to cygwin. After a bit of
> hacking, I was able to get the program itself to compile, and run.
> However, when testing with the sample code provided in the package, I'm
> running into a weird problem:
> Background:
>     GAA takes an argument description file, and generates a .c and a .h
> file to be included in your project. It's basically an easier to use
> version of getopt, getoptlong.
>     "gaa sample.gaa"  ---> gaaout.c, gaa.h
>     Then, you compile the sample code:
>     gcc -g -c gaaout.c
>     gcc -g -c smain.c
> I get to that step okay. Linking works, too:
>     gcc -o sample gaaout.o smain.o
> I get a coredump when I run the sample program:
> /usr/local/src/tmp > sample
> [main] F:\cygnus\cygwin-b20\usr\local\src\tmp\sample.exe 27397 (0)
> handle_exceptions: Exception: STATUS_ACCESS_VIOLATION
> [main] sample 27397 (0) handle_exceptions: Dumping stack trace to
> sample.exe.core
> Now, this isn't all that surprising. What is surprising is that when I
> run "sample.exe" within gdb, it executes fine and exits normally. What
> does that mean, and how do I debug the thing if I can't reproduce the
> error within the debugger?

Hi Chuck,

I've seen this when I have a pointer reference that isn't being referenced
correctly.  Perhaps a prototype is incorrect or not specified.  Perhaps you
have a pointer becoming an integer or an integer becoming a pointer, either way
you're in trouble.

Use the -Wall switch on the compilation and don't ignore the warnings.  If it
has to do with a pointer, it's an ERROR not a WARNING.
"Earnie Boyd" < >
       DLLHELP: < >
                < >
Do You Yahoo!?
Free instant messaging and more at

Want to unsubscribe from this list?
Send a message to

More information about the Cygwin mailing list