DebugSymbolsSubsection.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //===- DebugSymbolsSubsection.h --------------------------------*- C++ -*-===//
  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. #ifndef LLVM_DEBUGINFO_CODEVIEW_DEBUGSYMBOLSSUBSECTION_H
  9. #define LLVM_DEBUGINFO_CODEVIEW_DEBUGSYMBOLSSUBSECTION_H
  10. #include "llvm/DebugInfo/CodeView/CVRecord.h"
  11. #include "llvm/DebugInfo/CodeView/DebugSubsection.h"
  12. #include "llvm/Support/Error.h"
  13. namespace llvm {
  14. namespace codeview {
  15. class DebugSymbolsSubsectionRef final : public DebugSubsectionRef {
  16. public:
  17. DebugSymbolsSubsectionRef()
  18. : DebugSubsectionRef(DebugSubsectionKind::Symbols) {}
  19. static bool classof(const DebugSubsectionRef *S) {
  20. return S->kind() == DebugSubsectionKind::Symbols;
  21. }
  22. Error initialize(BinaryStreamReader Reader);
  23. CVSymbolArray::Iterator begin() const { return Records.begin(); }
  24. CVSymbolArray::Iterator end() const { return Records.end(); }
  25. private:
  26. CVSymbolArray Records;
  27. };
  28. class DebugSymbolsSubsection final : public DebugSubsection {
  29. public:
  30. DebugSymbolsSubsection() : DebugSubsection(DebugSubsectionKind::Symbols) {}
  31. static bool classof(const DebugSubsection *S) {
  32. return S->kind() == DebugSubsectionKind::Symbols;
  33. }
  34. uint32_t calculateSerializedSize() const override;
  35. Error commit(BinaryStreamWriter &Writer) const override;
  36. void addSymbol(CVSymbol Symbol);
  37. private:
  38. uint32_t Length = 0;
  39. std::vector<CVSymbol> Records;
  40. };
  41. }
  42. }
  43. #endif