ABI.h revision 61d4f7adb6936a6d406dd5b20452d0843e538d76
1//===-- ABI.h ---------------------------------------------------*- C++ -*-===//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef liblldb_ABI_h_
11#define liblldb_ABI_h_
12
13// C Includes
14// C++ Includes
15// Other libraries and framework includes
16// Project includes
17#include "lldb/Core/PluginInterface.h"
18#include "lldb/lldb-private.h"
19
20namespace lldb_private {
21
22class ABI :
23    public PluginInterface
24{
25public:
26    virtual
27    ~ABI();
28
29    virtual size_t
30    GetRedZoneSize () const = 0;
31
32    virtual bool
33    PrepareTrivialCall (Thread &thread,
34                        lldb::addr_t sp,
35                        lldb::addr_t functionAddress,
36                        lldb::addr_t returnAddress,
37                        lldb::addr_t *arg1_ptr,
38                        lldb::addr_t *arg2_ptr,
39                        lldb::addr_t *arg3_ptr) const = 0;
40
41    virtual bool
42    GetArgumentValues (Thread &thread,
43                       ValueList &values) const = 0;
44
45    virtual bool
46    GetReturnValue (Thread &thread,
47                    Value &value) const = 0;
48
49    virtual bool
50    CreateFunctionEntryUnwindPlan (UnwindPlan &unwind_plan) = 0;
51
52    virtual bool
53    CreateDefaultUnwindPlan (UnwindPlan &unwind_plan) = 0;
54
55    virtual bool
56    RegisterIsVolatile (const RegisterInfo *reg_info) = 0;
57
58    static lldb::ABISP
59    FindPlugin (const ArchSpec &arch);
60
61protected:
62    //------------------------------------------------------------------
63    // Classes that inherit from ABI can see and modify these
64    //------------------------------------------------------------------
65    ABI();
66private:
67    DISALLOW_COPY_AND_ASSIGN (ABI);
68};
69
70} // namespace lldb_private
71
72#endif  // liblldb_ABI_h_
73