31 lines
535 B
C++
31 lines
535 B
C++
|
#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;
|
||
|
}
|