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         DebuggerInitialize (lldb_private::Debugger &debugger);
27 
28         static void
29         Initialize ();
30 
31         static void
32         Terminate ();
33 
34         PlatformLinux (bool is_host);
35 
36         virtual
37         ~PlatformLinux();
38 
39         //------------------------------------------------------------
40         // lldb_private::PluginInterface functions
41         //------------------------------------------------------------
42         static lldb::PlatformSP
43         CreateInstance (bool force, const lldb_private::ArchSpec *arch);
44 
45         static lldb_private::ConstString
46         GetPluginNameStatic (bool is_host);
47 
48         static const char *
49         GetPluginDescriptionStatic (bool is_host);
50 
51         lldb_private::ConstString
52         GetPluginName() override;
53 
54         uint32_t
55         GetPluginVersion() override
56         {
57             return 1;
58         }
59 
60         //------------------------------------------------------------
61         // lldb_private::Platform functions
62         //------------------------------------------------------------
63         Error
64         ResolveExecutable (const FileSpec &exe_file,
65                            const ArchSpec &arch,
66                            lldb::ModuleSP &module_sp,
67                            const FileSpecList *module_search_paths_ptr) override;
68 
69         const char *
70         GetDescription () override
71         {
72             return GetPluginDescriptionStatic(IsHost());
73         }
74 
75         void
76         GetStatus (Stream &strm) override;
77 
78         Error
79         GetFileWithUUID (const FileSpec &platform_file,
80                          const UUID* uuid, FileSpec &local_file) override;
81 
82         bool
83         GetProcessInfo (lldb::pid_t pid, ProcessInstanceInfo &proc_info) override;
84 
85         bool
86         GetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch) override;
87 
88         size_t
89         GetSoftwareBreakpointTrapOpcode (Target &target,
90                                          BreakpointSite *bp_site) override;
91 
92         lldb_private::Error
93         LaunchProcess (lldb_private::ProcessLaunchInfo &launch_info) override;
94 
95         lldb::ProcessSP
96         Attach(ProcessAttachInfo &attach_info, Debugger &debugger,
97                Target *target, Listener &listener, Error &error) override;
98 
99         bool
100         CanDebugProcess () override;
101 
102         void
103         CalculateTrapHandlerSymbolNames () override;
104 
105         Error
106         LaunchNativeProcess (
107             ProcessLaunchInfo &launch_info,
108             lldb_private::NativeProcessProtocol::NativeDelegate &native_delegate,
109             NativeProcessProtocolSP &process_sp) override;
110 
111         Error
112         AttachNativeProcess (lldb::pid_t pid,
113                              lldb_private::NativeProcessProtocol::NativeDelegate &native_delegate,
114                              NativeProcessProtocolSP &process_sp) override;
115 
116     private:
117         DISALLOW_COPY_AND_ASSIGN (PlatformLinux);
118     };
119 } // namespace lldb_private
120 
121 #endif  // liblldb_PlatformLinux_h_
122