1 //===-- PlatformWindows.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 LLDB_SOURCE_PLUGINS_PLATFORM_WINDOWS_PLATFORMWINDOWS_H
10 #define LLDB_SOURCE_PLUGINS_PLATFORM_WINDOWS_PLATFORMWINDOWS_H
11 
12 #include "lldb/Target/RemoteAwarePlatform.h"
13 
14 namespace lldb_private {
15 
16 class PlatformWindows : public RemoteAwarePlatform {
17 public:
18   PlatformWindows(bool is_host);
19 
20   static void Initialize();
21 
22   static void Terminate();
23 
24   // lldb_private::PluginInterface functions
25   static lldb::PlatformSP CreateInstance(bool force,
26                                          const lldb_private::ArchSpec *arch);
27 
28   static llvm::StringRef GetPluginNameStatic(bool is_host) {
29     return is_host ? Platform::GetHostPlatformName() : "remote-windows";
30   }
31 
32   static llvm::StringRef GetPluginDescriptionStatic(bool is_host);
33 
34   llvm::StringRef GetPluginName() override {
35     return GetPluginNameStatic(IsHost());
36   }
37 
38   // lldb_private::Platform functions
39   llvm::StringRef GetDescription() override {
40     return GetPluginDescriptionStatic(IsHost());
41   }
42 
43   lldb_private::Status ConnectRemote(lldb_private::Args &args) override;
44 
45   lldb_private::Status DisconnectRemote() override;
46 
47   lldb::ProcessSP DebugProcess(lldb_private::ProcessLaunchInfo &launch_info,
48                                lldb_private::Debugger &debugger,
49                                lldb_private::Target &target,
50                                lldb_private::Status &error) override;
51 
52   lldb::ProcessSP Attach(lldb_private::ProcessAttachInfo &attach_info,
53                          lldb_private::Debugger &debugger,
54                          lldb_private::Target *target,
55                          lldb_private::Status &error) override;
56 
57   std::vector<ArchSpec> GetSupportedArchitectures() override {
58     return m_supported_architectures;
59   }
60 
61   void GetStatus(lldb_private::Stream &strm) override;
62 
63   bool CanDebugProcess() override;
64 
65   // FIXME not sure what the _sigtramp equivalent would be on this platform
66   void CalculateTrapHandlerSymbolNames() override {}
67 
68   ConstString GetFullNameForDylib(ConstString basename) override;
69 
70   size_t GetSoftwareBreakpointTrapOpcode(Target &target,
71                                          BreakpointSite *bp_site) override;
72 
73   std::vector<ArchSpec> m_supported_architectures;
74 };
75 
76 } // namespace lldb_private
77 
78 #endif // LLDB_SOURCE_PLUGINS_PLATFORM_WINDOWS_PLATFORMWINDOWS_H
79