How to debug Segmentation fault by gdb
This article mainly introduces gdb how to debug Segmentation fault, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
When debugging code with GCC, we may encounter the problem of Segmentation fault, so we need to debug with gdb.
1. Operation error
2. Use gdb to debug
Gcc-g-rdynamic trim.c (file to be compiled)
3. Gdb debugging
Gdb a.out
Just type r all the time to see the line number of the error.
Thank you for reading this article carefully. I hope the article "how to debug Segmentation fault in gdb" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!