Skip to content

Commit d347c56

Browse files
committed
Revert "[lldb] Add support for large watchpoints in lldb (#79962)"
This reverts commit 57c66b3.
1 parent cc4af03 commit d347c56

File tree

17 files changed

+32
-652
lines changed

17 files changed

+32
-652
lines changed

lldb/include/lldb/Breakpoint/WatchpointAlgorithms.h

Lines changed: 0 additions & 109 deletions
This file was deleted.

lldb/include/lldb/lldb-enumerations.h

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -448,32 +448,6 @@ enum WatchpointWriteType {
448448
eWatchpointWriteTypeOnModify
449449
};
450450

451-
/// The hardware and native stub capabilities for a given target,
452-
/// for translating a user's watchpoint request into hardware
453-
/// capable watchpoint resources.
454-
FLAGS_ENUM(WatchpointHardwareFeature){
455-
/// lldb will fall back to a default that assumes the target
456-
/// can watch up to pointer-size power-of-2 regions, aligned to
457-
/// power-of-2.
458-
eWatchpointHardwareFeatureUnknown = (1u << 0),
459-
460-
/// Intel systems can watch 1, 2, 4, or 8 bytes (in 64-bit targets),
461-
/// aligned naturally.
462-
eWatchpointHardwareX86 = (1u << 1),
463-
464-
/// ARM systems with Byte Address Select watchpoints
465-
/// can watch any consecutive series of bytes up to the
466-
/// size of a pointer (4 or 8 bytes), at a pointer-size
467-
/// alignment.
468-
eWatchpointHardwareArmBAS = (1u << 2),
469-
470-
/// ARM systems with MASK watchpoints can watch any power-of-2
471-
/// sized region from 8 bytes to 2 gigabytes, aligned to that
472-
/// same power-of-2 alignment.
473-
eWatchpointHardwareArmMASK = (1u << 3),
474-
};
475-
LLDB_MARK_AS_BITMASK_ENUM(WatchpointHardwareFeature)
476-
477451
/// Programming language type.
478452
///
479453
/// These enumerations use the same language enumerations as the DWARF

