[Gllug] gcc

Jon Masters jonathan at jonmasters.org
Fri Aug 1 12:14:15 UTC 2003


On Fri, 1 Aug 2003, Andrew Halliwell wrote:

> Try compiling it with the -g switch and then running the program in gdb.
> That should tell you the exact LINE it's failing on.
> 
> The only time gdb fails is when your program fails with a segfault due to a
> null pointer reference. (cos I think pointers are never null when gdb
> handles them, or something).

Also worth considering using electric fence or similar malloc debugger to
track the memory usage and leaks within your code. gprof is good for
optimising code in that you can track the frequent execution code paths
and optimise certain code by hand where necessary.

Personally I am very fond of ddd for a gdb frontend because it allows me
to do more at the same time and keep track of what I am doing.

Jon.


-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list