[Lldb-commits] [lldb] [lldb][lldb-dap] Cleanup breakpoint filters. (PR #87550)

Vy Nguyen via lldb-commits lldb-commits at lists.llvm.org
Fri May 24 06:15:40 PDT 2024


https://github.com/oontvoo updated https://github.com/llvm/llvm-project/pull/87550

>From 7a0af7b0b5699abe4ac5fe5415c849ffe81aa2ee Mon Sep 17 00:00:00 2001
From: Vy Nguyen <vyng at google.com>
Date: Wed, 3 Apr 2024 16:14:40 -0400
Subject: [PATCH] [lldb][lldb-dap] Cleanup breakpoint filters.

Details:
  - remove Swift breakpoint filter because this version of LLDB does not support Swift.
  - only return objc filters when working on macos.
---
 lldb/tools/lldb-dap/DAP.cpp      | 4 +---
 lldb/tools/lldb-dap/lldb-dap.cpp | 7 +++++++
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/lldb/tools/lldb-dap/DAP.cpp b/lldb/tools/lldb-dap/DAP.cpp
index b254ddfef0d5f..52e607350407a 100644
--- a/lldb/tools/lldb-dap/DAP.cpp
+++ b/lldb/tools/lldb-dap/DAP.cpp
@@ -36,9 +36,7 @@ DAP::DAP()
           {{"cpp_catch", "C++ Catch", lldb::eLanguageTypeC_plus_plus},
            {"cpp_throw", "C++ Throw", lldb::eLanguageTypeC_plus_plus},
            {"objc_catch", "Objective-C Catch", lldb::eLanguageTypeObjC},
-           {"objc_throw", "Objective-C Throw", lldb::eLanguageTypeObjC},
-           {"swift_catch", "Swift Catch", lldb::eLanguageTypeSwift},
-           {"swift_throw", "Swift Throw", lldb::eLanguageTypeSwift}}),
+           {"objc_throw", "Objective-C Throw", lldb::eLanguageTypeObjC}}),
       focus_tid(LLDB_INVALID_THREAD_ID), sent_terminated_event(false),
       stop_at_entry(false), is_attach(false),
       enable_auto_variable_summaries(false),
diff --git a/lldb/tools/lldb-dap/lldb-dap.cpp b/lldb/tools/lldb-dap/lldb-dap.cpp
index 55f8c920e6001..5f5014eaab90f 100644
--- a/lldb/tools/lldb-dap/lldb-dap.cpp
+++ b/lldb/tools/lldb-dap/lldb-dap.cpp
@@ -1628,7 +1628,14 @@ void request_initialize(const llvm::json::Object &request) {
   body.try_emplace("supportsEvaluateForHovers", true);
   // Available filters or options for the setExceptionBreakpoints request.
   llvm::json::Array filters;
+  std::string triple =
+      std::string(g_dap.debugger.GetSelectedPlatform().GetTriple());
   for (const auto &exc_bp : g_dap.exception_breakpoints) {
+    // Skipping objc breakpoint filters if not working on macos.
+    if (exc_bp.language == lldb::eLanguageTypeObjC &&
+        triple.find("macos") == std::string::npos) {
+      continue;
+    }
     filters.emplace_back(CreateExceptionBreakpointFilter(exc_bp));
   }
   body.try_emplace("exceptionBreakpointFilters", std::move(filters));



More information about the lldb-commits mailing list