/thirdparty/breakpad/google_breakpad/common/minidump_exception_mac.h

http://github.com/tomahawk-player/tomahawk · C Header · 195 lines · 64 code · 19 blank · 112 comment · 0 complexity · 0ee8447e1bca13d9e3c8d0a0398b6d28 MD5 · raw file

  1. /* Copyright (c) 2006, Google Inc.
  2. * All rights reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions are
  6. * met:
  7. *
  8. * * Redistributions of source code must retain the above copyright
  9. * notice, this list of conditions and the following disclaimer.
  10. * * Redistributions in binary form must reproduce the above
  11. * copyright notice, this list of conditions and the following disclaimer
  12. * in the documentation and/or other materials provided with the
  13. * distribution.
  14. * * Neither the name of Google Inc. nor the names of its
  15. * contributors may be used to endorse or promote products derived from
  16. * this software without specific prior written permission.
  17. *
  18. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  19. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  20. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  21. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  22. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  23. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  24. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  25. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  26. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  27. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  28. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
  29. /* minidump_exception_mac.h: A definition of exception codes for Mac
  30. * OS X
  31. *
  32. * (This is C99 source, please don't corrupt it with C++.)
  33. *
  34. * Author: Mark Mentovai
  35. * Split into its own file: Neal Sidhwaney */
  36. #ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_MAC_H__
  37. #define GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_MAC_H__
  38. #include <stddef.h>
  39. #include "google_breakpad/common/breakpad_types.h"
  40. /* For (MDException).exception_code. Breakpad minidump extension for Mac OS X
  41. * support. Based on Darwin/Mac OS X' mach/exception_types.h. This is
  42. * what Mac OS X calls an "exception", not a "code". */
  43. typedef enum {
  44. /* Exception code. The high 16 bits of exception_code contains one of
  45. * these values. */
  46. MD_EXCEPTION_MAC_BAD_ACCESS = 1, /* code can be a kern_return_t */
  47. /* EXC_BAD_ACCESS */
  48. MD_EXCEPTION_MAC_BAD_INSTRUCTION = 2, /* code is CPU-specific */
  49. /* EXC_BAD_INSTRUCTION */
  50. MD_EXCEPTION_MAC_ARITHMETIC = 3, /* code is CPU-specific */
  51. /* EXC_ARITHMETIC */
  52. MD_EXCEPTION_MAC_EMULATION = 4, /* code is CPU-specific */
  53. /* EXC_EMULATION */
  54. MD_EXCEPTION_MAC_SOFTWARE = 5,
  55. /* EXC_SOFTWARE */
  56. MD_EXCEPTION_MAC_BREAKPOINT = 6, /* code is CPU-specific */
  57. /* EXC_BREAKPOINT */
  58. MD_EXCEPTION_MAC_SYSCALL = 7,
  59. /* EXC_SYSCALL */
  60. MD_EXCEPTION_MAC_MACH_SYSCALL = 8,
  61. /* EXC_MACH_SYSCALL */
  62. MD_EXCEPTION_MAC_RPC_ALERT = 9
  63. /* EXC_RPC_ALERT */
  64. } MDExceptionMac;
  65. /* For (MDException).exception_flags. Breakpad minidump extension for Mac OS X
  66. * support. Based on Darwin/Mac OS X' mach/ppc/exception.h and
  67. * mach/i386/exception.h. This is what Mac OS X calls a "code". */
  68. typedef enum {
  69. /* With MD_EXCEPTION_BAD_ACCESS. These are relevant kern_return_t values
  70. * from mach/kern_return.h. */
  71. MD_EXCEPTION_CODE_MAC_INVALID_ADDRESS = 1,
  72. /* KERN_INVALID_ADDRESS */
  73. MD_EXCEPTION_CODE_MAC_PROTECTION_FAILURE = 2,
  74. /* KERN_PROTECTION_FAILURE */
  75. MD_EXCEPTION_CODE_MAC_NO_ACCESS = 8,
  76. /* KERN_NO_ACCESS */
  77. MD_EXCEPTION_CODE_MAC_MEMORY_FAILURE = 9,
  78. /* KERN_MEMORY_FAILURE */
  79. MD_EXCEPTION_CODE_MAC_MEMORY_ERROR = 10,
  80. /* KERN_MEMORY_ERROR */
  81. /* With MD_EXCEPTION_SOFTWARE */
  82. MD_EXCEPTION_CODE_MAC_BAD_SYSCALL = 0x00010000, /* Mach SIGSYS */
  83. MD_EXCEPTION_CODE_MAC_BAD_PIPE = 0x00010001, /* Mach SIGPIPE */
  84. MD_EXCEPTION_CODE_MAC_ABORT = 0x00010002, /* Mach SIGABRT */
  85. /* Custom values */
  86. MD_EXCEPTION_CODE_MAC_NS_EXCEPTION = 0xDEADC0DE, /* uncaught NSException */
  87. /* With MD_EXCEPTION_MAC_BAD_ACCESS on ppc */
  88. MD_EXCEPTION_CODE_MAC_PPC_VM_PROT_READ = 0x0101,
  89. /* EXC_PPC_VM_PROT_READ */
  90. MD_EXCEPTION_CODE_MAC_PPC_BADSPACE = 0x0102,
  91. /* EXC_PPC_BADSPACE */
  92. MD_EXCEPTION_CODE_MAC_PPC_UNALIGNED = 0x0103,
  93. /* EXC_PPC_UNALIGNED */
  94. /* With MD_EXCEPTION_MAC_BAD_INSTRUCTION on ppc */
  95. MD_EXCEPTION_CODE_MAC_PPC_INVALID_SYSCALL = 1,
  96. /* EXC_PPC_INVALID_SYSCALL */
  97. MD_EXCEPTION_CODE_MAC_PPC_UNIMPLEMENTED_INSTRUCTION = 2,
  98. /* EXC_PPC_UNIPL_INST */
  99. MD_EXCEPTION_CODE_MAC_PPC_PRIVILEGED_INSTRUCTION = 3,
  100. /* EXC_PPC_PRIVINST */
  101. MD_EXCEPTION_CODE_MAC_PPC_PRIVILEGED_REGISTER = 4,
  102. /* EXC_PPC_PRIVREG */
  103. MD_EXCEPTION_CODE_MAC_PPC_TRACE = 5,
  104. /* EXC_PPC_TRACE */
  105. MD_EXCEPTION_CODE_MAC_PPC_PERFORMANCE_MONITOR = 6,
  106. /* EXC_PPC_PERFMON */
  107. /* With MD_EXCEPTION_MAC_ARITHMETIC on ppc */
  108. MD_EXCEPTION_CODE_MAC_PPC_OVERFLOW = 1,
  109. /* EXC_PPC_OVERFLOW */
  110. MD_EXCEPTION_CODE_MAC_PPC_ZERO_DIVIDE = 2,
  111. /* EXC_PPC_ZERO_DIVIDE */
  112. MD_EXCEPTION_CODE_MAC_PPC_FLOAT_INEXACT = 3,
  113. /* EXC_FLT_INEXACT */
  114. MD_EXCEPTION_CODE_MAC_PPC_FLOAT_ZERO_DIVIDE = 4,
  115. /* EXC_PPC_FLT_ZERO_DIVIDE */
  116. MD_EXCEPTION_CODE_MAC_PPC_FLOAT_UNDERFLOW = 5,
  117. /* EXC_PPC_FLT_UNDERFLOW */
  118. MD_EXCEPTION_CODE_MAC_PPC_FLOAT_OVERFLOW = 6,
  119. /* EXC_PPC_FLT_OVERFLOW */
  120. MD_EXCEPTION_CODE_MAC_PPC_FLOAT_NOT_A_NUMBER = 7,
  121. /* EXC_PPC_FLT_NOT_A_NUMBER */
  122. /* With MD_EXCEPTION_MAC_EMULATION on ppc */
  123. MD_EXCEPTION_CODE_MAC_PPC_NO_EMULATION = 8,
  124. /* EXC_PPC_NOEMULATION */
  125. MD_EXCEPTION_CODE_MAC_PPC_ALTIVEC_ASSIST = 9,
  126. /* EXC_PPC_ALTIVECASSIST */
  127. /* With MD_EXCEPTION_MAC_SOFTWARE on ppc */
  128. MD_EXCEPTION_CODE_MAC_PPC_TRAP = 0x00000001, /* EXC_PPC_TRAP */
  129. MD_EXCEPTION_CODE_MAC_PPC_MIGRATE = 0x00010100, /* EXC_PPC_MIGRATE */
  130. /* With MD_EXCEPTION_MAC_BREAKPOINT on ppc */
  131. MD_EXCEPTION_CODE_MAC_PPC_BREAKPOINT = 1, /* EXC_PPC_BREAKPOINT */
  132. /* With MD_EXCEPTION_MAC_BAD_INSTRUCTION on x86, see also x86 interrupt
  133. * values below. */
  134. MD_EXCEPTION_CODE_MAC_X86_INVALID_OPERATION = 1, /* EXC_I386_INVOP */
  135. /* With MD_EXCEPTION_MAC_ARITHMETIC on x86 */
  136. MD_EXCEPTION_CODE_MAC_X86_DIV = 1, /* EXC_I386_DIV */
  137. MD_EXCEPTION_CODE_MAC_X86_INTO = 2, /* EXC_I386_INTO */
  138. MD_EXCEPTION_CODE_MAC_X86_NOEXT = 3, /* EXC_I386_NOEXT */
  139. MD_EXCEPTION_CODE_MAC_X86_EXTOVR = 4, /* EXC_I386_EXTOVR */
  140. MD_EXCEPTION_CODE_MAC_X86_EXTERR = 5, /* EXC_I386_EXTERR */
  141. MD_EXCEPTION_CODE_MAC_X86_EMERR = 6, /* EXC_I386_EMERR */
  142. MD_EXCEPTION_CODE_MAC_X86_BOUND = 7, /* EXC_I386_BOUND */
  143. MD_EXCEPTION_CODE_MAC_X86_SSEEXTERR = 8, /* EXC_I386_SSEEXTERR */
  144. /* With MD_EXCEPTION_MAC_BREAKPOINT on x86 */
  145. MD_EXCEPTION_CODE_MAC_X86_SGL = 1, /* EXC_I386_SGL */
  146. MD_EXCEPTION_CODE_MAC_X86_BPT = 2, /* EXC_I386_BPT */
  147. /* With MD_EXCEPTION_MAC_BAD_INSTRUCTION on x86. These are the raw
  148. * x86 interrupt codes. Most of these are mapped to other Mach
  149. * exceptions and codes, are handled, or should not occur in user space.
  150. * A few of these will do occur with MD_EXCEPTION_MAC_BAD_INSTRUCTION. */
  151. /* EXC_I386_DIVERR = 0: mapped to EXC_ARITHMETIC/EXC_I386_DIV */
  152. /* EXC_I386_SGLSTP = 1: mapped to EXC_BREAKPOINT/EXC_I386_SGL */
  153. /* EXC_I386_NMIFLT = 2: should not occur in user space */
  154. /* EXC_I386_BPTFLT = 3: mapped to EXC_BREAKPOINT/EXC_I386_BPT */
  155. /* EXC_I386_INTOFLT = 4: mapped to EXC_ARITHMETIC/EXC_I386_INTO */
  156. /* EXC_I386_BOUNDFLT = 5: mapped to EXC_ARITHMETIC/EXC_I386_BOUND */
  157. /* EXC_I386_INVOPFLT = 6: mapped to EXC_BAD_INSTRUCTION/EXC_I386_INVOP */
  158. /* EXC_I386_NOEXTFLT = 7: should be handled by the kernel */
  159. /* EXC_I386_DBLFLT = 8: should be handled (if possible) by the kernel */
  160. /* EXC_I386_EXTOVRFLT = 9: mapped to EXC_BAD_ACCESS/(PROT_READ|PROT_EXEC) */
  161. MD_EXCEPTION_CODE_MAC_X86_INVALID_TASK_STATE_SEGMENT = 10,
  162. /* EXC_INVTSSFLT */
  163. MD_EXCEPTION_CODE_MAC_X86_SEGMENT_NOT_PRESENT = 11,
  164. /* EXC_SEGNPFLT */
  165. MD_EXCEPTION_CODE_MAC_X86_STACK_FAULT = 12,
  166. /* EXC_STKFLT */
  167. MD_EXCEPTION_CODE_MAC_X86_GENERAL_PROTECTION_FAULT = 13,
  168. /* EXC_GPFLT */
  169. /* EXC_I386_PGFLT = 14: should not occur in user space */
  170. /* EXC_I386_EXTERRFLT = 16: mapped to EXC_ARITHMETIC/EXC_I386_EXTERR */
  171. MD_EXCEPTION_CODE_MAC_X86_ALIGNMENT_FAULT = 17
  172. /* EXC_ALIGNFLT (for vector operations) */
  173. /* EXC_I386_ENOEXTFLT = 32: should be handled by the kernel */
  174. /* EXC_I386_ENDPERR = 33: should not occur */
  175. } MDExceptionCodeMac;
  176. #endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_MAC_OSX_H__ */