Instantly share code, notes, and snippets.

What would you like to do?
Enable Core dump in C/C++
#include <iostream>
#include <sys/resource.h>
int main() {
rlimit core_limits;
core_limits.rlim_cur = core_limits.rlim_max = RLIM_INFINITY;
setrlimit(RLIMIT_CORE, &core_limits);
std::cout << "begin\n";
int* x = 0;
*x = 1;
std::cout << *x << "end\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment