Files
TheRock/compiler/amd-llvm/lldb/tools/lldb-dap/Handler/SetExceptionBreakpointsRequestHandler.cpp
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

69 lines
2.3 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
//===-- SetExceptionBreakpointsRequestHandler.cpp -------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include "DAP.h"
#include "EventHelper.h"
#include "Protocol/ProtocolRequests.h"
#include "RequestHandler.h"
#include <set>
using namespace llvm;
using namespace lldb_dap::protocol;
namespace lldb_dap {
/// The request configures the debugger’s response to thrown exceptions. Each of
/// the `filters`, `filterOptions`, and `exceptionOptions` in the request are
/// independent configurations to a debug adapter indicating a kind of exception
/// to catch. An exception thrown in a program should result in a `stopped`
/// event from the debug adapter (with reason `exception`) if any of the
/// configured filters match.
///
/// Clients should only call this request if the corresponding capability
/// `exceptionBreakpointFilters` returns one or more filters.
Expected<SetExceptionBreakpointsResponseBody>
SetExceptionBreakpointsRequestHandler::Run(
const SetExceptionBreakpointsArguments &arguments) const {
// Keep a list of any exception breakpoint filter names that weren't set
// so we can clear any exception breakpoints if needed.
std::set<StringRef> unset_filters;
for (const auto &bp : dap.exception_breakpoints)
unset_filters.insert(bp.GetFilter());
SetExceptionBreakpointsResponseBody body;
for (const auto &filter : arguments.filters) {
auto *exc_bp = dap.GetExceptionBreakpoint(filter);
if (!exc_bp)
continue;
body.breakpoints.push_back(exc_bp->SetBreakpoint());
unset_filters.erase(filter);
}
for (const auto &filterOptions : arguments.filterOptions) {
auto *exc_bp = dap.GetExceptionBreakpoint(filterOptions.filterId);
if (!exc_bp)
continue;
body.breakpoints.push_back(exc_bp->SetBreakpoint(filterOptions.condition));
unset_filters.erase(filterOptions.filterId);
}
// Clear any unset filters.
for (const auto &filter : unset_filters) {
auto *exc_bp = dap.GetExceptionBreakpoint(filter);
if (!exc_bp)
continue;
exc_bp->ClearBreakpoint();
}
return body;
}
} // namespace lldb_dap