crashelper/test/main.cxx

31 lines
535 B
C++
Raw Normal View History

#include <crashelper.h>
#include <iostream>
#include <thread>
using namespace backward;
void th_sim()
{
std::this_thread::sleep_for(std::chrono::seconds(2));
// throw "Erro Auto";
int* p = nullptr;
*p = 33;
}
int main()
{
#ifdef _WIN32
SetDumpFileSavePath("D:\\dump");
SetDumpLogSavePath("D:\\dump");
#else
SetDumpFileSavePath("~/dump");
SetDumpLogSavePath("~/dump");
#endif
CRASHELPER_MARK_ENTRY();
std::thread t(th_sim);
std::cout << "Done" << std::endl;
t.join();
return 0;
}