Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 1 | //===-- UnwindLibUnwind.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_UnwindLibUnwind_h_ |
| 11 | #define lldb_UnwindLibUnwind_h_ |
| 12 | |
| 13 | // C Includes |
| 14 | // C++ Includes |
| 15 | #include <vector> |
| 16 | |
| 17 | // Other libraries and framework includes |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 18 | #include "libunwind/include/libunwind.h" |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 19 | |
| 20 | // Project includes |
| 21 | #include "lldb/lldb-private.h" |
| 22 | #include "lldb/Target/Unwind.h" |
| 23 | |
| 24 | class UnwindLibUnwind : public lldb_private::Unwind |
| 25 | { |
| 26 | public: |
| 27 | UnwindLibUnwind (lldb_private::Thread &thread, |
| 28 | lldb_private::unw_addr_space_t addr_space); |
| 29 | |
| 30 | virtual |
| 31 | ~UnwindLibUnwind() |
| 32 | { |
| 33 | } |
| 34 | |
| 35 | virtual void |
| 36 | Clear() |
| 37 | { |
| 38 | m_cursors.clear(); |
| 39 | } |
| 40 | |
| 41 | virtual uint32_t |
| 42 | GetFrameCount(); |
| 43 | |
| 44 | bool |
| 45 | GetFrameInfoAtIndex (uint32_t frame_idx, |
| 46 | lldb::addr_t& cfa, |
| 47 | lldb::addr_t& pc); |
| 48 | |
| 49 | lldb_private::RegisterContext * |
| 50 | CreateRegisterContextForFrame (lldb_private::StackFrame *frame); |
| 51 | |
| 52 | lldb_private::Thread & |
| 53 | GetThread(); |
| 54 | |
| 55 | private: |
| 56 | lldb_private::unw_addr_space_t m_addr_space; |
| 57 | std::vector<lldb_private::unw_cursor_t> m_cursors; |
| 58 | uint32_t m_pc_regnum; |
| 59 | uint32_t m_sp_regnum; |
| 60 | //------------------------------------------------------------------ |
| 61 | // For UnwindLibUnwind only |
| 62 | //------------------------------------------------------------------ |
| 63 | DISALLOW_COPY_AND_ASSIGN (UnwindLibUnwind); |
| 64 | }; |
| 65 | |
| 66 | #endif // lldb_UnwindLibUnwind_h_ |