- Trending Categories
- Data Structure
- Operating System
- C Programming
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to 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/
- How to enable Session in C# ASP.NET Core?
- What is #if DEBUG and How to use it in C#?
- How to handle errors in middleware C# Asp.net Core?
- Core Dump (Segmentation fault) in C/C++
- Debug Class vs Debugger Class in C#
- How to determine if C# .NET Core is installed?
- What is routing in C# ASP.NET Core?
- What is Metapackage in C# Asp.net Core?
- How C# ASP.NET Core Middleware is different from HttpModule?
- How to debug lambda expressions in Java?
- How to debug JShell in Java 9?
- What is Kestral C# Asp.net Core?