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