Skip to content

Commit 806859c

Browse files
Merge pull request #9724 from swiftlang/lldb-remove-bounds-safety-recognizer
[lldb][Target] Remove BoundsSafetyTrapFrameRecognizer
2 parents 2db41f9 + 6cb26cf commit 806859c

File tree

7 files changed

+12
-152
lines changed

7 files changed

+12
-152
lines changed

lldb/include/lldb/Target/BoundsSafetyTrapFrameRecognizer.h

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

lldb/source/Target/BoundsSafetyTrapFrameRecognizer.cpp

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

lldb/source/Target/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ add_lldb_library(lldbTarget
1212
AssertFrameRecognizer.cpp
1313
DynamicRegisterInfo.cpp
1414
ExecutionContext.cpp
15-
BoundsSafetyTrapFrameRecognizer.cpp
1615
InstrumentationRuntime.cpp
1716
InstrumentationRuntimeStopInfo.cpp
1817
JITLoader.cpp

lldb/source/Target/Process.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@
4343
#include "lldb/Target/ABI.h"
4444
#include "lldb/Target/AssertFrameRecognizer.h"
4545
#include "lldb/Target/DynamicLoader.h"
46-
/* TO_UPSTREAM(BoundsSafety) ON */
47-
#include "lldb/Target/BoundsSafetyTrapFrameRecognizer.h"
48-
/* TO_UPSTREAM(BoundsSafety) OFF */
4946
#include "lldb/Target/InstrumentationRuntime.h"
5047
#include "lldb/Target/JITLoader.h"
5148
#include "lldb/Target/JITLoaderList.h"
@@ -546,9 +543,6 @@ Process::Process(lldb::TargetSP target_sp, ListenerSP listener_sp,
546543
// common C LanguageRuntime plugin.
547544
RegisterAssertFrameRecognizer(this);
548545
RegisterVerboseTrapFrameRecognizer(*this);
549-
/* TO_UPSTREAM(BoundsSafety) ON */
550-
RegisterBoundsSafetyTrapFrameRecognizer(*this);
551-
/* TO_UPSTREAM(BoundsSafety) OFF */
552546
}
553547

554548
Process::~Process() {

lldb/source/Target/VerboseTrapFrameRecognizer.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,11 @@ namespace lldb_private {
148148

149149
void RegisterVerboseTrapFrameRecognizer(Process &process) {
150150
RegularExpressionSP module_regex_sp = nullptr;
151+
// Older -fbounds-safety versions didn't have a ClangTrapPrefix, so the name
152+
// of the frame was just the bounds-check failure message. This regex supports
153+
// the old and new style of frames.
151154
auto symbol_regex_sp = std::make_shared<RegularExpression>(
152-
llvm::formatv("^{0}", ClangTrapPrefix).str());
155+
llvm::formatv("^({0}|Bounds check failed|Pointer Check runtime failure)", ClangTrapPrefix).str());
153156

154157
StackFrameRecognizerSP srf_recognizer_sp =
155158
std::make_shared<VerboseTrapFrameRecognizer>();

lldb/test/API/lang/BoundsSafety/out_of_bounds_pointer/TestOutOfBoundsPointer.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,10 @@ def partial_oob(self, type_name):
8080
def overflow_oob(self, type_name):
8181
return self.get_idx_var_regex(oob_kind=OOBKind.Overflow, type_name=type_name)
8282

83-
def setUp(self):
84-
TestBase.setUp(self)
85-
if _get_bool_config("ios_disclosed", fail_value=False):
86-
self.build()
87-
8883
@skipIf(bugnumber="rdar://141363609")
8984
def test_bidi_known_type_size(self):
85+
self.build()
86+
9087
(_, self.process, _, bkpt) = lldbutil.run_to_source_breakpoint(
9188
self, r"// break here:.+", lldb.SBFileSpec("bidi_check_known_type_size.c")
9289
)
@@ -156,6 +153,8 @@ def test_bidi_known_type_size(self):
156153

157154
@skipIf(bugnumber="rdar://141363609")
158155
def test_bidi_unknown_type_size(self):
156+
self.build()
157+
159158
(_, self.process, _, bkpt) = lldbutil.run_to_source_breakpoint(
160159
self, r"// break here:.+", lldb.SBFileSpec("bidi_check_unknown_type_size.c")
161160
)
@@ -206,6 +205,8 @@ def test_bidi_unknown_type_size(self):
206205

207206
@skipIf(bugnumber="rdar://141363609")
208207
def test_idx_known_type_size(self):
208+
self.build()
209+
209210
(_, self.process, _, bkpt) = lldbutil.run_to_source_breakpoint(
210211
self, r"// break here:.+", lldb.SBFileSpec("idx_check_known_type_size.c")
211212
)
@@ -256,6 +257,8 @@ def test_idx_known_type_size(self):
256257

257258
@skipIf(bugnumber="rdar://141363609")
258259
def test_idx_unknown_type_size(self):
260+
self.build()
261+
259262
(_, self.process, _, bkpt) = lldbutil.run_to_source_breakpoint(
260263
self, r"// break here:.+", lldb.SBFileSpec("idx_check_unknown_type_size.c")
261264
)

lldb/test/Shell/BoundsSafety/boundssafetytrap.test

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# REQUIRES: rdar141363609
21
# UNSUPPORTED: system-windows
32
# RUN: %clang_host -Xclang -fbounds-safety -g -O0 %S/Inputs/boundsSafetyTrap.c -o %t.out
43
# RUN: %lldb -b -s %s %t.out | FileCheck %s

0 commit comments

Comments
 (0)