LLVM: lib/DebugInfo/GSYM/Header.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
14
15#define HEX8(v) llvm::format_hex(v, 4)
16#define HEX16(v) llvm::format_hex(v, 6)
17#define HEX32(v) llvm::format_hex(v, 10)
18#define HEX64(v) llvm::format_hex(v, 18)
19
20using namespace llvm;
21using namespace gsym;
22
24 OS << "Header:\n";
25 OS << " Magic = " << HEX32(H.Magic) << "\n";
26 OS << " Version = " << HEX16(H.Version) << '\n';
27 OS << " AddrOffSize = " << HEX8(H.AddrOffSize) << '\n';
28 OS << " UUIDSize = " << HEX8(H.UUIDSize) << '\n';
29 OS << " BaseAddress = " << HEX64(H.BaseAddress) << '\n';
30 OS << " NumAddresses = " << HEX32(H.NumAddresses) << '\n';
31 OS << " StrtabOffset = " << HEX32(H.StrtabOffset) << '\n';
32 OS << " StrtabSize = " << HEX32(H.StrtabSize) << '\n';
33 OS << " UUID = ";
36 OS << '\n';
37 return OS;
38}
39
40
44 "invalid GSYM magic 0x%8.8x", Magic);
47 "unsupported GSYM version %u", Version);
49 case 1: break;
50 case 2: break;
51 case 4: break;
52 case 8: break;
53 default:
55 "invalid address offset size %u",
57 }
60 "invalid UUID size %u", UUIDSize);
62}
63
66
69 "not enough data for a gsym::Header");
81 return std::move(Err);
82 return H;
83}
84
86
88 return Err;
89 O.writeU32(Magic);
99}
100
102 return LHS.Magic == RHS.Magic && LHS.Version == RHS.Version &&
103 LHS.AddrOffSize == RHS.AddrOffSize && LHS.UUIDSize == RHS.UUIDSize &&
104 LHS.BaseAddress == RHS.BaseAddress &&
105 LHS.NumAddresses == RHS.NumAddresses &&
106 LHS.StrtabOffset == RHS.StrtabOffset &&
107 LHS.StrtabSize == RHS.StrtabSize &&
109}
Merge contiguous icmps into a memcmp
std::pair< llvm::MachO::Target, std::string > UUID
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
Tagged union holding either a T or a Error.
A simplified binary data writer class that doesn't require targets, target definitions,...
This class implements an extremely fast bulk output stream that can only output to a stream.
raw_ostream & operator<<(raw_ostream &OS, const CallSiteInfo &CSI)
constexpr size_t GSYM_MAX_UUID_SIZE
bool operator==(const FunctionInfo &LHS, const FunctionInfo &RHS)
constexpr uint32_t GSYM_MAGIC
constexpr uint32_t GSYM_VERSION
This is an optimization pass for GlobalISel generic memory operations.
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.
FormattedNumber format_hex_no_prefix(uint64_t N, unsigned Width, bool Upper=false)
format_hex_no_prefix - Output N as a fixed width hexadecimal.