aboutsummaryrefslogtreecommitdiff
path: root/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.h
blob: 4d43a6e02b7314bbd9ec7c31945840fa6af207c7 (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
//===-- UnwindAssembly-x86.h ------------------------------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef liblldb_UnwindAssembly_x86_h_
#define liblldb_UnwindAssembly_x86_h_

// C Includes
// C++ Includes
// Other libraries and framework includes
#include "llvm-c/Disassembler.h"

// Project includes
#include "lldb/lldb-private.h"
#include "lldb/Target/UnwindAssembly.h"

class UnwindAssembly_x86 : public lldb_private::UnwindAssembly
{
public:
    ~UnwindAssembly_x86() override;

    bool
    GetNonCallSiteUnwindPlanFromAssembly(lldb_private::AddressRange& func,
                                         lldb_private::Thread& thread,
                                         lldb_private::UnwindPlan& unwind_plan) override;

    bool
    AugmentUnwindPlanFromCallSite(lldb_private::AddressRange& func,
                                  lldb_private::Thread& thread,
                                  lldb_private::UnwindPlan& unwind_plan) override;

    bool
    GetFastUnwindPlan(lldb_private::AddressRange& func,
                      lldb_private::Thread& thread,
                      lldb_private::UnwindPlan &unwind_plan) override;

    // thread may be NULL in which case we only use the Target (e.g. if this is called pre-process-launch).
    bool
    FirstNonPrologueInsn(lldb_private::AddressRange& func,
                         const lldb_private::ExecutionContext &exe_ctx,
                         lldb_private::Address& first_non_prologue_insn) override;

    static lldb_private::UnwindAssembly *
    CreateInstance (const lldb_private::ArchSpec &arch);

    //------------------------------------------------------------------
    // PluginInterface protocol
    //------------------------------------------------------------------
    static void
    Initialize();

    static void
    Terminate();

    static lldb_private::ConstString
    GetPluginNameStatic();

    static const char *
    GetPluginDescriptionStatic();

    lldb_private::ConstString
    GetPluginName() override;
    
    uint32_t
    GetPluginVersion() override;
    
private:
    UnwindAssembly_x86 (const lldb_private::ArchSpec &arch, int cpu);

    int m_cpu;
    lldb_private::ArchSpec m_arch;
};

#endif // liblldb_UnwindAssembly_x86_h_