Index: [thread] [date] [subject] [author]
  From: Jon M. Taylor <taylorj@gaia.ecs.csus.edu>
  To  : ggi-develop@eskimo.com
  Date: Tue, 13 Jul 1999 12:19:09 -0700 (PDT)

Re: hacking methods to find out bugs

On Mon, 12 Jul 1999, Brian S. Julin wrote:

> On Mon, 12 Jul 1999, Peter Amstutz wrote:
> > somefunction(...) {
> > 	/* some possibly buggy code */
> > 	printf("Checkpoint #1\n");
> > 	/* more possibly buggy code */
> > 	printf("Checkpoint #2\n");
> > 	/* even more possibly buggy code */	
> > 	printf("Checkpoint #3\n");
> > }
> 
> Note the \n is important in some cases -- it flushes a line-mode
> tty output stream, so if you leave it off, you may think your
> segfault is occuring earlier than it actually is.

	In some cases you also have to do an fprintf(stderr, ...) if other
debugging output is being set to stderr, or all your output will show up
after the other debugging output in one lump at the end.  Usually it is best
to use DEBUG(), NOTICE(), etc for your debugging prints in the GGI/KGI system
for this reason. 

Jon

---
'Cloning and the reprogramming of DNA is the first serious step in 
becoming one with God.'
	- Scientist G. Richard Seed

Index: [thread] [date] [subject] [author]