LLDB  mainline
BreakpadRecords.cpp
Go to the documentation of this file.
1 //===-- BreakpadRecords.cpp -----------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
10 #include "llvm/ADT/StringExtras.h"
11 #include "llvm/ADT/StringSwitch.h"
12 #include "llvm/Support/Endian.h"
13 #include "llvm/Support/FormatVariadic.h"
14 
15 using namespace lldb_private;
16 using namespace lldb_private::breakpad;
17 
18 namespace {
19 enum class Token {
20  Unknown,
21  Module,
22  Info,
23  CodeID,
24  File,
25  Func,
26  Inline,
27  InlineOrigin,
28  Public,
29  Stack,
30  CFI,
31  Init,
32  Win,
33 };
34 }
35 
36 template<typename T>
37 static T stringTo(llvm::StringRef Str);
38 
39 template <> Token stringTo<Token>(llvm::StringRef Str) {
40  return llvm::StringSwitch<Token>(Str)
41  .Case("MODULE", Token::Module)
42  .Case("INFO", Token::Info)
43  .Case("CODE_ID", Token::CodeID)
44  .Case("FILE", Token::File)
45  .Case("FUNC", Token::Func)
46  .Case("INLINE", Token::Inline)
47  .Case("INLINE_ORIGIN", Token::InlineOrigin)
48  .Case("PUBLIC", Token::Public)
49  .Case("STACK", Token::Stack)
50  .Case("CFI", Token::CFI)
51  .Case("INIT", Token::Init)
52  .Case("WIN", Token::Win)
53  .Default(Token::Unknown);
54 }
55 
56 template <>
57 llvm::Triple::OSType stringTo<llvm::Triple::OSType>(llvm::StringRef Str) {
58  using llvm::Triple;
59  return llvm::StringSwitch<Triple::OSType>(Str)
60  .Case("Linux", Triple::Linux)
61  .Case("mac", Triple::MacOSX)
62  .Case("windows", Triple::Win32)
63  .Default(Triple::UnknownOS);
64 }
65 
66 template <>
67 llvm::Triple::ArchType stringTo<llvm::Triple::ArchType>(llvm::StringRef Str) {
68  using llvm::Triple;
69  return llvm::StringSwitch<Triple::ArchType>(Str)
70  .Case("arm", Triple::arm)
71  .Cases("arm64", "arm64e", Triple::aarch64)
72  .Case("mips", Triple::mips)
73  .Case("ppc", Triple::ppc)
74  .Case("ppc64", Triple::ppc64)
75  .Case("s390", Triple::systemz)
76  .Case("sparc", Triple::sparc)
77  .Case("sparcv9", Triple::sparcv9)
78  .Case("x86", Triple::x86)
79  .Cases("x86_64", "x86_64h", Triple::x86_64)
80  .Default(Triple::UnknownArch);
81 }
82 
83 template<typename T>
84 static T consume(llvm::StringRef &Str) {
85  llvm::StringRef Token;
86  std::tie(Token, Str) = getToken(Str);
87  return stringTo<T>(Token);
88 }
89 
90 /// Return the number of hex digits needed to encode an (POD) object of a given
91 /// type.
92 template <typename T> static constexpr size_t hex_digits() {
93  return 2 * sizeof(T);
94 }
95 
96 static UUID parseModuleId(llvm::Triple::OSType os, llvm::StringRef str) {
97  struct data_t {
98  using uuid_t = uint8_t[16];
99  uuid_t uuid;
100  llvm::support::ubig32_t age;
101  } data;
102  static_assert(sizeof(data) == 20, "");
103  // The textual module id encoding should be between 33 and 40 bytes long,
104  // depending on the size of the age field, which is of variable length.
105  // The first three chunks of the id are encoded in big endian, so we need to
106  // byte-swap those.
107  if (str.size() <= hex_digits<data_t::uuid_t>() ||
108  str.size() > hex_digits<data_t>())
109  return UUID();
110  if (!all_of(str, llvm::isHexDigit))
111  return UUID();
112 
113  llvm::StringRef uuid_str = str.take_front(hex_digits<data_t::uuid_t>());
114  llvm::StringRef age_str = str.drop_front(hex_digits<data_t::uuid_t>());
115 
116  llvm::copy(fromHex(uuid_str), data.uuid);
117  uint32_t age;
118  bool success = to_integer(age_str, age, 16);
119  assert(success);
120  (void)success;
121  data.age = age;
122 
123  // On non-windows, the age field should always be zero, so we don't include to
124  // match the native uuid format of these platforms.
125  return UUID::fromData(&data, os == llvm::Triple::Win32 ? sizeof(data)
126  : sizeof(data.uuid));
127 }
128 
129 llvm::Optional<Record::Kind> Record::classify(llvm::StringRef Line) {
130  Token Tok = consume<Token>(Line);
131  switch (Tok) {
132  case Token::Module:
133  return Record::Module;
134  case Token::Info:
135  return Record::Info;
136  case Token::File:
137  return Record::File;
138  case Token::Func:
139  return Record::Func;
140  case Token::Public:
141  return Record::Public;
142  case Token::Stack:
143  Tok = consume<Token>(Line);
144  switch (Tok) {
145  case Token::CFI:
146  return Record::StackCFI;
147  case Token::Win:
148  return Record::StackWin;
149  default:
150  return llvm::None;
151  }
152  case Token::Inline:
153  return Record::Inline;
154  case Token::InlineOrigin:
155  return Record::InlineOrigin;
156  case Token::Unknown:
157  // Optimistically assume that any unrecognised token means this is a line
158  // record, those don't have a special keyword and start directly with a
159  // hex number.
160  return Record::Line;
161 
162  case Token::CodeID:
163  case Token::CFI:
164  case Token::Init:
165  case Token::Win:
166  // These should never appear at the start of a valid record.
167  return llvm::None;
168  }
169  llvm_unreachable("Fully covered switch above!");
170 }
171 
172 llvm::Optional<ModuleRecord> ModuleRecord::parse(llvm::StringRef Line) {
173  // MODULE Linux x86_64 E5894855C35DCCCCCCCCCCCCCCCCCCCC0 a.out
174  if (consume<Token>(Line) != Token::Module)
175  return llvm::None;
176 
177  llvm::Triple::OSType OS = consume<llvm::Triple::OSType>(Line);
178  if (OS == llvm::Triple::UnknownOS)
179  return llvm::None;
180 
181  llvm::Triple::ArchType Arch = consume<llvm::Triple::ArchType>(Line);
182  if (Arch == llvm::Triple::UnknownArch)
183  return llvm::None;
184 
185  llvm::StringRef Str;
186  std::tie(Str, Line) = getToken(Line);
187  UUID ID = parseModuleId(OS, Str);
188  if (!ID)
189  return llvm::None;
190 
191  return ModuleRecord(OS, Arch, std::move(ID));
192 }
193 
194 llvm::raw_ostream &breakpad::operator<<(llvm::raw_ostream &OS,
195  const ModuleRecord &R) {
196  return OS << "MODULE " << llvm::Triple::getOSTypeName(R.OS) << " "
197  << llvm::Triple::getArchTypeName(R.Arch) << " "
198  << R.ID.GetAsString();
199 }
200 
201 llvm::Optional<InfoRecord> InfoRecord::parse(llvm::StringRef Line) {
202  // INFO CODE_ID 554889E55DC3CCCCCCCCCCCCCCCCCCCC [a.exe]
203  if (consume<Token>(Line) != Token::Info)
204  return llvm::None;
205 
206  if (consume<Token>(Line) != Token::CodeID)
207  return llvm::None;
208 
209  llvm::StringRef Str;
210  std::tie(Str, Line) = getToken(Line);
211  // If we don't have any text following the code ID (e.g. on linux), we should
212  // use this as the UUID. Otherwise, we should revert back to the module ID.
213  UUID ID;
214  if (Line.trim().empty()) {
215  if (Str.empty() || !ID.SetFromStringRef(Str))
216  return llvm::None;
217  }
218  return InfoRecord(std::move(ID));
219 }
220 
221 llvm::raw_ostream &breakpad::operator<<(llvm::raw_ostream &OS,
222  const InfoRecord &R) {
223  return OS << "INFO CODE_ID " << R.ID.GetAsString();
224 }
225 
226 template <typename T>
227 static llvm::Optional<T> parseNumberName(llvm::StringRef Line,
228  Token TokenType) {
229  // TOKEN number name
230  if (consume<Token>(Line) != TokenType)
231  return llvm::None;
232 
233  llvm::StringRef Str;
234  size_t Number;
235  std::tie(Str, Line) = getToken(Line);
236  if (!to_integer(Str, Number))
237  return llvm::None;
238 
239  llvm::StringRef Name = Line.trim();
240  if (Name.empty())
241  return llvm::None;
242 
243  return T(Number, Name);
244 }
245 
246 llvm::Optional<FileRecord> FileRecord::parse(llvm::StringRef Line) {
247  // FILE number name
248  return parseNumberName<FileRecord>(Line, Token::File);
249 }
250 
251 llvm::raw_ostream &breakpad::operator<<(llvm::raw_ostream &OS,
252  const FileRecord &R) {
253  return OS << "FILE " << R.Number << " " << R.Name;
254 }
255 
256 llvm::Optional<InlineOriginRecord>
257 InlineOriginRecord::parse(llvm::StringRef Line) {
258  // INLINE_ORIGIN number name
259  return parseNumberName<InlineOriginRecord>(Line, Token::InlineOrigin);
260 }
261 
262 llvm::raw_ostream &breakpad::operator<<(llvm::raw_ostream &OS,
263  const InlineOriginRecord &R) {
264  return OS << "INLINE_ORIGIN " << R.Number << " " << R.Name;
265 }
266 
267 static bool parsePublicOrFunc(llvm::StringRef Line, bool &Multiple,
269  lldb::addr_t &ParamSize, llvm::StringRef &Name) {
270  // PUBLIC [m] address param_size name
271  // or
272  // FUNC [m] address size param_size name
273 
274  Token Tok = Size ? Token::Func : Token::Public;
275 
276  if (consume<Token>(Line) != Tok)
277  return false;
278 
279  llvm::StringRef Str;
280  std::tie(Str, Line) = getToken(Line);
281  Multiple = Str == "m";
282 
283  if (Multiple)
284  std::tie(Str, Line) = getToken(Line);
285  if (!to_integer(Str, Address, 16))
286  return false;
287 
288  if (Tok == Token::Func) {
289  std::tie(Str, Line) = getToken(Line);
290  if (!to_integer(Str, *Size, 16))
291  return false;
292  }
293 
294  std::tie(Str, Line) = getToken(Line);
295  if (!to_integer(Str, ParamSize, 16))
296  return false;
297 
298  Name = Line.trim();
299  if (Name.empty())
300  return false;
301 
302  return true;
303 }
304 
305 llvm::Optional<FuncRecord> FuncRecord::parse(llvm::StringRef Line) {
306  bool Multiple;
308  llvm::StringRef Name;
309 
312 
313  return llvm::None;
314 }
315 
316 bool breakpad::operator==(const FuncRecord &L, const FuncRecord &R) {
317  return L.Multiple == R.Multiple && L.Address == R.Address &&
318  L.Size == R.Size && L.ParamSize == R.ParamSize && L.Name == R.Name;
319 }
320 llvm::raw_ostream &breakpad::operator<<(llvm::raw_ostream &OS,
321  const FuncRecord &R) {
322  return OS << llvm::formatv("FUNC {0}{1:x-} {2:x-} {3:x-} {4}",
323  R.Multiple ? "m " : "", R.Address, R.Size,
324  R.ParamSize, R.Name);
325 }
326 
327 llvm::Optional<InlineRecord> InlineRecord::parse(llvm::StringRef Line) {
328  // INLINE inline_nest_level call_site_line call_site_file_num origin_num
329  // [address size]+
330  if (consume<Token>(Line) != Token::Inline)
331  return llvm::None;
332 
333  llvm::SmallVector<llvm::StringRef> Tokens;
334  SplitString(Line, Tokens, " ");
335  if (Tokens.size() < 6 || Tokens.size() % 2 == 1)
336  return llvm::None;
337 
338  size_t InlineNestLevel;
340  size_t CallSiteFileNum;
341  size_t OriginNum;
342  if (!(to_integer(Tokens[0], InlineNestLevel) &&
343  to_integer(Tokens[1], CallSiteLineNum) &&
344  to_integer(Tokens[2], CallSiteFileNum) &&
345  to_integer(Tokens[3], OriginNum)))
346  return llvm::None;
347 
350  for (size_t i = 4; i < Tokens.size(); i += 2) {
352  if (!to_integer(Tokens[i], Address, 16))
353  return llvm::None;
354  lldb::addr_t Size;
355  if (!to_integer(Tokens[i + 1].trim(), Size, 16))
356  return llvm::None;
357  Record.Ranges.emplace_back(Address, Size);
358  }
359  return Record;
360 }
361 
363  return L.InlineNestLevel == R.InlineNestLevel &&
366  L.Ranges == R.Ranges;
367 }
368 
369 llvm::raw_ostream &breakpad::operator<<(llvm::raw_ostream &OS,
370  const InlineRecord &R) {
371  OS << llvm::formatv("INLINE {0} {1} {2} {3}", R.InlineNestLevel,
373  for (const auto &range : R.Ranges) {
374  OS << llvm::formatv(" {0:x-} {1:x-}", range.first, range.second);
375  }
376  return OS;
377 }
378 
379 llvm::Optional<LineRecord> LineRecord::parse(llvm::StringRef Line) {
381  llvm::StringRef Str;
382  std::tie(Str, Line) = getToken(Line);
383  if (!to_integer(Str, Address, 16))
384  return llvm::None;
385 
387  std::tie(Str, Line) = getToken(Line);
388  if (!to_integer(Str, Size, 16))
389  return llvm::None;
390 
392  std::tie(Str, Line) = getToken(Line);
393  if (!to_integer(Str, LineNum))
394  return llvm::None;
395 
396  size_t FileNum;
397  std::tie(Str, Line) = getToken(Line);
398  if (!to_integer(Str, FileNum))
399  return llvm::None;
400 
402 }
403 
404 bool breakpad::operator==(const LineRecord &L, const LineRecord &R) {
405  return L.Address == R.Address && L.Size == R.Size && L.LineNum == R.LineNum &&
406  L.FileNum == R.FileNum;
407 }
408 llvm::raw_ostream &breakpad::operator<<(llvm::raw_ostream &OS,
409  const LineRecord &R) {
410  return OS << llvm::formatv("{0:x-} {1:x-} {2} {3}", R.Address, R.Size,
411  R.LineNum, R.FileNum);
412 }
413 
414 llvm::Optional<PublicRecord> PublicRecord::parse(llvm::StringRef Line) {
415  bool Multiple;
417  llvm::StringRef Name;
418 
421 
422  return llvm::None;
423 }
424 
426  return L.Multiple == R.Multiple && L.Address == R.Address &&
427  L.ParamSize == R.ParamSize && L.Name == R.Name;
428 }
429 llvm::raw_ostream &breakpad::operator<<(llvm::raw_ostream &OS,
430  const PublicRecord &R) {
431  return OS << llvm::formatv("PUBLIC {0}{1:x-} {2:x-} {3}",
432  R.Multiple ? "m " : "", R.Address, R.ParamSize,
433  R.Name);
434 }
435 
436 llvm::Optional<StackCFIRecord> StackCFIRecord::parse(llvm::StringRef Line) {
437  // STACK CFI INIT address size reg1: expr1 reg2: expr2 ...
438  // or
439  // STACK CFI address reg1: expr1 reg2: expr2 ...
440  // No token in exprN ends with a colon.
441 
442  if (consume<Token>(Line) != Token::Stack)
443  return llvm::None;
444  if (consume<Token>(Line) != Token::CFI)
445  return llvm::None;
446 
447  llvm::StringRef Str;
448  std::tie(Str, Line) = getToken(Line);
449 
450  bool IsInitRecord = stringTo<Token>(Str) == Token::Init;
451  if (IsInitRecord)
452  std::tie(Str, Line) = getToken(Line);
453 
455  if (!to_integer(Str, Address, 16))
456  return llvm::None;
457 
458  llvm::Optional<lldb::addr_t> Size;
459  if (IsInitRecord) {
460  Size.emplace();
461  std::tie(Str, Line) = getToken(Line);
462  if (!to_integer(Str, *Size, 16))
463  return llvm::None;
464  }
465 
466  return StackCFIRecord(Address, Size, Line.trim());
467 }
468 
470  return L.Address == R.Address && L.Size == R.Size &&
471  L.UnwindRules == R.UnwindRules;
472 }
473 
474 llvm::raw_ostream &breakpad::operator<<(llvm::raw_ostream &OS,
475  const StackCFIRecord &R) {
476  OS << "STACK CFI ";
477  if (R.Size)
478  OS << "INIT ";
479  OS << llvm::formatv("{0:x-} ", R.Address);
480  if (R.Size)
481  OS << llvm::formatv("{0:x-} ", *R.Size);
482  return OS << " " << R.UnwindRules;
483 }
484 
485 llvm::Optional<StackWinRecord> StackWinRecord::parse(llvm::StringRef Line) {
486  // STACK WIN type rva code_size prologue_size epilogue_size parameter_size
487  // saved_register_size local_size max_stack_size has_program_string
488  // program_string_OR_allocates_base_pointer
489 
490  if (consume<Token>(Line) != Token::Stack)
491  return llvm::None;
492  if (consume<Token>(Line) != Token::Win)
493  return llvm::None;
494 
495  llvm::StringRef Str;
496  uint8_t Type;
497  std::tie(Str, Line) = getToken(Line);
498  // Right now we only support the "FrameData" frame type.
499  if (!to_integer(Str, Type) || FrameType(Type) != FrameType::FrameData)
500  return llvm::None;
501 
503  std::tie(Str, Line) = getToken(Line);
504  if (!to_integer(Str, RVA, 16))
505  return llvm::None;
506 
508  std::tie(Str, Line) = getToken(Line);
509  if (!to_integer(Str, CodeSize, 16))
510  return llvm::None;
511 
512  // Skip fields which we aren't using right now.
513  std::tie(Str, Line) = getToken(Line); // prologue_size
514  std::tie(Str, Line) = getToken(Line); // epilogue_size
515 
517  std::tie(Str, Line) = getToken(Line);
518  if (!to_integer(Str, ParameterSize, 16))
519  return llvm::None;
520 
522  std::tie(Str, Line) = getToken(Line);
523  if (!to_integer(Str, SavedRegisterSize, 16))
524  return llvm::None;
525 
527  std::tie(Str, Line) = getToken(Line);
528  if (!to_integer(Str, LocalSize, 16))
529  return llvm::None;
530 
531  std::tie(Str, Line) = getToken(Line); // max_stack_size
532 
533  uint8_t HasProgramString;
534  std::tie(Str, Line) = getToken(Line);
535  if (!to_integer(Str, HasProgramString))
536  return llvm::None;
537  // FrameData records should always have a program string.
538  if (!HasProgramString)
539  return llvm::None;
540 
542  LocalSize, Line.trim());
543 }
544 
546  return L.RVA == R.RVA && L.CodeSize == R.CodeSize &&
547  L.ParameterSize == R.ParameterSize &&
550 }
551 
552 llvm::raw_ostream &breakpad::operator<<(llvm::raw_ostream &OS,
553  const StackWinRecord &R) {
554  return OS << llvm::formatv(
555  "STACK WIN 4 {0:x-} {1:x-} ? ? {2} {3} {4} ? 1 {5}", R.RVA,
557  R.ProgramString);
558 }
559 
560 llvm::StringRef breakpad::toString(Record::Kind K) {
561  switch (K) {
562  case Record::Module:
563  return "MODULE";
564  case Record::Info:
565  return "INFO";
566  case Record::File:
567  return "FILE";
568  case Record::Func:
569  return "FUNC";
570  case Record::Inline:
571  return "INLINE";
573  return "INLINE_ORIGIN";
574  case Record::Line:
575  return "LINE";
576  case Record::Public:
577  return "PUBLIC";
578  case Record::StackCFI:
579  return "STACK CFI";
580  case Record::StackWin:
581  return "STACK WIN";
582  }
583  llvm_unreachable("Unknown record kind!");
584 }
lldb_private::breakpad::Record::Line
@ Line
Definition: BreakpadRecords.h:30
lldb_private::breakpad::StackWinRecord::RVA
lldb::addr_t RVA
Definition: BreakpadRecords.h:220
lldb_private::UUID::fromData
static UUID fromData(const void *bytes, uint32_t num_bytes)
Creates a UUID from the data pointed to by the bytes argument.
Definition: UUID.h:45
lldb_private::breakpad::ModuleRecord::ModuleRecord
ModuleRecord(llvm::Triple::OSType OS, llvm::Triple::ArchType Arch, UUID ID)
Definition: BreakpadRecords.h:62
lldb_private::UUID
Definition: UUID.h:23
lldb_private::breakpad::Record::Module
@ Module
Definition: BreakpadRecords.h:24
lldb_private::breakpad::ModuleRecord::OS
llvm::Triple::OSType OS
Definition: BreakpadRecords.h:65
lldb_private::breakpad::StackWinRecord::StackWinRecord
StackWinRecord(lldb::addr_t RVA, lldb::addr_t CodeSize, lldb::addr_t ParameterSize, lldb::addr_t SavedRegisterSize, lldb::addr_t LocalSize, llvm::StringRef ProgramString)
Definition: BreakpadRecords.h:212
lldb_private::breakpad::FuncRecord
Definition: BreakpadRecords.h:120
lldb_private::breakpad::PublicRecord::Address
lldb::addr_t Address
Definition: BreakpadRecords.h:184
lldb_private::breakpad::StackWinRecord::parse
static llvm::Optional< StackWinRecord > parse(llvm::StringRef Line)
Definition: BreakpadRecords.cpp:485
lldb_private::breakpad::Record
Definition: BreakpadRecords.h:21
lldb_private::breakpad::LineRecord::LineRecord
LineRecord(lldb::addr_t Address, lldb::addr_t Size, uint32_t LineNum, size_t FileNum)
Definition: BreakpadRecords.h:161
lldb_private::breakpad::StackCFIRecord::parse
static llvm::Optional< StackCFIRecord > parse(llvm::StringRef Line)
Definition: BreakpadRecords.cpp:436
lldb_private::breakpad::LineRecord::FileNum
size_t FileNum
Definition: BreakpadRecords.h:169
lldb_private::breakpad::StackWinRecord::ParameterSize
lldb::addr_t ParameterSize
Definition: BreakpadRecords.h:222
lldb_private::breakpad::FuncRecord::Size
lldb::addr_t Size
Definition: BreakpadRecords.h:130
lldb_private::breakpad::Record::StackWin
@ StackWin
Definition: BreakpadRecords.h:33
lldb_private::breakpad::FileRecord::Name
llvm::StringRef Name
Definition: BreakpadRecords.h:95
lldb_private::breakpad::Record::StackCFI
@ StackCFI
Definition: BreakpadRecords.h:32
lldb_private::breakpad::StackWinRecord
Definition: BreakpadRecords.h:208
lldb_private::Module
Definition: Module.h:85
stringTo
static T stringTo(llvm::StringRef Str)
lldb_private::breakpad::StackWinRecord::FrameType::FrameData
@ FrameData
lldb_private::breakpad::InlineOriginRecord::Name
llvm::StringRef Name
Definition: BreakpadRecords.h:110
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
stringTo< Token >
Token stringTo< Token >(llvm::StringRef Str)
Definition: BreakpadRecords.cpp:39
consume
static T consume(llvm::StringRef &Str)
Definition: BreakpadRecords.cpp:84
lldb_private::UUID::GetAsString
std::string GetAsString(llvm::StringRef separator="-") const
Definition: UUID.cpp:48
lldb_private::breakpad::FuncRecord::Multiple
bool Multiple
Definition: BreakpadRecords.h:128
lldb_private::breakpad::InfoRecord
Definition: BreakpadRecords.h:75
lldb_private::breakpad::ModuleRecord::Arch
llvm::Triple::ArchType Arch
Definition: BreakpadRecords.h:66
lldb_private::breakpad::StackCFIRecord
Definition: BreakpadRecords.h:192
lldb_private::breakpad::StackCFIRecord::Size
llvm::Optional< lldb::addr_t > Size
Definition: BreakpadRecords.h:201
lldb_private::breakpad::InlineRecord
Definition: BreakpadRecords.h:138
lldb_private::breakpad::PublicRecord::parse
static llvm::Optional< PublicRecord > parse(llvm::StringRef Line)
Definition: BreakpadRecords.cpp:414
lldb_private::breakpad::Record::InlineOrigin
@ InlineOrigin
Definition: BreakpadRecords.h:29
lldb_private::breakpad::toString
llvm::StringRef toString(Record::Kind K)
Definition: BreakpadRecords.cpp:560
lldb_private::breakpad::InlineOriginRecord::Number
size_t Number
Definition: BreakpadRecords.h:109
lldb_private::breakpad::FileRecord::parse
static llvm::Optional< FileRecord > parse(llvm::StringRef Line)
Definition: BreakpadRecords.cpp:246
lldb_private::breakpad::InlineRecord::Ranges
std::vector< std::pair< lldb::addr_t, lldb::addr_t > > Ranges
Definition: BreakpadRecords.h:152
lldb_private::breakpad::LineRecord::Address
lldb::addr_t Address
Definition: BreakpadRecords.h:166
lldb_private::breakpad::InlineRecord::parse
static llvm::Optional< InlineRecord > parse(llvm::StringRef Line)
Definition: BreakpadRecords.cpp:327
lldb_private::breakpad::operator<<
llvm::raw_ostream & operator<<(llvm::raw_ostream &OS, Record::Kind K)
Definition: BreakpadRecords.h:54
lldb_private::breakpad::Record::Inline
@ Inline
Definition: BreakpadRecords.h:28
lldb_private::breakpad::StackWinRecord::CodeSize
lldb::addr_t CodeSize
Definition: BreakpadRecords.h:221
lldb_private::breakpad::InlineOriginRecord::parse
static llvm::Optional< InlineOriginRecord > parse(llvm::StringRef Line)
Definition: BreakpadRecords.cpp:257
lldb_private::breakpad::InlineRecord::CallSiteLineNum
uint32_t CallSiteLineNum
Definition: BreakpadRecords.h:148
lldb_private::breakpad::FileRecord::Number
size_t Number
Definition: BreakpadRecords.h:94
lldb_private::breakpad::PublicRecord::Multiple
bool Multiple
Definition: BreakpadRecords.h:183
lldb_private::breakpad::ModuleRecord::ID
UUID ID
Definition: BreakpadRecords.h:67
lldb_private::breakpad::InfoRecord::parse
static llvm::Optional< InfoRecord > parse(llvm::StringRef Line)
Definition: BreakpadRecords.cpp:201
lldb_private::breakpad::FileRecord
Definition: BreakpadRecords.h:88
lldb_private::breakpad::Record::Public
@ Public
Definition: BreakpadRecords.h:31
lldb_private::File
Definition: File.h:35
lldb_private::breakpad::InlineRecord::InlineNestLevel
size_t InlineNestLevel
Definition: BreakpadRecords.h:147
lldb_private::breakpad::LineRecord::LineNum
uint32_t LineNum
Definition: BreakpadRecords.h:168
lldb_private::breakpad::LineRecord
Definition: BreakpadRecords.h:158
lldb_private::breakpad::StackWinRecord::ProgramString
llvm::StringRef ProgramString
Definition: BreakpadRecords.h:225
lldb_private::breakpad::StackWinRecord::FrameType
FrameType
Definition: BreakpadRecords.h:219
lldb_private::breakpad
Definition: BreakpadRecords.h:19
lldb_private::breakpad::FuncRecord::ParamSize
lldb::addr_t ParamSize
Definition: BreakpadRecords.h:131
lldb_private::breakpad::PublicRecord::PublicRecord
PublicRecord(bool Multiple, lldb::addr_t Address, lldb::addr_t ParamSize, llvm::StringRef Name)
Definition: BreakpadRecords.h:178
lldb_private::breakpad::StackWinRecord::SavedRegisterSize
lldb::addr_t SavedRegisterSize
Definition: BreakpadRecords.h:223
lldb_private::breakpad::PublicRecord::Name
llvm::StringRef Name
Definition: BreakpadRecords.h:186
lldb_private::breakpad::InlineRecord::OriginNum
size_t OriginNum
Definition: BreakpadRecords.h:150
lldb_private::breakpad::Record::Record
Record(Kind K)
Definition: BreakpadRecords.h:42
lldb_private::breakpad::FuncRecord::parse
static llvm::Optional< FuncRecord > parse(llvm::StringRef Line)
Definition: BreakpadRecords.cpp:305
lldb_private::breakpad::InlineRecord::InlineRecord
InlineRecord(size_t InlineNestLevel, uint32_t CallSiteLineNum, size_t CallSiteFileNum, size_t OriginNum)
Definition: BreakpadRecords.h:141
uint32_t
lldb_private::breakpad::FuncRecord::FuncRecord
FuncRecord(bool Multiple, lldb::addr_t Address, lldb::addr_t Size, lldb::addr_t ParamSize, llvm::StringRef Name)
Definition: BreakpadRecords.h:123
lldb_private::Address
Definition: Address.h:59
lldb_private::UUID::SetFromStringRef
bool SetFromStringRef(llvm::StringRef str)
Definition: UUID.cpp:96
lldb_private::breakpad::InfoRecord::InfoRecord
InfoRecord(UUID ID)
Definition: BreakpadRecords.h:78
lldb_private::breakpad::InfoRecord::ID
UUID ID
Definition: BreakpadRecords.h:80
parseNumberName
static llvm::Optional< T > parseNumberName(llvm::StringRef Line, Token TokenType)
Definition: BreakpadRecords.cpp:227
lldb_private::Type
Definition: Type.h:66
lldb_private::breakpad::operator==
bool operator==(const ModuleRecord &L, const ModuleRecord &R)
Definition: BreakpadRecords.h:70
lldb_private::breakpad::InlineRecord::CallSiteFileNum
size_t CallSiteFileNum
Definition: BreakpadRecords.h:149
lldb_private::breakpad::StackCFIRecord::Address
lldb::addr_t Address
Definition: BreakpadRecords.h:200
lldb_private::breakpad::ModuleRecord::parse
static llvm::Optional< ModuleRecord > parse(llvm::StringRef Line)
Definition: BreakpadRecords.cpp:172
parsePublicOrFunc
static bool parsePublicOrFunc(llvm::StringRef Line, bool &Multiple, lldb::addr_t &Address, lldb::addr_t *Size, lldb::addr_t &ParamSize, llvm::StringRef &Name)
Definition: BreakpadRecords.cpp:267
lldb_private::breakpad::ModuleRecord
Definition: BreakpadRecords.h:59
lldb_private::breakpad::Record::File
@ File
Definition: BreakpadRecords.h:26
hex_digits
static constexpr size_t hex_digits()
Return the number of hex digits needed to encode an (POD) object of a given type.
Definition: BreakpadRecords.cpp:92
lldb_private::breakpad::PublicRecord::ParamSize
lldb::addr_t ParamSize
Definition: BreakpadRecords.h:185
lldb_private::breakpad::Record::Info
@ Info
Definition: BreakpadRecords.h:25
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::breakpad::Record::Kind
Kind
Definition: BreakpadRecords.h:23
lldb_private::breakpad::FuncRecord::Name
llvm::StringRef Name
Definition: BreakpadRecords.h:132
lldb_private::breakpad::PublicRecord
Definition: BreakpadRecords.h:175
lldb_private::breakpad::Record::Func
@ Func
Definition: BreakpadRecords.h:27
lldb_private::breakpad::LineRecord::parse
static llvm::Optional< LineRecord > parse(llvm::StringRef Line)
Definition: BreakpadRecords.cpp:379
parseModuleId
static UUID parseModuleId(llvm::Triple::OSType os, llvm::StringRef str)
Definition: BreakpadRecords.cpp:96
lldb_private::breakpad::StackCFIRecord::StackCFIRecord
StackCFIRecord(lldb::addr_t Address, llvm::Optional< lldb::addr_t > Size, llvm::StringRef UnwindRules)
Definition: BreakpadRecords.h:195
lldb_private::breakpad::Record::classify
static llvm::Optional< Kind > classify(llvm::StringRef Line)
Attempt to guess the kind of the record present in the argument without doing a full parse.
Definition: BreakpadRecords.cpp:129
lldb_private::breakpad::StackCFIRecord::UnwindRules
llvm::StringRef UnwindRules
Definition: BreakpadRecords.h:202
lldb_private::breakpad::LineRecord::Size
lldb::addr_t Size
Definition: BreakpadRecords.h:167
BreakpadRecords.h
uuid_t
unsigned char uuid_t[16]
Definition: UuidCompatibility.h:15
lldb_private::breakpad::FuncRecord::Address
lldb::addr_t Address
Definition: BreakpadRecords.h:129
lldb_private::breakpad::StackWinRecord::LocalSize
lldb::addr_t LocalSize
Definition: BreakpadRecords.h:224
lldb_private::breakpad::InlineOriginRecord
Definition: BreakpadRecords.h:103
lldb_private::LLDBLog::OS
@ OS