Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame^] | 1 | //===-- StoppointLocation.cpp -----------------------------------*- 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 | #include "lldb/Breakpoint/StoppointLocation.h" |
| 11 | |
| 12 | // C Includes |
| 13 | // C++ Includes |
| 14 | // Other libraries and framework includes |
| 15 | // Project includes |
| 16 | |
| 17 | using namespace lldb; |
| 18 | using namespace lldb_private; |
| 19 | |
| 20 | //---------------------------------------------------------------------- |
| 21 | // StoppointLocation constructor |
| 22 | //---------------------------------------------------------------------- |
| 23 | StoppointLocation::StoppointLocation (break_id_t bid, addr_t addr, tid_t tid, bool hardware) : |
| 24 | m_loc_id(bid), |
| 25 | m_tid(tid), |
| 26 | m_byte_size(0), |
| 27 | m_addr(addr), |
| 28 | m_hit_count(0), |
| 29 | m_hw_preferred(hardware), |
| 30 | m_hw_index(LLDB_INVALID_INDEX32) |
| 31 | { |
| 32 | } |
| 33 | |
| 34 | StoppointLocation::StoppointLocation (break_id_t bid, addr_t addr, tid_t tid, size_t size, bool hardware) : |
| 35 | m_loc_id(bid), |
| 36 | m_tid(tid), |
| 37 | m_byte_size(size), |
| 38 | m_addr(addr), |
| 39 | m_hit_count(0), |
| 40 | m_hw_preferred(hardware), |
| 41 | m_hw_index(LLDB_INVALID_INDEX32) |
| 42 | { |
| 43 | } |
| 44 | |
| 45 | //---------------------------------------------------------------------- |
| 46 | // Destructor |
| 47 | //---------------------------------------------------------------------- |
| 48 | StoppointLocation::~StoppointLocation() |
| 49 | { |
| 50 | } |
| 51 | |
| 52 | |
| 53 | size_t |
| 54 | StoppointLocation::GetByteSize () const |
| 55 | { |
| 56 | return m_byte_size; |
| 57 | } |
| 58 | |
| 59 | addr_t |
| 60 | StoppointLocation::GetLoadAddress() const |
| 61 | { |
| 62 | return m_addr; |
| 63 | } |
| 64 | |
| 65 | tid_t |
| 66 | StoppointLocation::GetThreadID() const |
| 67 | { |
| 68 | return m_tid; |
| 69 | } |
| 70 | |
| 71 | uint32_t |
| 72 | StoppointLocation::GetHitCount () const |
| 73 | { |
| 74 | return m_hit_count; |
| 75 | } |
| 76 | |
| 77 | bool |
| 78 | StoppointLocation::HardwarePreferred () const |
| 79 | { |
| 80 | return m_hw_preferred; |
| 81 | } |
| 82 | |
| 83 | bool |
| 84 | StoppointLocation::IsHardware () const |
| 85 | { |
| 86 | return m_hw_index != LLDB_INVALID_INDEX32; |
| 87 | } |
| 88 | |
| 89 | uint32_t |
| 90 | StoppointLocation::GetHardwareIndex () const |
| 91 | { |
| 92 | return m_hw_index; |
| 93 | } |
| 94 | |
| 95 | void |
| 96 | StoppointLocation::SetHardwareIndex (uint32_t hw_index) |
| 97 | { |
| 98 | m_hw_index = hw_index; |
| 99 | } |
| 100 | |
| 101 | // RETURNS - true if we should stop at this breakpoint, false if we |
| 102 | // should continue. |
| 103 | |
| 104 | bool |
| 105 | StoppointLocation::ShouldStop (StoppointCallbackContext *context) |
| 106 | { |
| 107 | return true; |
| 108 | } |
| 109 | |
| 110 | break_id_t |
| 111 | StoppointLocation::GetID() const |
| 112 | { |
| 113 | return m_loc_id; |
| 114 | } |
| 115 | |
| 116 | void |
| 117 | StoppointLocation::Dump (Stream *stream) const |
| 118 | { |
| 119 | |
| 120 | } |