Johnny Chen | 9ed5b49 | 2012-01-05 21:48:15 +0000 | [diff] [blame] | 1 | //===-- ProcessMessage.cpp --------------------------------------*- 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 | #include "ProcessMessage.h" |
| 11 | |
| 12 | using namespace lldb_private; |
| 13 | |
Johnny Chen | 9ed5b49 | 2012-01-05 21:48:15 +0000 | [diff] [blame] | 14 | const char * |
| 15 | ProcessMessage::PrintCrashReason() const |
| 16 | { |
Chaoren Lin | 28e5742 | 2015-02-03 01:51:25 +0000 | [diff] [blame] | 17 | return CrashReasonAsString(m_crash_reason); |
Johnny Chen | 9ed5b49 | 2012-01-05 21:48:15 +0000 | [diff] [blame] | 18 | } |
| 19 | |
| 20 | const char * |
| 21 | ProcessMessage::PrintKind(Kind kind) |
| 22 | { |
| 23 | #ifdef LLDB_CONFIGURATION_BUILDANDINTEGRATION |
Chaoren Lin | 28e5742 | 2015-02-03 01:51:25 +0000 | [diff] [blame] | 24 | // Just return the code in ascii for integration builds. |
Johnny Chen | 9ed5b49 | 2012-01-05 21:48:15 +0000 | [diff] [blame] | 25 | chcar str[8]; |
| 26 | sprintf(str, "%d", reason); |
| 27 | #else |
| 28 | const char *str = NULL; |
| 29 | |
| 30 | switch (kind) |
| 31 | { |
Johnny Chen | 9ed5b49 | 2012-01-05 21:48:15 +0000 | [diff] [blame] | 32 | case eInvalidMessage: |
| 33 | str = "eInvalidMessage"; |
| 34 | break; |
Ed Maste | e544143 | 2013-09-03 23:55:30 +0000 | [diff] [blame] | 35 | case eAttachMessage: |
| 36 | str = "eAttachMessage"; |
| 37 | break; |
Johnny Chen | 9ed5b49 | 2012-01-05 21:48:15 +0000 | [diff] [blame] | 38 | case eExitMessage: |
| 39 | str = "eExitMessage"; |
| 40 | break; |
| 41 | case eLimboMessage: |
| 42 | str = "eLimboMessage"; |
| 43 | break; |
| 44 | case eSignalMessage: |
| 45 | str = "eSignalMessage"; |
| 46 | break; |
| 47 | case eSignalDeliveredMessage: |
| 48 | str = "eSignalDeliveredMessage"; |
| 49 | break; |
| 50 | case eTraceMessage: |
| 51 | str = "eTraceMessage"; |
| 52 | break; |
| 53 | case eBreakpointMessage: |
| 54 | str = "eBreakpointMessage"; |
| 55 | break; |
Matt Kopec | e9ea0da | 2013-05-07 19:29:28 +0000 | [diff] [blame] | 56 | case eWatchpointMessage: |
| 57 | str = "eWatchpointMessage"; |
| 58 | break; |
Johnny Chen | 9ed5b49 | 2012-01-05 21:48:15 +0000 | [diff] [blame] | 59 | case eCrashMessage: |
| 60 | str = "eCrashMessage"; |
| 61 | break; |
Matt Kopec | 650648f | 2013-01-08 16:30:18 +0000 | [diff] [blame] | 62 | case eNewThreadMessage: |
| 63 | str = "eNewThreadMessage"; |
| 64 | break; |
Joerg Sonnenberger | c5e53bd | 2013-10-20 17:35:46 +0000 | [diff] [blame] | 65 | case eExecMessage: |
| 66 | str = "eExecMessage"; |
| 67 | break; |
Johnny Chen | 9ed5b49 | 2012-01-05 21:48:15 +0000 | [diff] [blame] | 68 | } |
| 69 | #endif |
| 70 | |
| 71 | return str; |
| 72 | } |
| 73 | |
| 74 | const char * |
| 75 | ProcessMessage::PrintKind() const |
| 76 | { |
| 77 | return PrintKind(m_kind); |
| 78 | } |