DebugSymbolsSubsection.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- DebugSymbolsSubsection.h --------------------------------*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. #ifndef LLVM_DEBUGINFO_CODEVIEW_DEBUGSYMBOLSSUBSECTION_H
  14. #define LLVM_DEBUGINFO_CODEVIEW_DEBUGSYMBOLSSUBSECTION_H
  15. #include "llvm/DebugInfo/CodeView/CVRecord.h"
  16. #include "llvm/DebugInfo/CodeView/DebugSubsection.h"
  17. #include "llvm/Support/Error.h"
  18. namespace llvm {
  19. namespace codeview {
  20. class DebugSymbolsSubsectionRef final : public DebugSubsectionRef {
  21. public:
  22. DebugSymbolsSubsectionRef()
  23. : DebugSubsectionRef(DebugSubsectionKind::Symbols) {}
  24. static bool classof(const DebugSubsectionRef *S) {
  25. return S->kind() == DebugSubsectionKind::Symbols;
  26. }
  27. Error initialize(BinaryStreamReader Reader);
  28. CVSymbolArray::Iterator begin() const { return Records.begin(); }
  29. CVSymbolArray::Iterator end() const { return Records.end(); }
  30. private:
  31. CVSymbolArray Records;
  32. };
  33. class DebugSymbolsSubsection final : public DebugSubsection {
  34. public:
  35. DebugSymbolsSubsection() : DebugSubsection(DebugSubsectionKind::Symbols) {}
  36. static bool classof(const DebugSubsection *S) {
  37. return S->kind() == DebugSubsectionKind::Symbols;
  38. }
  39. uint32_t calculateSerializedSize() const override;
  40. Error commit(BinaryStreamWriter &Writer) const override;
  41. void addSymbol(CVSymbol Symbol);
  42. private:
  43. uint32_t Length = 0;
  44. std::vector<CVSymbol> Records;
  45. };
  46. }
  47. }
  48. #endif
  49. #ifdef __GNUC__
  50. #pragma GCC diagnostic pop
  51. #endif