AttributeValue.h 894 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Copyright (c) 2021, Itamar S. <itamar8910@gmail.com>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/Types.h>
  8. #include <LibDebug/Dwarf/DwarfTypes.h>
  9. namespace Debug::Dwarf {
  10. struct AttributeValue {
  11. enum class Type : u8 {
  12. UnsignedNumber,
  13. SignedNumber,
  14. LongUnsignedNumber,
  15. String,
  16. DieReference, // Reference to another DIE in the same compilation unit
  17. Boolean,
  18. DwarfExpression,
  19. SecOffset,
  20. RawBytes,
  21. } type;
  22. union {
  23. u32 as_u32;
  24. i32 as_i32;
  25. u64 as_u64;
  26. const char* as_string; // points to bytes in the memory mapped elf image
  27. bool as_bool;
  28. struct {
  29. u32 length;
  30. const u8* bytes; // points to bytes in the memory mapped elf image
  31. } as_raw_bytes;
  32. } data {};
  33. AttributeDataForm form {};
  34. };
  35. }