void create_dump(void)
{
if(!fork()) {
// Crash the app in your favorite way here
*((void*)0) = 42;
}
}
Fork the process then crash the child – it’ll give you a snapshot whenever you want
More Related Contents:
- Debugging a linked-list
- Is there a good Valgrind substitute for Windows?
- How can one grab a stack trace in C?
- Is it possible to modify a string of char in C?
- Core dumped, but core file is not in the current directory?
- How can I tell if a library was compiled with -g?
- How to print every executed line in GDB automatically until a given breakpoint is reached?
- Include source code of malloc.c in gdb?
- How Can I debug a C program on Linux?
- Is it possible to “jump”/”skip” in GDB debugger?
- Is there a good Valgrind substitute for Windows?
- How to solve “ptrace operation not permitted” when trying to attach GDB to a process?
- Cannot insert breakpoints. Addresses with low values
- How to make backtrace()/backtrace_symbols() print the function names?
- undefined reference to `std::ios_base::Init::Init()’
- How do I pass a command line argument while starting up GDB in Linux? [duplicate]
- segfault only when NOT using debugger
- Why fork() twice [duplicate]
- How to generate core dump file in Ubuntu [duplicate]
- addr2line on kernel module
- Why does malloc allocate a different number of bytes than requested?
- Why when I print it appears 80 for *str in decimal (letter P in ASCII)?
- Range of values in C Int and Long 32 – 64 bits
- Where do the values of uninitialized variables come from, in practice on real CPUs?
- GCC 4.7 Source Character Encoding and Execution Character Encoding For String Literals?
- How to use int16_t or int32_t with functions like scanf [duplicate]
- Can I commit changes to actual database while debugging C# in Visual Studio?
- Linux shared memory: shmget() vs mmap()?
- Program received signal SIGPIPE, Broken pipe
- GCC – no warning about an uninitialized array with -O0