LLDB
mainline
llvm-project
lldb
include
lldb
Breakpoint
StoppointSite.h
Go to the documentation of this file.
1
//===-- StoppointSite.h -----------------------------------------*- C++ -*-===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
9
#ifndef LLDB_BREAKPOINT_STOPPOINTSITE_H
10
#define LLDB_BREAKPOINT_STOPPOINTSITE_H
11
12
#include "
lldb/Breakpoint/StoppointHitCounter.h
"
13
#include "
lldb/Utility/UserID.h
"
14
#include "
lldb/lldb-private.h
"
15
16
namespace
lldb_private
{
17
18
class
StoppointSite
{
19
public
:
20
StoppointSite
(
lldb::break_id_t
bid,
lldb::addr_t
m_addr
,
bool
hardware);
21
22
StoppointSite
(
lldb::break_id_t
bid,
lldb::addr_t
m_addr
,
23
uint32_t byte_size,
bool
hardware);
24
25
virtual
~StoppointSite
() =
default
;
26
27
virtual
lldb::addr_t
GetLoadAddress
()
const
{
return
m_addr
; }
28
29
virtual
void
SetLoadAddress
(
lldb::addr_t
addr) {
m_addr
= addr; }
30
31
uint32_t
GetByteSize
()
const
{
return
m_byte_size
; }
32
33
uint32_t
GetHitCount
()
const
{
return
m_hit_counter
.GetValue(); }
34
35
void
ResetHitCount
() {
m_hit_counter
.Reset(); }
36
37
bool
HardwareRequired
()
const
{
return
m_is_hardware_required
; }
38
39
virtual
bool
IsHardware
()
const
= 0;
40
41
virtual
bool
ShouldStop
(
StoppointCallbackContext
*context) {
return
false
; };
42
43
virtual
bool
ShouldStop
(
StoppointCallbackContext
*context,
44
BreakpointLocationCollection
&stopping_bp_locs) {
45
return
false
;
46
};
47
48
virtual
void
Dump
(
Stream
* stream)
const
= 0;
49
50
lldb::break_id_t
GetID
()
const
{
return
m_id
; }
51
52
protected
:
53
/// Stoppoint site ID.
54
lldb::break_id_t
m_id
;
55
56
/// The load address of this stop point.
57
lldb::addr_t
m_addr
;
58
59
/// True if this point is required to use hardware (which may fail due to
60
/// the lack of resources).
61
bool
m_is_hardware_required
;
62
63
/// The size in bytes of stoppoint, e.g. the length of the trap opcode for
64
/// software breakpoints, or the optional length in bytes for hardware
65
/// breakpoints, or the length of the watchpoint.
66
uint32_t
m_byte_size
;
67
68
/// Number of times this breakpoint/watchpoint has been hit.
69
StoppointHitCounter
m_hit_counter
;
70
71
private
:
72
StoppointSite
(
const
StoppointSite
&) =
delete
;
73
const
StoppointSite
&
operator=
(
const
StoppointSite
&) =
delete
;
74
StoppointSite
() =
delete
;
75
};
76
77
}
// namespace lldb_private
78
79
#endif
// LLDB_BREAKPOINT_STOPPOINTSITE_H
StoppointHitCounter.h
UserID.h
lldb_private::BreakpointLocationCollection
Definition
BreakpointLocationCollection.h:20
lldb_private::StoppointCallbackContext
General Outline: When we hit a breakpoint we need to package up whatever information is needed to eva...
Definition
StoppointCallbackContext.h:26
lldb_private::StoppointHitCounter
Definition
StoppointHitCounter.h:20
lldb_private::StoppointSite::m_addr
lldb::addr_t m_addr
The load address of this stop point.
Definition
StoppointSite.h:57
lldb_private::StoppointSite::Dump
virtual void Dump(Stream *stream) const =0
lldb_private::StoppointSite::StoppointSite
StoppointSite(lldb::break_id_t bid, lldb::addr_t m_addr, bool hardware)
lldb_private::StoppointSite::operator=
const StoppointSite & operator=(const StoppointSite &)=delete
lldb_private::StoppointSite::GetID
lldb::break_id_t GetID() const
Definition
StoppointSite.h:50
lldb_private::StoppointSite::ShouldStop
virtual bool ShouldStop(StoppointCallbackContext *context, BreakpointLocationCollection &stopping_bp_locs)
Definition
StoppointSite.h:43
lldb_private::StoppointSite::StoppointSite
StoppointSite(const StoppointSite &)=delete
lldb_private::StoppointSite::m_id
lldb::break_id_t m_id
Stoppoint site ID.
Definition
StoppointSite.h:54
lldb_private::StoppointSite::GetHitCount
uint32_t GetHitCount() const
Definition
StoppointSite.h:33
lldb_private::StoppointSite::StoppointSite
StoppointSite()=delete
lldb_private::StoppointSite::m_hit_counter
StoppointHitCounter m_hit_counter
Number of times this breakpoint/watchpoint has been hit.
Definition
StoppointSite.h:69
lldb_private::StoppointSite::GetLoadAddress
virtual lldb::addr_t GetLoadAddress() const
Definition
StoppointSite.h:27
lldb_private::StoppointSite::GetByteSize
uint32_t GetByteSize() const
Definition
StoppointSite.h:31
lldb_private::StoppointSite::IsHardware
virtual bool IsHardware() const =0
lldb_private::StoppointSite::SetLoadAddress
virtual void SetLoadAddress(lldb::addr_t addr)
Definition
StoppointSite.h:29
lldb_private::StoppointSite::StoppointSite
StoppointSite(lldb::break_id_t bid, lldb::addr_t m_addr, uint32_t byte_size, bool hardware)
lldb_private::StoppointSite::m_byte_size
uint32_t m_byte_size
The size in bytes of stoppoint, e.g.
Definition
StoppointSite.h:66
lldb_private::StoppointSite::m_is_hardware_required
bool m_is_hardware_required
True if this point is required to use hardware (which may fail due to the lack of resources).
Definition
StoppointSite.h:61
lldb_private::StoppointSite::ResetHitCount
void ResetHitCount()
Definition
StoppointSite.h:35
lldb_private::StoppointSite::~StoppointSite
virtual ~StoppointSite()=default
lldb_private::StoppointSite::ShouldStop
virtual bool ShouldStop(StoppointCallbackContext *context)
Definition
StoppointSite.h:41
lldb_private::StoppointSite::HardwareRequired
bool HardwareRequired() const
Definition
StoppointSite.h:37
lldb_private::Stream
A stream class that can stream formatted output to a file.
Definition
Stream.h:28
lldb-private.h
lldb_private
A class that represents a running process on the host machine.
Definition
SBAddressRange.h:14
lldb::break_id_t
int32_t break_id_t
Definition
lldb-types.h:86
lldb::addr_t
uint64_t addr_t
Definition
lldb-types.h:80
Generated on
for LLDB by
1.14.0