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
66 lines
2.7 KiB
C++
66 lines
2.7 KiB
C++
//===-- LocalDebugDelegate.h ------------------------------------*- C++ -*-===//
|
|
//
|
|
// 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
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef liblldb_Plugins_Process_Windows_LocalDebugDelegate_H_
|
|
#define liblldb_Plugins_Process_Windows_LocalDebugDelegate_H_
|
|
|
|
#include <memory>
|
|
|
|
#include "IDebugDelegate.h"
|
|
|
|
#include "lldb/lldb-forward.h"
|
|
|
|
namespace lldb_private {
|
|
|
|
class ProcessWindows;
|
|
using ProcessWindowsSP = std::shared_ptr<ProcessWindows>;
|
|
|
|
// LocalDebugDelegate
|
|
//
|
|
// LocalDebugDelegate creates a connection between a ProcessWindows and the
|
|
// debug driver. This serves to decouple ProcessWindows from the debug
|
|
// driver. It would be possible to get a similar decoupling by just having
|
|
// ProcessWindows implement this interface directly. There are two reasons
|
|
// why we don't do this:
|
|
//
|
|
// 1) In the future when we add support for local debugging through LLGS, and we
|
|
// go through the Native*Protocol interface, it is likely we will need the
|
|
// additional flexibility provided by this sort of adapter pattern.
|
|
// 2) LLDB holds a shared_ptr to the ProcessWindows, and our driver thread
|
|
// needs access to it as well. To avoid a race condition, we want to make
|
|
// sure that we're also holding onto a shared_ptr.
|
|
// lldb_private::Process supports enable_shared_from_this, but that gives us
|
|
// a ProcessSP (which is exactly what we are trying to decouple from the
|
|
// driver), so this adapter serves as a way to transparently hold the
|
|
// ProcessSP while still keeping it decoupled from the driver.
|
|
class LocalDebugDelegate : public IDebugDelegate {
|
|
public:
|
|
explicit LocalDebugDelegate(lldb::ProcessWP process);
|
|
|
|
void OnExitProcess(uint32_t exit_code) override;
|
|
void OnDebuggerConnected(lldb::addr_t image_base) override;
|
|
ExceptionResult OnDebugException(bool first_chance,
|
|
const ExceptionRecord &record) override;
|
|
void OnCreateThread(const HostThread &thread) override;
|
|
void OnExitThread(lldb::tid_t thread_id, uint32_t exit_code) override;
|
|
void OnLoadDll(const lldb_private::ModuleSpec &module_spec,
|
|
lldb::addr_t module_addr) override;
|
|
void OnUnloadDll(lldb::addr_t module_addr) override;
|
|
void OnDebugString(lldb::addr_t debug_string_addr, bool is_unicode,
|
|
uint16_t length_lower_word) override;
|
|
void OnDebuggerError(const Status &error, uint32_t type) override;
|
|
|
|
private:
|
|
ProcessWindowsSP GetProcessPointer();
|
|
|
|
lldb::ProcessWP m_process;
|
|
};
|
|
}
|
|
|
|
#endif
|