LLDB  mainline
OptionGroupPlatform.h
Go to the documentation of this file.
1 //===-- OptionGroupPlatform.h -----------------------------------*- C++ -*-===//
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 #ifndef liblldb_OptionGroupPlatform_h_
10 #define liblldb_OptionGroupPlatform_h_
11 
14 #include "llvm/Support/VersionTuple.h"
15 
16 namespace lldb_private {
17 
18 // PlatformOptionGroup
19 //
20 // Make platform options available to any commands that need the settings.
22 public:
23  OptionGroupPlatform(bool include_platform_option)
25  m_include_platform_option(include_platform_option) {}
26 
27  ~OptionGroupPlatform() override = default;
28 
29  llvm::ArrayRef<OptionDefinition> GetDefinitions() override;
30 
31  Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value,
32  ExecutionContext *execution_context) override;
33  Status SetOptionValue(uint32_t, const char *, ExecutionContext *) = delete;
34 
35  void OptionParsingStarting(ExecutionContext *execution_context) override;
36 
37  lldb::PlatformSP CreatePlatformWithOptions(CommandInterpreter &interpreter,
38  const ArchSpec &arch,
39  bool make_selected, Status &error,
40  ArchSpec &platform_arch) const;
41 
42  bool PlatformWasSpecified() const { return !m_platform_name.empty(); }
43 
44  void SetPlatformName(const char *platform_name) {
45  if (platform_name && platform_name[0])
46  m_platform_name.assign(platform_name);
47  else
48  m_platform_name.clear();
49  }
50 
52 
53  void SetSDKRootDirectory(ConstString sdk_root_directory) {
54  m_sdk_sysroot = sdk_root_directory;
55  }
56 
57  ConstString GetSDKBuild() const { return m_sdk_build; }
58 
59  void SetSDKBuild(ConstString sdk_build) { m_sdk_build = sdk_build; }
60 
61  bool PlatformMatches(const lldb::PlatformSP &platform_sp) const;
62 
63 protected:
64  std::string m_platform_name;
67  llvm::VersionTuple m_os_version;
69 };
70 
71 } // namespace lldb_private
72 
73 #endif // liblldb_OptionGroupPlatform_h_
Enumerations for broadcasting.
Definition: SBLaunchInfo.h:14
void SetSDKRootDirectory(ConstString sdk_root_directory)
~OptionGroupPlatform() override=default
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
An architecture specification class.
Definition: ArchSpec.h:32
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value, ExecutionContext *execution_context) override
void SetSDKBuild(ConstString sdk_build)
OptionGroupPlatform(bool include_platform_option)
A uniqued constant string class.
Definition: ConstString.h:38
void SetPlatformName(const char *platform_name)
void OptionParsingStarting(ExecutionContext *execution_context) override
bool PlatformMatches(const lldb::PlatformSP &platform_sp) const
lldb::PlatformSP CreatePlatformWithOptions(CommandInterpreter &interpreter, const ArchSpec &arch, bool make_selected, Status &error, ArchSpec &platform_arch) const
An error handling class.
Definition: Status.h:44