[GRASS5] Grass 5.1

Radim Blazek radim.blazek at wo.cz
Mon Jan 7 14:54:04 EST 2002


On Monday 07 January 2002 13:20, Glynn Clements wrote:
> Radim Blazek wrote:
> > 2) Debug
> > New function G_debug (int  level, char * msg) prints message if
> > enviroment variable GRASS_DEBUG_LEVEL is set to level equal or higher.
> > My proposal for levels is:
> >  * Levels: (recommended levels)
> >  * 1 - messages printed once or few times per module
> >  * 3 - each row (raster) or line (vector)
> >  * 5 - each cell (raster) or point (vector)
> > and I use optional compilation (speed):
> > #ifdef GDEBUG
> >       G_debug (1, "Vect_open_old(): name = %s mapset= %s", name, mapset);
> > #endif
>
> Too much of this can make the code messy. Parameter tracing is usually
> better performed with gdb command sequences, e.g.
>
> 	break Vect_open_old
> 	commands
> 	silent
> 	printf "Vect_open_old(): name = %s mapset= %s", name, mapset
> 	continue
> 	end
>
> Unfortunately, it isn't straightforward to set a breakpoint in the
> middle of a function without using line numbers (which need to be
> updated whenever the source changes).
>
> I do think that we should have something similar to G_warning() for
> user messages, rather than just printing to stdout/stderr.

Yes, but I was thinking about user debugging. 
It is often problem to reproduce the same bug on other machine with 
other data. Then you have to comunicate a lot with user and possibly
exchange data. 
Debugging with gdb may be complicated for common users. I thing that
reasonable output printed by G_debug may help in many cases.


Radim



More information about the grass-dev mailing list