2018-06-22 23:38:00 +08:00
|
|
|
/*
|
2019-02-27 18:39:32 +08:00
|
|
|
* Copyright (C) 2018-2019 Intel Corporation
|
2018-06-22 23:38:00 +08:00
|
|
|
*
|
2018-09-18 15:11:08 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2018-06-22 23:38:00 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "excpt.h"
|
2019-02-27 18:39:32 +08:00
|
|
|
#include "windows.h"
|
|
|
|
|
2018-06-22 23:38:00 +08:00
|
|
|
#include <string>
|
|
|
|
|
|
|
|
class SehException {
|
|
|
|
public:
|
|
|
|
static std::string getExceptionDescription(unsigned int code);
|
|
|
|
static void getCallStack(unsigned int code, struct _EXCEPTION_POINTERS *ep, std::string &stack);
|
|
|
|
static int filter(unsigned int code, struct _EXCEPTION_POINTERS *ep);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
static void addLineToCallstack(std::string &callstack, size_t counter, std::string &module, std::string &line, std::string &symbol);
|
|
|
|
typedef DWORD(WINAPI *getMappedFileNameFunction)(HANDLE hProcess, LPVOID lpv, LPSTR lpFilename, DWORD nSize);
|
|
|
|
};
|