mirror of
https://github.com/RGBCube/serenity
synced 2025-05-15 15:04:59 +00:00

This helps us avoid weird truncation issues and fixes a bug on Clang builds where truncation while reading caused the DIE offsets following large LEB128 numbers to be incorrect. This removes the need for the separate `LongUnsignedNumber` type.
41 lines
879 B
C++
41 lines
879 B
C++
/*
|
|
* Copyright (c) 2021, Itamar S. <itamar8910@gmail.com>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/Types.h>
|
|
#include <LibDebug/Dwarf/DwarfTypes.h>
|
|
|
|
namespace Debug::Dwarf {
|
|
|
|
struct AttributeValue {
|
|
enum class Type : u8 {
|
|
UnsignedNumber,
|
|
SignedNumber,
|
|
String,
|
|
DieReference, // Reference to another DIE in the same compilation unit
|
|
Boolean,
|
|
DwarfExpression,
|
|
SecOffset,
|
|
RawBytes,
|
|
} type;
|
|
|
|
union {
|
|
FlatPtr as_addr;
|
|
u64 as_unsigned;
|
|
i64 as_signed;
|
|
const char* as_string; // points to bytes in the memory mapped elf image
|
|
bool as_bool;
|
|
struct {
|
|
u32 length;
|
|
const u8* bytes; // points to bytes in the memory mapped elf image
|
|
} as_raw_bytes;
|
|
} data {};
|
|
|
|
AttributeDataForm form {};
|
|
};
|
|
|
|
}
|