1 //===-- TraceExporter.cpp -------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
9 #include "lldb/Target/TraceExporter.h"
11 #include "lldb/Core/PluginManager.h"
14 using namespace lldb_private
;
17 static Error
createInvalidPlugInError(StringRef plugin_name
) {
18 return createStringError(
19 std::errc::invalid_argument
,
20 "no trace expoter plug-in matches the specified type: \"%s\"",
24 Expected
<lldb::TraceExporterUP
>
25 TraceExporter::FindPlugin(llvm::StringRef name
) {
26 if (auto create_callback
=
27 PluginManager::GetTraceExporterCreateCallback(name
))
28 return create_callback();
30 return createInvalidPlugInError(name
);