[GRASS5] Re: getting gdb to work

Hamish hamish_nospam at yahoo.com
Tue Sep 23 03:40:31 EDT 2003


> > also in anyone can help, I'm having problems getting gdb to work
> > with GRASS.

Glynn:
> 1. Don't use LDFLAGS="-s" if you want to debug the binary; "-s" strips
> the debugging information.
> 
> 2. Don't use -O if you want to be able to step through function
> bodies. When optimisation is enabled, the compiler will re-order
> statements and re-arrange expressions, resulting in object code which
> barely resembles the source code.

Bernhard:
> Run the actual command in etc/bin/cmd or etc/bin/inter not the wrapper
> from the grass command prompt.


Thanks a lot for the info, now it works fine.


For the archive--

gdb is the GNU (interactive) debugger.

GUI frontends include: ddd, xxgdb, cgdb, kdbg
quick reference guides:
 http://www.cs.hmc.edu/tech_docs/qref/c++/gdb.html
 http://tiger.la.asu.edu/Quick_Ref/gdb_quickref.pdf


Compile GRASS with:
CFLAGS="-Wall -ggdb" ./configure ...

Binaries will be a lot bigger (compiled source dir now close to 1GB).
I guess you could leave off the -ggdb and add it to Gmakefiles as
needed, but that wouldn't help you with any library calls.



More information about the grass-dev mailing list