blob: f6d9ba553e4a0bd7911c617b2a8e02961e597345 [file] [log] [blame]
Chaoren Lin28e57422015-02-03 01:51:25 +00001//===-- CrashReason.h -------------------------------------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef liblldb_CrashReason_H_
11#define liblldb_CrashReason_H_
12
13#include "lldb/lldb-types.h"
14
15#include <signal.h>
16
17#include <string>
18
19enum class CrashReason
20{
21 eInvalidCrashReason,
22
23 // SIGSEGV crash reasons.
24 eInvalidAddress,
25 ePrivilegedAddress,
26
27 // SIGILL crash reasons.
28 eIllegalOpcode,
29 eIllegalOperand,
30 eIllegalAddressingMode,
31 eIllegalTrap,
32 ePrivilegedOpcode,
33 ePrivilegedRegister,
34 eCoprocessorError,
35 eInternalStackError,
36
37 // SIGBUS crash reasons,
38 eIllegalAlignment,
39 eIllegalAddress,
40 eHardwareError,
41
42 // SIGFPE crash reasons,
43 eIntegerDivideByZero,
44 eIntegerOverflow,
45 eFloatDivideByZero,
46 eFloatOverflow,
47 eFloatUnderflow,
48 eFloatInexactResult,
49 eFloatInvalidOperation,
50 eFloatSubscriptRange
51};
52
53std::string
54GetCrashReasonString (CrashReason reason, lldb::addr_t fault_addr);
55
56const char *
57CrashReasonAsString (CrashReason reason);
58
59CrashReason
60GetCrashReason(const siginfo_t& info);
61
62#endif // #ifndef liblldb_CrashReason_H_