LLDB  mainline
PlatformPOSIX.h
Go to the documentation of this file.
1 //===-- PlatformPOSIX.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_POSIX_PLATFORMPOSIX_H
10 #define LLDB_SOURCE_PLUGINS_PLATFORM_POSIX_PLATFORMPOSIX_H
11 
12 #include <map>
13 #include <memory>
14 
17 
19 public:
20  PlatformPOSIX(bool is_host);
21 
22  ~PlatformPOSIX() override;
23 
24  // lldb_private::Platform functions
25 
28 
30  const lldb_private::FileSpec &destination,
31  uint32_t uid = UINT32_MAX,
32  uint32_t gid = UINT32_MAX) override;
33 
35  GetFile(const lldb_private::FileSpec &source,
36  const lldb_private::FileSpec &destination) override;
37 
38  const lldb::UnixSignalsSP &GetRemoteUnixSignals() override;
39 
40  lldb::ProcessSP Attach(lldb_private::ProcessAttachInfo &attach_info,
41  lldb_private::Debugger &debugger,
42  lldb_private::Target *target, // Can be nullptr, if
43  // nullptr create a new
44  // target, else use
45  // existing one
46  lldb_private::Status &error) override;
47 
48  lldb::ProcessSP DebugProcess(lldb_private::ProcessLaunchInfo &launch_info,
49  lldb_private::Debugger &debugger,
50  lldb_private::Target &target,
51  lldb_private::Status &error) override;
52 
54 
55  void CalculateTrapHandlerSymbolNames() override;
56 
58 
60 
62  const lldb_private::FileSpec &remote_file,
63  const std::vector<std::string> *paths,
65  lldb_private::FileSpec *loaded_image) override;
66 
68  uint32_t image_token) override;
69 
71 
72 protected:
73  std::unique_ptr<lldb_private::OptionGroupPlatformRSync>
75  std::unique_ptr<lldb_private::OptionGroupPlatformSSH>
77  std::unique_ptr<lldb_private::OptionGroupPlatformCaching>
79 
81  std::unique_ptr<lldb_private::OptionGroupOptions>>
83 
85  EvaluateLibdlExpression(lldb_private::Process *process, const char *expr_cstr,
86  llvm::StringRef expr_prefix,
87  lldb::ValueObjectSP &result_valobj_sp);
88 
89  std::unique_ptr<lldb_private::UtilityFunction>
92 
93  virtual
94  llvm::StringRef GetLibdlFunctionDeclarations(lldb_private::Process *process);
95 
96 private:
97  PlatformPOSIX(const PlatformPOSIX &) = delete;
98  const PlatformPOSIX &operator=(const PlatformPOSIX &) = delete;
99 };
100 
101 #endif // LLDB_SOURCE_PLUGINS_PLATFORM_POSIX_PLATFORMPOSIX_H
lldb_private::ExecutionContext
Definition: ExecutionContext.h:292
RemoteAwarePlatform.h
lldb_private::Process
Definition: Process.h:342
lldb_private::OptionGroupOptions
Definition: Options.h:255
PlatformPOSIX::GetRemoteUnixSignals
const lldb::UnixSignalsSP & GetRemoteUnixSignals() override
Definition: PlatformPOSIX.cpp:294
lldb_private::Args
Definition: Args.h:33
lldb_private::Target
Definition: Target.h:454
PlatformPOSIX::GetFile
lldb_private::Status GetFile(const lldb_private::FileSpec &source, const lldb_private::FileSpec &destination) override
Definition: PlatformPOSIX.cpp:153
PlatformPOSIX::PutFile
lldb_private::Status PutFile(const lldb_private::FileSpec &source, const lldb_private::FileSpec &destination, uint32_t uid=UINT32_MAX, uint32_t gid=UINT32_MAX) override
Definition: PlatformPOSIX.cpp:89
lldb_private::FileSpec
Definition: FileSpec.h:56
error
static llvm::raw_ostream & error(Stream &strm)
Definition: CommandReturnObject.cpp:17
Options.h
PlatformPOSIX
Definition: PlatformPOSIX.h:18
PlatformPOSIX::m_option_group_platform_ssh
std::unique_ptr< lldb_private::OptionGroupPlatformSSH > m_option_group_platform_ssh
Definition: PlatformPOSIX.h:76
PlatformPOSIX::EvaluateLibdlExpression
lldb_private::Status EvaluateLibdlExpression(lldb_private::Process *process, const char *expr_cstr, llvm::StringRef expr_prefix, lldb::ValueObjectSP &result_valobj_sp)
Definition: PlatformPOSIX.cpp:511
PlatformPOSIX::DoLoadImage
uint32_t DoLoadImage(lldb_private::Process *process, const lldb_private::FileSpec &remote_file, const std::vector< std::string > *paths, lldb_private::Status &error, lldb_private::FileSpec *loaded_image) override
Definition: PlatformPOSIX.cpp:679
lldb_private::ProcessLaunchInfo
Definition: ProcessLaunchInfo.h:31
PlatformPOSIX::ConnectRemote
lldb_private::Status ConnectRemote(lldb_private::Args &args) override
Definition: PlatformPOSIX.cpp:300
PlatformPOSIX::PlatformPOSIX
PlatformPOSIX(bool is_host)
Default Constructor.
Definition: PlatformPOSIX.cpp:39
PlatformPOSIX::DebugProcess
lldb::ProcessSP DebugProcess(lldb_private::ProcessLaunchInfo &launch_info, lldb_private::Debugger &debugger, lldb_private::Target &target, lldb_private::Status &error) override
Subclasses do not need to implement this function as it uses the Platform::LaunchProcess() followed b...
Definition: PlatformPOSIX.cpp:413
PlatformPOSIX::DisconnectRemote
lldb_private::Status DisconnectRemote() override
Definition: PlatformPOSIX.cpp:343
PlatformPOSIX::GetFullNameForDylib
lldb_private::ConstString GetFullNameForDylib(lldb_private::ConstString basename) override
Definition: PlatformPOSIX.cpp:988
PlatformPOSIX::GetConnectionOptions
lldb_private::OptionGroupOptions * GetConnectionOptions(lldb_private::CommandInterpreter &interpreter) override
Definition: PlatformPOSIX.cpp:51
lldb_private::ConstString
Definition: ConstString.h:40
PlatformPOSIX::operator=
const PlatformPOSIX & operator=(const PlatformPOSIX &)=delete
PlatformPOSIX::m_options
std::map< lldb_private::CommandInterpreter *, std::unique_ptr< lldb_private::OptionGroupOptions > > m_options
Definition: PlatformPOSIX.h:82
PlatformPOSIX::m_option_group_platform_caching
std::unique_ptr< lldb_private::OptionGroupPlatformCaching > m_option_group_platform_caching
Definition: PlatformPOSIX.h:78
lldb_private::CommandInterpreter
Definition: CommandInterpreter.h:214
lldb_private::Debugger
Definition: Debugger.h:70
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:39
lldb_private::ProcessAttachInfo
Definition: Process.h:115
PlatformPOSIX::UnloadImage
lldb_private::Status UnloadImage(lldb_private::Process *process, uint32_t image_token) override
Definition: PlatformPOSIX.cpp:951
PlatformPOSIX::MakeLoadImageUtilityFunction
std::unique_ptr< lldb_private::UtilityFunction > MakeLoadImageUtilityFunction(lldb_private::ExecutionContext &exe_ctx, lldb_private::Status &error)
Definition: PlatformPOSIX.cpp:553
lldb_private::Status
Definition: Status.h:44
PlatformPOSIX::GetLibdlFunctionDeclarations
virtual llvm::StringRef GetLibdlFunctionDeclarations(lldb_private::Process *process)
Definition: PlatformPOSIX.cpp:979
uint32_t
PlatformPOSIX::m_option_group_platform_rsync
std::unique_ptr< lldb_private::OptionGroupPlatformRSync > m_option_group_platform_rsync
Definition: PlatformPOSIX.h:74
UINT32_MAX
#define UINT32_MAX
Definition: lldb-defines.h:31
PlatformPOSIX::~PlatformPOSIX
~PlatformPOSIX() override
Destructor.
PlatformPOSIX::GetPlatformSpecificConnectionInformation
std::string GetPlatformSpecificConnectionInformation() override
Definition: PlatformPOSIX.cpp:265
PlatformPOSIX::Attach
lldb::ProcessSP Attach(lldb_private::ProcessAttachInfo &attach_info, lldb_private::Debugger &debugger, lldb_private::Target *target, lldb_private::Status &error) override
Attach to an existing process using a process ID.
Definition: PlatformPOSIX.cpp:359
PlatformPOSIX::CalculateTrapHandlerSymbolNames
void CalculateTrapHandlerSymbolNames() override
Ask the Platform subclass to fill in the list of trap handler names.
Definition: PlatformPOSIX.cpp:507
lldb_private::RemoteAwarePlatform
A base class for platforms which automatically want to be able to forward operations to a remote plat...
Definition: RemoteAwarePlatform.h:18