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 | //---------------------------------------------------------------------- |
Jim Ingham | 3c7b5b9 | 2010-06-16 02:00:15 +0000 | [diff] [blame^] | 23 | StoppointLocation::StoppointLocation (break_id_t bid, addr_t addr, bool hardware) : |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 24 | m_loc_id(bid), |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 25 | m_byte_size(0), |
| 26 | m_addr(addr), |
| 27 | m_hit_count(0), |
| 28 | m_hw_preferred(hardware), |
| 29 | m_hw_index(LLDB_INVALID_INDEX32) |
| 30 | { |
| 31 | } |
| 32 | |
Jim Ingham | 3c7b5b9 | 2010-06-16 02:00:15 +0000 | [diff] [blame^] | 33 | StoppointLocation::StoppointLocation (break_id_t bid, addr_t addr, size_t size, bool hardware) : |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 34 | m_loc_id(bid), |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 35 | m_byte_size(size), |
| 36 | m_addr(addr), |
| 37 | m_hit_count(0), |
| 38 | m_hw_preferred(hardware), |
| 39 | m_hw_index(LLDB_INVALID_INDEX32) |
| 40 | { |
| 41 | } |
| 42 | |
| 43 | //---------------------------------------------------------------------- |
| 44 | // Destructor |
| 45 | //---------------------------------------------------------------------- |
| 46 | StoppointLocation::~StoppointLocation() |
| 47 | { |
| 48 | } |
| 49 | |
| 50 | |
| 51 | size_t |
| 52 | StoppointLocation::GetByteSize () const |
| 53 | { |
| 54 | return m_byte_size; |
| 55 | } |
| 56 | |
| 57 | addr_t |
| 58 | StoppointLocation::GetLoadAddress() const |
| 59 | { |
| 60 | return m_addr; |
| 61 | } |
| 62 | |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 63 | uint32_t |
| 64 | StoppointLocation::GetHitCount () const |
| 65 | { |
| 66 | return m_hit_count; |
| 67 | } |
| 68 | |
| 69 | bool |
| 70 | StoppointLocation::HardwarePreferred () const |
| 71 | { |
| 72 | return m_hw_preferred; |
| 73 | } |
| 74 | |
| 75 | bool |
| 76 | StoppointLocation::IsHardware () const |
| 77 | { |
| 78 | return m_hw_index != LLDB_INVALID_INDEX32; |
| 79 | } |
| 80 | |
| 81 | uint32_t |
| 82 | StoppointLocation::GetHardwareIndex () const |
| 83 | { |
| 84 | return m_hw_index; |
| 85 | } |
| 86 | |
| 87 | void |
| 88 | StoppointLocation::SetHardwareIndex (uint32_t hw_index) |
| 89 | { |
| 90 | m_hw_index = hw_index; |
| 91 | } |
| 92 | |
| 93 | // RETURNS - true if we should stop at this breakpoint, false if we |
| 94 | // should continue. |
| 95 | |
| 96 | bool |
| 97 | StoppointLocation::ShouldStop (StoppointCallbackContext *context) |
| 98 | { |
| 99 | return true; |
| 100 | } |
| 101 | |
| 102 | break_id_t |
| 103 | StoppointLocation::GetID() const |
| 104 | { |
| 105 | return m_loc_id; |
| 106 | } |
| 107 | |
| 108 | void |
| 109 | StoppointLocation::Dump (Stream *stream) const |
| 110 | { |
| 111 | |
| 112 | } |