1 //===-- PlatformLinux.h -----------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef liblldb_PlatformLinux_h_
11 #define liblldb_PlatformLinux_h_
12 
13 // C Includes
14 // C++ Includes
15 // Other libraries and framework includes
16 // Project includes
17 #include "Plugins/Platform/POSIX/PlatformPOSIX.h"
18 
19 namespace lldb_private {
20 
21     class PlatformLinux : public PlatformPOSIX
22     {
23     public:
24 
25         static void
26         Initialize ();
27 
28         static void
29         Terminate ();
30 
31         PlatformLinux (bool is_host);
32 
33         virtual
34         ~PlatformLinux();
35 
36         //------------------------------------------------------------
37         // lldb_private::PluginInterface functions
38         //------------------------------------------------------------
39         static Platform *
40         CreateInstance (bool force, const lldb_private::ArchSpec *arch);
41 
42         static lldb_private::ConstString
43         GetPluginNameStatic (bool is_host);
44 
45         static const char *
46         GetPluginDescriptionStatic (bool is_host);
47 
48         lldb_private::ConstString
49         GetPluginName() override;
50 
51         uint32_t
52         GetPluginVersion() override
53         {
54             return 1;
55         }
56 
57         //------------------------------------------------------------
58         // lldb_private::Platform functions
59         //------------------------------------------------------------
60         Error
61         ResolveExecutable (const FileSpec &exe_file,
62                            const ArchSpec &arch,
63                            lldb::ModuleSP &module_sp,
64                            const FileSpecList *module_search_paths_ptr) override;
65 
66         const char *
67         GetDescription () override
68         {
69             return GetPluginDescriptionStatic(IsHost());
70         }
71 
72         void
73         GetStatus (Stream &strm) override;
74 
75         Error
76         GetFileWithUUID (const FileSpec &platform_file,
77                          const UUID* uuid, FileSpec &local_file) override;
78 
79         bool
80         GetProcessInfo (lldb::pid_t pid, ProcessInstanceInfo &proc_info) override;
81 
82         bool
83         GetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch) override;
84 
85         size_t
86         GetSoftwareBreakpointTrapOpcode (Target &target,
87                                          BreakpointSite *bp_site) override;
88 
89         lldb_private::Error
90         LaunchProcess (lldb_private::ProcessLaunchInfo &launch_info) override;
91 
92         lldb::ProcessSP
93         Attach(ProcessAttachInfo &attach_info, Debugger &debugger,
94                Target *target, Listener &listener, Error &error) override;
95 
96         bool
97         CanDebugProcess () override;
98 
99         void
100         CalculateTrapHandlerSymbolNames () override;
101 
102         Error
103         LaunchNativeProcess (
104             ProcessLaunchInfo &launch_info,
105             lldb_private::NativeProcessProtocol::NativeDelegate &native_delegate,
106             NativeProcessProtocolSP &process_sp) override;
107 
108         Error
109         AttachNativeProcess (lldb::pid_t pid,
110                              lldb_private::NativeProcessProtocol::NativeDelegate &native_delegate,
111                              NativeProcessProtocolSP &process_sp) override;
112 
113     private:
114         DISALLOW_COPY_AND_ASSIGN (PlatformLinux);
115     };
116 } // namespace lldb_private
117 
118 #endif  // liblldb_PlatformLinux_h_
119