Greg Clayton | ffc922e3 | 2011-04-25 21:05:07 +0000 | [diff] [blame] | 1 | //===-- UnwindAssemblyInstEmulation.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_UnwindAssemblyInstEmulation_h_ |
| 11 | #define liblldb_UnwindAssemblyInstEmulation_h_ |
| 12 | |
| 13 | #include "lldb/lldb-private.h" |
| 14 | #include "lldb/Target/UnwindAssemblyProfiler.h" |
| 15 | #include "lldb/Target/Thread.h" |
| 16 | |
| 17 | class UnwindAssemblyInstEmulation : public lldb_private::UnwindAssemblyProfiler |
| 18 | { |
| 19 | public: |
| 20 | |
| 21 | virtual |
| 22 | ~UnwindAssemblyInstEmulation () |
| 23 | { |
| 24 | } |
| 25 | |
| 26 | virtual bool |
| 27 | GetNonCallSiteUnwindPlanFromAssembly (lldb_private::AddressRange& func, |
| 28 | lldb_private::Thread& thread, |
| 29 | lldb_private::UnwindPlan& unwind_plan); |
| 30 | |
| 31 | virtual bool |
| 32 | GetFastUnwindPlan (lldb_private::AddressRange& func, |
| 33 | lldb_private::Thread& thread, |
| 34 | lldb_private::UnwindPlan &unwind_plan); |
| 35 | |
| 36 | // thread may be NULL in which case we only use the Target (e.g. if this is called pre-process-launch). |
| 37 | virtual bool |
| 38 | FirstNonPrologueInsn (lldb_private::AddressRange& func, |
| 39 | lldb_private::Target& target, |
| 40 | lldb_private::Thread* thread, |
| 41 | lldb_private::Address& first_non_prologue_insn); |
| 42 | |
| 43 | static lldb_private::UnwindAssemblyProfiler * |
| 44 | CreateInstance (const lldb_private::ArchSpec &arch); |
| 45 | |
| 46 | |
| 47 | //------------------------------------------------------------------ |
| 48 | // PluginInterface protocol |
| 49 | //------------------------------------------------------------------ |
| 50 | static void |
| 51 | Initialize(); |
| 52 | |
| 53 | static void |
| 54 | Terminate(); |
| 55 | |
| 56 | static const char * |
| 57 | GetPluginNameStatic(); |
| 58 | |
| 59 | static const char * |
| 60 | GetPluginDescriptionStatic(); |
| 61 | |
| 62 | virtual const char * |
| 63 | GetPluginName(); |
| 64 | |
| 65 | virtual const char * |
| 66 | GetShortPluginName(); |
| 67 | |
| 68 | virtual uint32_t |
| 69 | GetPluginVersion(); |
| 70 | |
| 71 | private: |
| 72 | |
| 73 | // Call CreateInstance to get an instance of this class |
| 74 | UnwindAssemblyInstEmulation(int cpu) : |
| 75 | lldb_private::UnwindAssemblyProfiler(), m_cpu(cpu) |
| 76 | { |
| 77 | } |
| 78 | |
| 79 | int m_cpu; |
| 80 | }; |
| 81 | |
| 82 | #endif // liblldb_UnwindAssemblyInstEmulation_h_ |