AddressRanges.h 744 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (c) 2020-2021, Itamar S. <itamar8910@gmail.com>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include "CompilationUnit.h"
  8. #include <AK/Forward.h>
  9. #include <AK/Function.h>
  10. #include <AK/MemoryStream.h>
  11. #include <AK/Noncopyable.h>
  12. namespace Debug::Dwarf {
  13. class AddressRanges {
  14. AK_MAKE_NONCOPYABLE(AddressRanges);
  15. AK_MAKE_NONMOVABLE(AddressRanges);
  16. public:
  17. AddressRanges(ReadonlyBytes range_lists_data, size_t offset, CompilationUnit const& compilation_unit);
  18. struct Range {
  19. FlatPtr start { 0 };
  20. FlatPtr end { 0 };
  21. };
  22. void for_each_range(Function<void(Range)>);
  23. private:
  24. InputMemoryStream m_range_lists_stream;
  25. CompilationUnit const& m_compilation_unit;
  26. };
  27. }