Zachary Turner | 5023257 | 2015-03-18 21:31:45 +0000 | [diff] [blame] | 1 | //===-- ConvertEnum.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 | #include "lldb/Utility/ConvertEnum.h" |
| 10 | |
| 11 | using namespace lldb; |
| 12 | using namespace lldb_private; |
| 13 | |
| 14 | const char * |
| 15 | lldb_private::GetVoteAsCString(Vote vote) |
| 16 | { |
| 17 | switch (vote) |
| 18 | { |
| 19 | case eVoteNo: |
| 20 | return "no"; |
| 21 | case eVoteNoOpinion: |
| 22 | return "no opinion"; |
| 23 | case eVoteYes: |
| 24 | return "yes"; |
| 25 | } |
| 26 | return "invalid"; |
| 27 | } |
| 28 | |
| 29 | const char * |
| 30 | lldb_private::GetSectionTypeAsCString(lldb::SectionType sect_type) |
| 31 | { |
| 32 | switch (sect_type) |
| 33 | { |
| 34 | case eSectionTypeInvalid: |
| 35 | return "invalid"; |
| 36 | case eSectionTypeCode: |
| 37 | return "code"; |
| 38 | case eSectionTypeContainer: |
| 39 | return "container"; |
| 40 | case eSectionTypeData: |
| 41 | return "data"; |
| 42 | case eSectionTypeDataCString: |
| 43 | return "data-cstr"; |
| 44 | case eSectionTypeDataCStringPointers: |
| 45 | return "data-cstr-ptr"; |
| 46 | case eSectionTypeDataSymbolAddress: |
| 47 | return "data-symbol-addr"; |
| 48 | case eSectionTypeData4: |
| 49 | return "data-4-byte"; |
| 50 | case eSectionTypeData8: |
| 51 | return "data-8-byte"; |
| 52 | case eSectionTypeData16: |
| 53 | return "data-16-byte"; |
| 54 | case eSectionTypeDataPointers: |
| 55 | return "data-ptrs"; |
| 56 | case eSectionTypeDebug: |
| 57 | return "debug"; |
| 58 | case eSectionTypeZeroFill: |
| 59 | return "zero-fill"; |
| 60 | case eSectionTypeDataObjCMessageRefs: |
| 61 | return "objc-message-refs"; |
| 62 | case eSectionTypeDataObjCCFStrings: |
| 63 | return "objc-cfstrings"; |
| 64 | case eSectionTypeDWARFDebugAbbrev: |
| 65 | return "dwarf-abbrev"; |
Tamas Berghammer | c178d4c | 2015-08-25 11:45:58 +0000 | [diff] [blame] | 66 | case eSectionTypeDWARFDebugAddr: |
| 67 | return "dwarf-addr"; |
Zachary Turner | 5023257 | 2015-03-18 21:31:45 +0000 | [diff] [blame] | 68 | case eSectionTypeDWARFDebugAranges: |
| 69 | return "dwarf-aranges"; |
| 70 | case eSectionTypeDWARFDebugFrame: |
| 71 | return "dwarf-frame"; |
| 72 | case eSectionTypeDWARFDebugInfo: |
| 73 | return "dwarf-info"; |
| 74 | case eSectionTypeDWARFDebugLine: |
| 75 | return "dwarf-line"; |
| 76 | case eSectionTypeDWARFDebugLoc: |
| 77 | return "dwarf-loc"; |
| 78 | case eSectionTypeDWARFDebugMacInfo: |
| 79 | return "dwarf-macinfo"; |
Siva Chandra | d8335e9 | 2015-12-16 00:22:08 +0000 | [diff] [blame] | 80 | case eSectionTypeDWARFDebugMacro: |
| 81 | return "dwarf-macro"; |
Zachary Turner | 5023257 | 2015-03-18 21:31:45 +0000 | [diff] [blame] | 82 | case eSectionTypeDWARFDebugPubNames: |
| 83 | return "dwarf-pubnames"; |
| 84 | case eSectionTypeDWARFDebugPubTypes: |
| 85 | return "dwarf-pubtypes"; |
| 86 | case eSectionTypeDWARFDebugRanges: |
| 87 | return "dwarf-ranges"; |
| 88 | case eSectionTypeDWARFDebugStr: |
| 89 | return "dwarf-str"; |
Tamas Berghammer | c178d4c | 2015-08-25 11:45:58 +0000 | [diff] [blame] | 90 | case eSectionTypeDWARFDebugStrOffsets: |
| 91 | return "dwarf-str-offsets"; |
Zachary Turner | 5023257 | 2015-03-18 21:31:45 +0000 | [diff] [blame] | 92 | case eSectionTypeELFSymbolTable: |
| 93 | return "elf-symbol-table"; |
| 94 | case eSectionTypeELFDynamicSymbols: |
| 95 | return "elf-dynamic-symbols"; |
| 96 | case eSectionTypeELFRelocationEntries: |
| 97 | return "elf-relocation-entries"; |
| 98 | case eSectionTypeELFDynamicLinkInfo: |
| 99 | return "elf-dynamic-link-info"; |
| 100 | case eSectionTypeDWARFAppleNames: |
| 101 | return "apple-names"; |
| 102 | case eSectionTypeDWARFAppleTypes: |
| 103 | return "apple-types"; |
| 104 | case eSectionTypeDWARFAppleNamespaces: |
| 105 | return "apple-namespaces"; |
| 106 | case eSectionTypeDWARFAppleObjC: |
| 107 | return "apple-objc"; |
| 108 | case eSectionTypeEHFrame: |
| 109 | return "eh-frame"; |
Tamas Berghammer | 648f3c7 | 2015-09-30 13:50:14 +0000 | [diff] [blame] | 110 | case eSectionTypeARMexidx: |
| 111 | return "ARM.exidx"; |
| 112 | case eSectionTypeARMextab: |
| 113 | return "ARM.extab"; |
Zachary Turner | 5023257 | 2015-03-18 21:31:45 +0000 | [diff] [blame] | 114 | case eSectionTypeCompactUnwind: |
| 115 | return "compact-unwind"; |
Ryan Brown | 65d4d5c | 2015-09-16 21:20:44 +0000 | [diff] [blame] | 116 | case eSectionTypeGoSymtab: |
| 117 | return "go-symtab"; |
Zachary Turner | 5023257 | 2015-03-18 21:31:45 +0000 | [diff] [blame] | 118 | case eSectionTypeOther: |
| 119 | return "regular"; |
| 120 | } |
| 121 | return "unknown"; |
| 122 | } |