1 //===-- ABISysV_hexagon.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_ABISysV_hexagon_h_ 11 #define liblldb_ABISysV_hexagon_h_ 12 13 // C Includes 14 // C++ Includes 15 // Other libraries and framework includes 16 // Project includes 17 #include "lldb/lldb-private.h" 18 #include "lldb/Target/ABI.h" 19 20 class ABISysV_hexagon : 21 public lldb_private::ABI 22 { 23 public: 24 ~ABISysV_hexagon(void)25 ~ABISysV_hexagon( void ) 26 { 27 } 28 29 virtual size_t 30 GetRedZoneSize ( void ) const; 31 32 virtual bool 33 PrepareTrivialCall ( lldb_private::Thread &thread, 34 lldb::addr_t sp, 35 lldb::addr_t functionAddress, 36 lldb::addr_t returnAddress, 37 llvm::ArrayRef<lldb::addr_t> args ) const; 38 39 // special thread plan for GDB style non-jit function calls 40 virtual bool 41 PrepareTrivialCall ( lldb_private::Thread &thread, 42 lldb::addr_t sp, 43 lldb::addr_t functionAddress, 44 lldb::addr_t returnAddress, 45 llvm::Type &prototype, 46 llvm::ArrayRef<ABI::CallArgument> args ) const; 47 48 virtual bool 49 GetArgumentValues ( lldb_private::Thread &thread, 50 lldb_private::ValueList &values ) const; 51 52 virtual lldb_private::Error 53 SetReturnValueObject ( lldb::StackFrameSP &frame_sp, 54 lldb::ValueObjectSP &new_value ); 55 56 protected: 57 lldb::ValueObjectSP 58 GetReturnValueObjectSimple ( lldb_private::Thread &thread, 59 lldb_private::ClangASTType &ast_type ) const; 60 61 public: 62 virtual lldb::ValueObjectSP 63 GetReturnValueObjectImpl ( lldb_private::Thread &thread, 64 lldb_private::ClangASTType &type ) const; 65 66 // specialized to work with llvm IR types 67 virtual lldb::ValueObjectSP 68 GetReturnValueObjectImpl ( lldb_private::Thread &thread, llvm::Type &type ) const; 69 70 virtual bool 71 CreateFunctionEntryUnwindPlan ( lldb_private::UnwindPlan &unwind_plan ); 72 73 virtual bool 74 CreateDefaultUnwindPlan ( lldb_private::UnwindPlan &unwind_plan ); 75 76 virtual bool 77 RegisterIsVolatile ( const lldb_private::RegisterInfo *reg_info ); 78 79 virtual bool CallFrameAddressIsValid(lldb::addr_t cfa)80 CallFrameAddressIsValid ( lldb::addr_t cfa ) 81 { 82 // Make sure the stack call frame addresses are 8 byte aligned 83 if (cfa & 0x07) 84 return false; // Not 8 byte aligned 85 if (cfa == 0) 86 return false; // Zero is not a valid stack address 87 return true; 88 } 89 90 virtual bool CodeAddressIsValid(lldb::addr_t pc)91 CodeAddressIsValid ( lldb::addr_t pc ) 92 { 93 // We have a 64 bit address space, so anything is valid as opcodes 94 // aren't fixed width... 95 return true; 96 } 97 98 virtual const lldb_private::RegisterInfo * 99 GetRegisterInfoArray ( uint32_t &count ); 100 101 //------------------------------------------------------------------ 102 // Static Functions 103 //------------------------------------------------------------------ 104 static void 105 Initialize ( void ); 106 107 static void 108 Terminate ( void ); 109 110 static lldb::ABISP 111 CreateInstance ( const lldb_private::ArchSpec &arch ); 112 113 static lldb_private::ConstString 114 GetPluginNameStatic ( void ); 115 116 //------------------------------------------------------------------ 117 // PluginInterface protocol 118 //------------------------------------------------------------------ 119 virtual lldb_private::ConstString 120 GetPluginName ( void ); 121 122 virtual uint32_t 123 GetPluginVersion ( void ); 124 125 protected: 126 void 127 CreateRegisterMapIfNeeded ( void ); 128 129 bool 130 RegisterIsCalleeSaved (const lldb_private::RegisterInfo *reg_info); 131 132 private: ABISysV_hexagon(void)133 ABISysV_hexagon ( void ) : lldb_private::ABI() { } // Call CreateInstance instead. 134 }; 135 136 #endif // liblldb_ABISysV_hexagon_h_ 137