
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Debug a Core in C/C++
A process dumps core when it is terminated by the operating system due to a fault in the program. The most typical reason this occurs is that the program accessed an invalid pointer value like NULL or some value out of its memory area. As part of that process, the operating system tries to write our information to a file to allow us to analyze what happened.
This core can be used as follows to diagnose and debug our program −
The core is dumped to the /proc/sys/kernel directory by default. To debug a core, the program must be compiled with the -g option. Once you have the core run gdb −
$ gdb nameOfExecutable core
This will open the core in gdb and now you can proceed with your debugging. If you don't know how to use gdb, you can use this link to learn more: https://www.ibm.com/developerworks/library/l-gdb/