LLDB mainline
SBWatchpointOptions.cpp
Go to the documentation of this file.
1//===-- SBWatchpointOptions.cpp -------------------------------------------===//
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
12
13#include "Utils.h"
14
15using namespace lldb;
16using namespace lldb_private;
17
19public:
20 bool m_read = false;
21 bool m_write = false;
22 bool m_modify = false;
23};
24
25
27 : m_opaque_up(new WatchpointOptionsImpl()) {
29}
30
32 LLDB_INSTRUMENT_VA(this, rhs);
33
35}
36
39 LLDB_INSTRUMENT_VA(this, rhs);
40
41 if (this != &rhs)
43 return *this;
44}
45
47
49 m_opaque_up->m_read = read;
50}
52 return m_opaque_up->m_read;
53}
54
56 WatchpointWriteType write_type) {
57 if (write_type == eWatchpointWriteTypeOnModify) {
58 m_opaque_up->m_write = false;
59 m_opaque_up->m_modify = true;
60 } else if (write_type == eWatchpointWriteTypeAlways) {
61 m_opaque_up->m_write = true;
62 m_opaque_up->m_modify = false;
63 } else
64 m_opaque_up->m_write = m_opaque_up->m_modify = false;
65}
66
68 if (m_opaque_up->m_modify)
70 if (m_opaque_up->m_write)
73}
#define LLDB_INSTRUMENT_VA(...)
std::unique_ptr< WatchpointOptionsImpl > m_opaque_up
const SBWatchpointOptions & operator=(const lldb::SBWatchpointOptions &rhs)
void SetWatchpointTypeWrite(lldb::WatchpointWriteType write_type)
Stop when the watched memory region is written to/modified.
lldb::WatchpointWriteType GetWatchpointTypeWrite() const
void SetWatchpointTypeRead(bool read)
Stop when the watched memory region is read.
A class that represents a running process on the host machine.
std::unique_ptr< T > clone(const std::unique_ptr< T > &src)
Definition: Utils.h:17
Definition: SBAddress.h:15
@ eWatchpointWriteTypeOnModify
Stop on a write to the memory region that changes its value.
@ eWatchpointWriteTypeAlways
Stop on any write access to the memory region, even if the value doesn't change.
@ eWatchpointWriteTypeDisabled
Don't stop when the watched memory region is written to.