lldb/packages/Python/lldbsuite/test/concurrent_base.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,7 @@ def do_thread_actions(
166166

167167
# Initialize the (single) watchpoint on the global variable (g_watchme)
168168
if num_watchpoint_threads + num_delay_watchpoint_threads > 0:
169-
# The concurrent tests have multiple threads modifying a variable
170-
# with the same value. The default "modify" style watchpoint will
171-
# only report this as 1 hit for all threads, because they all wrote
172-
# the same value. The testsuite needs "write" style watchpoints to
173-
# get the correct number of hits reported.
174-
self.runCmd("watchpoint set variable -w write g_watchme")
169+
self.runCmd("watchpoint set variable g_watchme")
175170
for w in self.inferior_target.watchpoint_iter():
176171
self.thread_watchpoint = w
177172
self.assertTrue(

lldb/source/Breakpoint/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ add_lldb_library(lldbBreakpoint NO_PLUGIN_DEPENDENCIES
2121
StoppointSite.cpp
2222
StopPointSiteList.cpp
2323
Watchpoint.cpp
24-
WatchpointAlgorithms.cpp
2524
WatchpointList.cpp
2625
WatchpointOptions.cpp
2726
WatchpointResource.cpp

lldb/source/Breakpoint/Watchpoint.cpp

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,10 @@ Watchpoint::Watchpoint(Target &target, lldb::addr_t addr, uint32_t size,
4545
LLDB_LOG_ERROR(GetLog(LLDBLog::Watchpoints), std::move(err),
4646
"Failed to set type: {0}");
4747
} else {
48-
if (auto ts = *type_system_or_err) {
49-
if (size <= target.GetArchitecture().GetAddressByteSize()) {
50-
m_type =
51-
ts->GetBuiltinTypeForEncodingAndBitSize(eEncodingUint, 8 * size);
52-
} else {
53-
CompilerType clang_uint8_type =
54-
ts->GetBuiltinTypeForEncodingAndBitSize(eEncodingUint, 8);
55-
m_type = clang_uint8_type.GetArrayType(size);
56-
}
57-
} else
48+
if (auto ts = *type_system_or_err)
49+
m_type =
50+
ts->GetBuiltinTypeForEncodingAndBitSize(eEncodingUint, 8 * size);
51+
else
5852
LLDB_LOG_ERROR(GetLog(LLDBLog::Watchpoints), std::move(err),
5953
"Failed to set type: Typesystem is no longer live: {0}");
6054
}
@@ -358,20 +352,6 @@ void Watchpoint::DumpWithLevel(Stream *s,
358352
s->Printf("\n declare @ '%s'", m_decl_str.c_str());
359353
if (!m_watch_spec_str.empty())
360354
s->Printf("\n watchpoint spec = '%s'", m_watch_spec_str.c_str());
361-
if (IsEnabled()) {
362-
if (ProcessSP process_sp = m_target.GetProcessSP()) {
363-
auto &resourcelist = process_sp->GetWatchpointResourceList();
364-
size_t idx = 0;
365-
s->Printf("\n watchpoint resources:");
366-
for (WatchpointResourceSP &wpres : resourcelist.Sites()) {
367-
if (wpres->ConstituentsContains(this)) {
368-
s->Printf("\n #%zu: ", idx);
369-
wpres->Dump(s);
370-
}
371-
idx++;
372-
}
373-
}
374-
}
375355

376356
// Dump the snapshots we have taken.
377357
DumpSnapshots(s, " ");

lldb/source/Breakpoint/WatchpointAlgorithms.cpp

Lines changed: 0 additions & 142 deletions
This file was deleted.

lldb/source/Breakpoint/WatchpointResource.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include <assert.h>
1010

1111
#include "lldb/Breakpoint/WatchpointResource.h"
12-
#include "lldb/Utility/Stream.h"
1312

1413
#include <algorithm>
1514

@@ -114,8 +113,7 @@ bool WatchpointResource::ShouldStop(StoppointCallbackContext *context) {
114113
}
115114

116115
void WatchpointResource::Dump(Stream *s) const {
117-
s->Printf("addr = 0x%8.8" PRIx64 " size = %zu", m_addr, m_size);
118-
return;
116+
return; // LWP_TODO
119117
}
120118

121119
wp_resource_id_t WatchpointResource::GetNextID() {

lldb/source/Commands/CommandObjectWatchpoint.cpp

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,22 +1139,9 @@ class CommandObjectWatchpointSetExpression : public CommandObjectRaw {
11391139

11401140
// Fetch the type from the value object, the type of the watched object is
11411141
// the pointee type
1142-
/// of the expression, so convert to that if we found a valid type.
1142+
/// of the expression, so convert to that if we found a valid type.
11431143
CompilerType compiler_type(valobj_sp->GetCompilerType());
11441144

1145-
std::optional<uint64_t> valobj_size = valobj_sp->GetByteSize();
1146-
// Set the type as a uint8_t array if the size being watched is
1147-
// larger than the ValueObject's size (which is probably the size
1148-
// of a pointer).
1149-
if (valobj_size && size > *valobj_size) {
1150-
auto type_system = compiler_type.GetTypeSystem();
1151-
if (type_system) {
1152-
CompilerType clang_uint8_type =
1153-
type_system->GetBuiltinTypeForEncodingAndBitSize(eEncodingUint, 8);
1154-
compiler_type = clang_uint8_type.GetArrayType(size);
1155-
}
1156-
}
1157-
11581145
Status error;
11591146
WatchpointSP watch_sp =
11601147
target->CreateWatchpoint(addr, size, &compiler_type, watch_type, error);

0 commit comments

Comments
 (0)