2020-05-04 12:14:39 +03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2020, Itamar S. <itamar8910@gmail.com>
|
|
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-05-04 12:14:39 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
2020-05-28 20:40:53 +02:00
|
|
|
|
2020-05-04 12:14:39 +03:00
|
|
|
#include "DwarfTypes.h"
|
|
|
|
|
#include <AK/HashMap.h>
|
|
|
|
|
#include <AK/Optional.h>
|
|
|
|
|
#include <AK/Types.h>
|
|
|
|
|
|
2020-08-25 04:33:07 +01:00
|
|
|
namespace Debug::Dwarf {
|
2020-05-28 20:40:53 +02:00
|
|
|
|
2020-05-04 12:14:39 +03:00
|
|
|
class DwarfInfo;
|
|
|
|
|
|
|
|
|
|
class AbbreviationsMap {
|
|
|
|
|
public:
|
2021-06-19 15:33:03 +03:00
|
|
|
AbbreviationsMap(DwarfInfo const& dwarf_info, u32 offset);
|
2020-05-04 12:14:39 +03:00
|
|
|
|
|
|
|
|
struct AbbreviationEntry {
|
|
|
|
|
EntryTag tag;
|
|
|
|
|
bool has_children;
|
|
|
|
|
|
|
|
|
|
Vector<AttributeSpecification> attribute_specifications;
|
|
|
|
|
};
|
2021-09-17 02:22:34 -07:00
|
|
|
AbbreviationEntry const* get(u32 code) const;
|
2020-05-04 12:14:39 +03:00
|
|
|
|
|
|
|
|
private:
|
2023-01-21 12:27:24 +01:00
|
|
|
ErrorOr<void> populate_map();
|
2020-05-04 12:14:39 +03:00
|
|
|
|
2021-06-19 15:33:03 +03:00
|
|
|
DwarfInfo const& m_dwarf_info;
|
2020-05-04 12:14:39 +03:00
|
|
|
u32 m_offset { 0 };
|
|
|
|
|
HashMap<u32, AbbreviationEntry> m_entries;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|