gdb + cygwin

Earnie Boyd earnie_boyd@yahoo.com
Mon May 24 09:57:00 GMT 1999


--- Charles Wilson <cwilson@ece.gatech.edu> 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" < mailto:earnie_boyd@yahoo.com >
CYGWIN RELATED HELP:
 DOCUMENTATION: < http://sourceware.cygnus.com/cygwin/docs.html >
       DLLHELP: < http://www.xraylith.wisc.edu/~khan/software/gnu-win32/ >
ARCHIVE SEARCH: < http://www.delorie.com/archives/ > OR
                < http://www.eGroups.com/list/gnu-win32/ >
_____________________________________________________________
Do You Yahoo!?
Free instant messaging and more at http://messenger.yahoo.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com



More information about the Cygwin mailing list