================ @@ -0,0 +1,115 @@ +//===-- SyntheticFrameProvider.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 LLDB_TARGET_SYNTHETICFRAMEPROVIDER_H +#define LLDB_TARGET_SYNTHETICFRAMEPROVIDER_H + +#include "lldb/Core/PluginInterface.h" +#include "lldb/Utility/Status.h" +#include "lldb/lldb-forward.h" +#include "llvm/Support/Error.h" + +#include <optional> +#include <vector> + +namespace lldb_private { + +/// Descriptor for configuring a synthetic frame provider. +/// +/// This struct contains the metadata needed to instantiate a frame provider +/// and optional filters to control which threads it applies to. +struct SyntheticFrameProviderDescriptor { + /// Metadata for instantiating the provider (e.g., script class name and args) + lldb::ScriptedMetadataSP scripted_metadata_sp; + + /// Optional list of thread IDs to which this provider applies. + /// If empty, the provider applies to all threads. + std::vector<lldb::tid_t> thread_ids; + + SyntheticFrameProviderDescriptor() = default; + + SyntheticFrameProviderDescriptor(lldb::ScriptedMetadataSP metadata_sp) + : scripted_metadata_sp(metadata_sp) {} + + SyntheticFrameProviderDescriptor(lldb::ScriptedMetadataSP metadata_sp, + const std::vector<lldb::tid_t> &tids) + : scripted_metadata_sp(metadata_sp), thread_ids(tids) {} + + /// Check if this descriptor applies to the given thread ID. + bool AppliesToThread(lldb::tid_t tid) const { + // If no thread IDs specified, applies to all threads + if (thread_ids.empty()) + return true; + ---------------- jimingham wrote:
Or if it isn't appropriate for this to be Target specific (the use of the Descriptor isn't in this patch, I'll have to read the next one to see how it's used) you would have to add an `AppliesToThread(llvm::StringRef thread_name)` that gets called as well. https://github.com/llvm/llvm-project/pull/161870 _______________________________________________ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
