]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.h
Update LLDB snapshot to upstream r225923 (git 2b588ecd)
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / source / Plugins / Platform / FreeBSD / PlatformFreeBSD.h
1 //===-- PlatformFreeBSD.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_PlatformFreeBSD_h_
11 #define liblldb_PlatformFreeBSD_h_
12
13 // C Includes
14 // C++ Includes
15 // Other libraries and framework includes
16 // Project includes
17 #include "lldb/Target/Platform.h"
18
19 class PlatformFreeBSD : public lldb_private::Platform
20 {
21 public:
22     // Mostly taken from PlatformDarwin and PlatformMacOSX
23
24     //------------------------------------------------------------
25     // Class functions
26     //------------------------------------------------------------
27     static lldb::PlatformSP
28     CreateInstance (bool force, const lldb_private::ArchSpec *arch);
29
30     static void
31     Initialize ();
32
33     static void
34     Terminate ();
35
36     static lldb_private::ConstString
37     GetPluginNameStatic (bool is_host);
38
39     static const char *
40     GetDescriptionStatic (bool is_host);
41
42     //------------------------------------------------------------
43     // Class Methods
44     //------------------------------------------------------------
45     PlatformFreeBSD (bool is_host);
46
47     virtual
48     ~PlatformFreeBSD();
49
50     //------------------------------------------------------------
51     // lldb_private::PluginInterface functions
52     //------------------------------------------------------------
53     virtual lldb_private::ConstString
54     GetPluginName()
55     {
56         return GetPluginNameStatic (IsHost());
57     }
58
59     virtual uint32_t
60     GetPluginVersion()
61     {
62         return 1;
63     }
64
65     virtual const char *
66     GetDescription ()
67     {
68         return GetDescriptionStatic(IsHost());
69     }
70
71     //------------------------------------------------------------
72     // lldb_private::Platform functions
73     //------------------------------------------------------------
74     virtual lldb_private::Error
75     RunShellCommand (const char *command,
76                      const char *working_dir,
77                      int *status_ptr,
78                      int *signo_ptr,
79                      std::string *command_output,
80                      uint32_t timeout_sec);
81
82     virtual lldb_private::Error
83     ResolveExecutable (const lldb_private::ModuleSpec &module_spec,
84                        lldb::ModuleSP &module_sp,
85                        const lldb_private::FileSpecList *module_search_paths_ptr);
86
87     virtual size_t
88     GetSoftwareBreakpointTrapOpcode (lldb_private::Target &target,
89                                      lldb_private::BreakpointSite *bp_site);
90
91     virtual bool
92     GetRemoteOSVersion ();
93
94     virtual bool
95     GetRemoteOSBuildString (std::string &s);
96
97     virtual bool
98     GetRemoteOSKernelDescription (std::string &s);
99
100     // Remote Platform subclasses need to override this function
101     virtual lldb_private::ArchSpec
102     GetRemoteSystemArchitecture ();
103
104     virtual bool
105     IsConnected () const;
106
107     virtual lldb_private::Error
108     ConnectRemote (lldb_private::Args& args);
109
110     virtual lldb_private::Error
111     DisconnectRemote ();
112
113     virtual const char *
114     GetHostname ();
115
116     virtual const char *
117     GetUserName (uint32_t uid);
118
119     virtual const char *
120     GetGroupName (uint32_t gid);
121
122     virtual bool
123     GetProcessInfo (lldb::pid_t pid,
124                     lldb_private::ProcessInstanceInfo &proc_info);
125
126     virtual uint32_t
127     FindProcesses (const lldb_private::ProcessInstanceInfoMatch &match_info,
128                    lldb_private::ProcessInstanceInfoList &process_infos);
129
130     virtual lldb_private::Error
131     LaunchProcess (lldb_private::ProcessLaunchInfo &launch_info);
132
133     virtual lldb::ProcessSP
134     Attach(lldb_private::ProcessAttachInfo &attach_info,
135            lldb_private::Debugger &debugger,
136            lldb_private::Target *target,
137            lldb_private::Error &error);
138
139     // FreeBSD processes can not be launched by spawning and attaching.
140     virtual bool
141     CanDebugProcess () { return false; }
142
143     // Only on PlatformMacOSX:
144     virtual lldb_private::Error
145     GetFileWithUUID (const lldb_private::FileSpec &platform_file,
146                      const lldb_private::UUID* uuid, lldb_private::FileSpec &local_file);
147
148     lldb_private::Error
149     GetSharedModule (const lldb_private::ModuleSpec &module_spec,
150                      lldb::ModuleSP &module_sp,
151                      const lldb_private::FileSpecList *module_search_paths_ptr,
152                      lldb::ModuleSP *old_module_sp_ptr,
153                      bool *did_create_ptr);
154
155     virtual bool
156     GetSupportedArchitectureAtIndex (uint32_t idx, lldb_private::ArchSpec &arch);
157
158     virtual void
159     GetStatus (lldb_private::Stream &strm);
160
161     virtual void
162     CalculateTrapHandlerSymbolNames ();
163
164 protected:
165     lldb::PlatformSP m_remote_platform_sp; // Allow multiple ways to connect to a remote freebsd OS
166
167 private:
168     DISALLOW_COPY_AND_ASSIGN (PlatformFreeBSD);
169 };
170
171 #endif  // liblldb_PlatformFreeBSD_h_