blob: 999ad536ab8cce669a0e5c42711e0ef0fd616597 [file] [log] [blame]
Chris Lattner24943d22010-06-08 16:52:24 +00001//===-- 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
17using namespace lldb;
18using namespace lldb_private;
19
20//----------------------------------------------------------------------
21// StoppointLocation constructor
22//----------------------------------------------------------------------
23StoppointLocation::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
34StoppointLocation::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//----------------------------------------------------------------------
48StoppointLocation::~StoppointLocation()
49{
50}
51
52
53size_t
54StoppointLocation::GetByteSize () const
55{
56 return m_byte_size;
57}
58
59addr_t
60StoppointLocation::GetLoadAddress() const
61{
62 return m_addr;
63}
64
65tid_t
66StoppointLocation::GetThreadID() const
67{
68 return m_tid;
69}
70
71uint32_t
72StoppointLocation::GetHitCount () const
73{
74 return m_hit_count;
75}
76
77bool
78StoppointLocation::HardwarePreferred () const
79{
80 return m_hw_preferred;
81}
82
83bool
84StoppointLocation::IsHardware () const
85{
86 return m_hw_index != LLDB_INVALID_INDEX32;
87}
88
89uint32_t
90StoppointLocation::GetHardwareIndex () const
91{
92 return m_hw_index;
93}
94
95void
96StoppointLocation::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
104bool
105StoppointLocation::ShouldStop (StoppointCallbackContext *context)
106{
107 return true;
108}
109
110break_id_t
111StoppointLocation::GetID() const
112{
113 return m_loc_id;
114}
115
116void
117StoppointLocation::Dump (Stream *stream) const
118{
119
120}