1//===-- TraceExporter.cpp -------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#include "lldb/Target/TraceExporter.h"
10
11#include "lldb/Core/PluginManager.h"
12
13using namespace lldb;
14using namespace lldb_private;
15using namespace llvm;
16
17static Error createInvalidPlugInError(StringRef plugin_name) {
18 return createStringError(
19 EC: std::errc::invalid_argument,
20 Fmt: "no trace expoter plug-in matches the specified type: \"%s\"",
21 Vals: plugin_name.data());
22}
23
24Expected<lldb::TraceExporterUP>
25TraceExporter::FindPlugin(llvm::StringRef name) {
26 if (auto create_callback =
27 PluginManager::GetTraceExporterCreateCallback(plugin_name: name))
28 return create_callback();
29
30 return createInvalidPlugInError(plugin_name: name);
31}
32

source code of lldb/source/Target/TraceExporter.cpp