Skip to content

[lldb][Target] Remove BoundsSafetyTrapFrameRecognizer #9724

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 0 additions & 47 deletions lldb/include/lldb/Target/BoundsSafetyTrapFrameRecognizer.h

This file was deleted.

91 changes: 0 additions & 91 deletions lldb/source/Target/BoundsSafetyTrapFrameRecognizer.cpp

This file was deleted.

1 change: 0 additions & 1 deletion lldb/source/Target/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ add_lldb_library(lldbTarget
AssertFrameRecognizer.cpp
DynamicRegisterInfo.cpp
ExecutionContext.cpp
BoundsSafetyTrapFrameRecognizer.cpp
InstrumentationRuntime.cpp
InstrumentationRuntimeStopInfo.cpp
JITLoader.cpp
Expand Down
6 changes: 0 additions & 6 deletions lldb/source/Target/Process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@
#include "lldb/Target/ABI.h"
#include "lldb/Target/AssertFrameRecognizer.h"
#include "lldb/Target/DynamicLoader.h"
/* TO_UPSTREAM(BoundsSafety) ON */
#include "lldb/Target/BoundsSafetyTrapFrameRecognizer.h"
/* TO_UPSTREAM(BoundsSafety) OFF */
#include "lldb/Target/InstrumentationRuntime.h"
#include "lldb/Target/JITLoader.h"
#include "lldb/Target/JITLoaderList.h"
Expand Down Expand Up @@ -546,9 +543,6 @@ Process::Process(lldb::TargetSP target_sp, ListenerSP listener_sp,
// common C LanguageRuntime plugin.
RegisterAssertFrameRecognizer(this);
RegisterVerboseTrapFrameRecognizer(*this);
/* TO_UPSTREAM(BoundsSafety) ON */
RegisterBoundsSafetyTrapFrameRecognizer(*this);
/* TO_UPSTREAM(BoundsSafety) OFF */
}

Process::~Process() {
Expand Down
5 changes: 4 additions & 1 deletion lldb/source/Target/VerboseTrapFrameRecognizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,11 @@ namespace lldb_private {

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

StackFrameRecognizerSP srf_recognizer_sp =
std::make_shared<VerboseTrapFrameRecognizer>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,10 @@ def partial_oob(self, type_name):
def overflow_oob(self, type_name):
return self.get_idx_var_regex(oob_kind=OOBKind.Overflow, type_name=type_name)

def setUp(self):
TestBase.setUp(self)
if _get_bool_config("ios_disclosed", fail_value=False):
self.build()

@skipIf(bugnumber="rdar://141363609")
def test_bidi_known_type_size(self):
self.build()

(_, self.process, _, bkpt) = lldbutil.run_to_source_breakpoint(
self, r"// break here:.+", lldb.SBFileSpec("bidi_check_known_type_size.c")
)
Expand Down Expand Up @@ -156,6 +153,8 @@ def test_bidi_known_type_size(self):

@skipIf(bugnumber="rdar://141363609")
def test_bidi_unknown_type_size(self):
self.build()

(_, self.process, _, bkpt) = lldbutil.run_to_source_breakpoint(
self, r"// break here:.+", lldb.SBFileSpec("bidi_check_unknown_type_size.c")
)
Expand Down Expand Up @@ -206,6 +205,8 @@ def test_bidi_unknown_type_size(self):

@skipIf(bugnumber="rdar://141363609")
def test_idx_known_type_size(self):
self.build()

(_, self.process, _, bkpt) = lldbutil.run_to_source_breakpoint(
self, r"// break here:.+", lldb.SBFileSpec("idx_check_known_type_size.c")
)
Expand Down Expand Up @@ -256,6 +257,8 @@ def test_idx_known_type_size(self):

@skipIf(bugnumber="rdar://141363609")
def test_idx_unknown_type_size(self):
self.build()

(_, self.process, _, bkpt) = lldbutil.run_to_source_breakpoint(
self, r"// break here:.+", lldb.SBFileSpec("idx_check_unknown_type_size.c")
)
Expand Down
1 change: 0 additions & 1 deletion lldb/test/Shell/BoundsSafety/boundssafetytrap.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# REQUIRES: rdar141363609
# UNSUPPORTED: system-windows
# RUN: %clang_host -Xclang -fbounds-safety -g -O0 %S/Inputs/boundsSafetyTrap.c -o %t.out
# RUN: %lldb -b -s %s %t.out | FileCheck %s
Expand Down