sm-ext-accelerator-2023/test/test.cpp

35 lines
912 B
C++
Raw Normal View History

#include "client/linux/handler/exception_handler.h"
#include "common/linux/linux_libc_support.h"
#include "third_party/lss/linux_syscall_support.h"
#include <signal.h>
#include <dirent.h>
#include <unistd.h>
2016-07-02 05:53:55 +02:00
static bool dumpCallback(const google_breakpad::MinidumpDescriptor &descriptor, void *context, bool succeeded)
{
if (succeeded) {
sys_write(STDOUT_FILENO, "Wrote minidump to: ", 19);
} else {
sys_write(STDOUT_FILENO, "Failed to write minidump to: ", 29);
}
sys_write(STDOUT_FILENO, descriptor.path(), my_strlen(descriptor.path()));
sys_write(STDOUT_FILENO, "\n", 1);
return succeeded;
}
int main(int argc, char *argv[])
{
2016-07-02 05:53:55 +02:00
google_breakpad::MinidumpDescriptor descriptor(".");
google_breakpad::ExceptionHandler *handler = new google_breakpad::ExceptionHandler(descriptor, NULL, dumpCallback, NULL, true, -1);
// Test shit here.
2016-07-02 05:53:55 +02:00
__builtin_trap();
delete handler;
return 0;
}