1//===-- ABISysV_msp430.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 LLDB_SOURCE_PLUGINS_ABI_MSP430_ABISYSV_MSP430_H
11#define LLDB_SOURCE_PLUGINS_ABI_MSP430_ABISYSV_MSP430_H
12
13#include "lldb/Target/ABI.h"
14#include "lldb/lldb-private.h"
15
16class ABISysV_msp430 : public lldb_private::RegInfoBasedABI {
17public:
18 ~ABISysV_msp430() override = default;
19
20 size_t GetRedZoneSize() const override;
21
22 bool PrepareTrivialCall(lldb_private::Thread &thread, lldb::addr_t sp,
23 lldb::addr_t functionAddress,
24 lldb::addr_t returnAddress,
25 llvm::ArrayRef<lldb::addr_t> args) const override;
26
27 bool GetArgumentValues(lldb_private::Thread &thread,
28 lldb_private::ValueList &values) const override;
29
30 lldb_private::Status
31 SetReturnValueObject(lldb::StackFrameSP &frame_sp,
32 lldb::ValueObjectSP &new_value) override;
33
34 lldb::ValueObjectSP
35 GetReturnValueObjectImpl(lldb_private::Thread &thread,
36 lldb_private::CompilerType &type) const override;
37
38 bool
39 CreateFunctionEntryUnwindPlan(lldb_private::UnwindPlan &unwind_plan) override;
40
41 bool CreateDefaultUnwindPlan(lldb_private::UnwindPlan &unwind_plan) override;
42
43 bool RegisterIsVolatile(const lldb_private::RegisterInfo *reg_info) override;
44
45 bool CallFrameAddressIsValid(lldb::addr_t cfa) override {
46 // Make sure the stack call frame addresses are 2 byte aligned
47 // and not zero
48 if (cfa & 0x01 || cfa == 0)
49 return false;
50 return true;
51 }
52
53 bool CodeAddressIsValid(lldb::addr_t pc) override { return true; }
54
55 const lldb_private::RegisterInfo *
56 GetRegisterInfoArray(uint32_t &count) override;
57
58 uint64_t GetStackFrameSize() override { return 512; }
59
60 //------------------------------------------------------------------
61 // Static Functions
62 //------------------------------------------------------------------
63
64 static void Initialize();
65
66 static void Terminate();
67
68 static lldb::ABISP CreateInstance(lldb::ProcessSP process_sp,
69 const lldb_private::ArchSpec &arch);
70
71 static llvm::StringRef GetPluginNameStatic() { return "sysv-msp430"; }
72
73 // PluginInterface protocol
74
75 llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
76
77protected:
78 void CreateRegisterMapIfNeeded();
79
80 lldb::ValueObjectSP
81 GetReturnValueObjectSimple(lldb_private::Thread &thread,
82 lldb_private::CompilerType &ast_type) const;
83
84 bool RegisterIsCalleeSaved(const lldb_private::RegisterInfo *reg_info);
85
86private:
87 using lldb_private::RegInfoBasedABI::RegInfoBasedABI;
88};
89
90#endif // LLDB_SOURCE_PLUGINS_ABI_MSP430_ABISYSV_MSP430_H
91

source code of lldb/source/Plugins/ABI/MSP430/ABISysV_msp430.h