Date: Tue, 26 Nov 1996 16:54:07 +0200 (IST) From: Eli Zaretskii To: Aaron Dwyer Cc: djgpp AT delorie DOT com Subject: Re: GDB debugging In-Reply-To: <579aaf$l6k@isnews.csc.calpoly.edu> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Sun, 24 Nov 1996, Aaron Dwyer wrote: > What kinds of clues regarding my bug can I get from knowing the > program crashes on a function calling line? That depends on what kind of clues are you looking for. You don't *really* expect GDB to say something like "hint: make that wild pointer there to point to this buffer", do you? ;-) For starters, posting the stack dump printed when your program crashes (outside GDB) will say a lot to people who understand it. The GDB command `bt' (backtrace) will show you the entire calling sequence (who called who called who...) that lead to the crash. But I usually examine the values of the variables near the point of crash first. It is also useful sometimes to pull the source of `qsort' from the library sources and compile it with -g, so you can step inside it and see what exactly happens in that function.