- Compile you program using the
-g -O0gcc-switch, or add options to stringCFLAGSand/orCXXFLAGSin Makefile. - Then use gdb (if need - pass command argument using --args option):
gdb --args ./proxmark3 /dev/ttyACM0 - Use some gdb magic:
(gdb) run
<segfault happens here>
(gdb) backtrace
<offending code is shown here>
This link list I find useful:
- gnu.org/software/gcc/bugs/segfault.html
- http://www.unknownroad.com/rtfm/gdbtut/gdbtoc.html
- https://stackoverflow.com/questions/3718998/fixing-segmentation-faults-in-c