aboutsummaryrefslogtreecommitdiff
path: root/source/Plugins/SymbolFile/DWARF/DWARFASTParserGo.h
blob: 5039fc7f76725ffad72436428d24f75372d0aebb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
//===-- DWARFASTParserGo.h --------------------------------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef SymbolFileDWARF_DWARFASTParserGo_h_
#define SymbolFileDWARF_DWARFASTParserGo_h_

// C Includes
// C++ Includes
// Other libraries and framework includes
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"

// Project includes
#include "lldb/Core/PluginInterface.h"
#include "lldb/Symbol/GoASTContext.h"
#include "DWARFDefines.h"
#include "DWARFASTParser.h"
#include "DWARFDIE.h"

class DWARFDebugInfoEntry;
class DWARFDIECollection;

class DWARFASTParserGo : public DWARFASTParser
{
public:
    DWARFASTParserGo(lldb_private::GoASTContext &ast);

    ~DWARFASTParserGo() override;

    lldb::TypeSP ParseTypeFromDWARF(const lldb_private::SymbolContext &sc, const DWARFDIE &die, lldb_private::Log *log,
                                    bool *type_is_new_ptr) override;

    lldb_private::Function *
    ParseFunctionFromDWARF(const lldb_private::SymbolContext &sc,
                           const DWARFDIE &die) override;

    bool
    CompleteTypeFromDWARF(const DWARFDIE &die, lldb_private::Type *type,
                          lldb_private::CompilerType &go_type) override;

    lldb_private::CompilerDeclContext
    GetDeclContextForUIDFromDWARF(const DWARFDIE &die) override
    {
        return lldb_private::CompilerDeclContext();
    }

    lldb_private::CompilerDeclContext
    GetDeclContextContainingUIDFromDWARF(const DWARFDIE &die) override
    {
        return lldb_private::CompilerDeclContext();
    }

    lldb_private::CompilerDecl
    GetDeclForUIDFromDWARF (const DWARFDIE &die) override
    {
        return lldb_private::CompilerDecl();
    }

    std::vector<DWARFDIE>
    GetDIEForDeclContext (lldb_private::CompilerDeclContext decl_context) override
    {
        return std::vector<DWARFDIE>();
    }

private:
    size_t ParseChildParameters(const lldb_private::SymbolContext &sc, const DWARFDIE &parent_die, bool &is_variadic,
                                std::vector<lldb_private::CompilerType> &function_param_types);
    void ParseChildArrayInfo(const lldb_private::SymbolContext &sc, const DWARFDIE &parent_die, int64_t &first_index,
                             std::vector<uint64_t> &element_orders, uint32_t &byte_stride, uint32_t &bit_stride);

    size_t ParseChildMembers(const lldb_private::SymbolContext &sc, const DWARFDIE &die,
                             lldb_private::CompilerType &class_compiler_type);

    lldb_private::GoASTContext &m_ast;
};

#endif // SymbolFileDWARF_DWARFASTParserGo_h_