[Unix] Debug method

No matter what kind of language you use, this method can provide a way to debug. At first you need to set run the command “ulimit -c unlimited”. Then just run your program, onece it segmentation fault it will generate core-dump file. And then you can run gdb to start debug!!!
gdb [options] [executable-file [core-file or [...]