blob: 3231397a05e3bf4a2d0d698d9a2572f595227dea [file] [log] [blame]
Zachary Turner50232572015-03-18 21:31:45 +00001//===-- 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
11using namespace lldb;
12using namespace lldb_private;
13
14const char *
15lldb_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
29const char *
30lldb_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 Berghammerc178d4c2015-08-25 11:45:58 +000066 case eSectionTypeDWARFDebugAddr:
67 return "dwarf-addr";
Zachary Turner50232572015-03-18 21:31:45 +000068 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 Chandrad8335e92015-12-16 00:22:08 +000080 case eSectionTypeDWARFDebugMacro:
81 return "dwarf-macro";
Zachary Turner50232572015-03-18 21:31:45 +000082 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 Berghammerc178d4c2015-08-25 11:45:58 +000090 case eSectionTypeDWARFDebugStrOffsets:
91 return "dwarf-str-offsets";
Zachary Turner50232572015-03-18 21:31:45 +000092 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 Berghammer648f3c72015-09-30 13:50:14 +0000110 case eSectionTypeARMexidx:
111 return "ARM.exidx";
112 case eSectionTypeARMextab:
113 return "ARM.extab";
Zachary Turner50232572015-03-18 21:31:45 +0000114 case eSectionTypeCompactUnwind:
115 return "compact-unwind";
Ryan Brown65d4d5c2015-09-16 21:20:44 +0000116 case eSectionTypeGoSymtab:
117 return "go-symtab";
Zachary Turner50232572015-03-18 21:31:45 +0000118 case eSectionTypeOther:
119 return "regular";
120 }
121 return "unknown";
122}