1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-05-09 23:08:18 +08:00
CMake/Source/cmDebuggerThreadManager.h
Jonathan Phippen 41621c3afb Debugger: Add Value Formatting support for StackTrace request
Add support for the "format" property of the Debug Adapter Protocol
StackTrace request to fulfill the host's request to format the resulting
StackFrame name differently.
2024-10-29 13:29:00 -07:00

40 lines
938 B
C++

/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
#pragma once
#include "cmConfigure.h" // IWYU pragma: keep
#include <atomic>
#include <cstdint>
#include <list>
#include <memory>
#include <string>
#include <cm/optional>
namespace cmDebugger {
class cmDebuggerThread;
}
namespace dap {
struct StackTraceRequest;
struct StackTraceResponse;
}
namespace cmDebugger {
class cmDebuggerThreadManager
{
static std::atomic<std::int64_t> NextThreadId;
std::list<std::shared_ptr<cmDebuggerThread>> Threads;
public:
cmDebuggerThreadManager() = default;
std::shared_ptr<cmDebuggerThread> StartThread(std::string const& name);
void EndThread(std::shared_ptr<cmDebuggerThread> const& thread);
cm::optional<dap::StackTraceResponse> GetThreadStackTraceResponse(
const dap::StackTraceRequest& request);
};
} // namespace cmDebugger