1 //===-- ABISysV_mips64.h ----------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_ABISysV_mips64_h_
11 #define liblldb_ABISysV_mips64_h_
15 // Other libraries and framework includes
17 #include "lldb/lldb-private.h"
18 #include "lldb/Target/ABI.h"
20 class ABISysV_mips64 :
21 public lldb_private::ABI
30 GetRedZoneSize () const;
33 PrepareTrivialCall (lldb_private::Thread &thread,
35 lldb::addr_t functionAddress,
36 lldb::addr_t returnAddress,
37 llvm::ArrayRef<lldb::addr_t> args) const;
40 GetArgumentValues (lldb_private::Thread &thread,
41 lldb_private::ValueList &values) const;
43 virtual lldb_private::Error
44 SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueObjectSP &new_value);
48 GetReturnValueObjectSimple (lldb_private::Thread &thread,
49 lldb_private::ClangASTType &ast_type) const;
52 virtual lldb::ValueObjectSP
53 GetReturnValueObjectImpl (lldb_private::Thread &thread,
54 lldb_private::ClangASTType &type) const;
57 CreateFunctionEntryUnwindPlan (lldb_private::UnwindPlan &unwind_plan);
60 CreateDefaultUnwindPlan (lldb_private::UnwindPlan &unwind_plan);
63 RegisterIsVolatile (const lldb_private::RegisterInfo *reg_info);
65 // The SysV mips ABI requires that stack frames be 16 byte aligned.
66 // When there is a trap handler on the stack, e.g. _sigtramp in userland
67 // code, we've seen that the stack pointer is often not aligned properly
68 // before the handler is invoked. This means that lldb will stop the unwind
69 // early -- before the function which caused the trap.
71 // To work around this, we relax that alignment to be just word-size (8-bytes).
72 // Whitelisting the trap handlers for user space would be easy (_sigtramp) but
73 // in other environments there can be a large number of different functions
74 // involved in async traps.
76 CallFrameAddressIsValid (lldb::addr_t cfa)
78 // Make sure the stack call frame addresses are 8 byte aligned
79 if (cfa & (8ull - 1ull))
80 return false; // Not 8 byte aligned
82 return false; // Zero is not a valid stack address
87 CodeAddressIsValid (lldb::addr_t pc)
89 if (pc & (4ull - 1ull))
90 return false; // Not 4 byte aligned
92 // Anything else if fair game..
96 virtual const lldb_private::RegisterInfo *
97 GetRegisterInfoArray (uint32_t &count);
98 //------------------------------------------------------------------
100 //------------------------------------------------------------------
108 CreateInstance (const lldb_private::ArchSpec &arch);
110 static lldb_private::ConstString
111 GetPluginNameStatic();
113 //------------------------------------------------------------------
114 // PluginInterface protocol
115 //------------------------------------------------------------------
116 virtual lldb_private::ConstString
124 CreateRegisterMapIfNeeded ();
127 RegisterIsCalleeSaved (const lldb_private::RegisterInfo *reg_info);
130 ABISysV_mips64() : lldb_private::ABI() { } // Call CreateInstance instead.
133 #endif // liblldb_ABI_h_