Is there any gcc option I can set that will give me the line number of the segmentation fault?
I know I can:
you also need to build with debug flags on -g
You can also open the core dump with gdb (you need -g though).