1 //===-- PlatformPOSIX.h -----------------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef liblldb_PlatformPOSIX_h_
10 #define liblldb_PlatformPOSIX_h_
15 #include "lldb/Interpreter/Options.h"
16 #include "lldb/Target/RemoteAwarePlatform.h"
18 class PlatformPOSIX : public lldb_private::RemoteAwarePlatform {
20 PlatformPOSIX(bool is_host);
22 ~PlatformPOSIX() override;
24 // lldb_private::Platform functions
26 lldb_private::OptionGroupOptions *
27 GetConnectionOptions(lldb_private::CommandInterpreter &interpreter) override;
29 lldb_private::Status PutFile(const lldb_private::FileSpec &source,
30 const lldb_private::FileSpec &destination,
31 uint32_t uid = UINT32_MAX,
32 uint32_t gid = UINT32_MAX) override;
35 GetFile(const lldb_private::FileSpec &source,
36 const lldb_private::FileSpec &destination) override;
38 const lldb::UnixSignalsSP &GetRemoteUnixSignals() override;
40 lldb_private::Status ResolveExecutable(
41 const lldb_private::ModuleSpec &module_spec, lldb::ModuleSP &module_sp,
42 const lldb_private::FileSpecList *module_search_paths_ptr) override;
44 lldb::ProcessSP Attach(lldb_private::ProcessAttachInfo &attach_info,
45 lldb_private::Debugger &debugger,
46 lldb_private::Target *target, // Can be nullptr, if
47 // nullptr create a new
50 lldb_private::Status &error) override;
52 lldb::ProcessSP DebugProcess(lldb_private::ProcessLaunchInfo &launch_info,
53 lldb_private::Debugger &debugger,
54 lldb_private::Target *target, // Can be nullptr,
59 lldb_private::Status &error) override;
61 std::string GetPlatformSpecificConnectionInformation() override;
63 void CalculateTrapHandlerSymbolNames() override;
65 lldb_private::Status ConnectRemote(lldb_private::Args &args) override;
67 lldb_private::Status DisconnectRemote() override;
69 uint32_t DoLoadImage(lldb_private::Process *process,
70 const lldb_private::FileSpec &remote_file,
71 const std::vector<std::string> *paths,
72 lldb_private::Status &error,
73 lldb_private::FileSpec *loaded_image) override;
75 lldb_private::Status UnloadImage(lldb_private::Process *process,
76 uint32_t image_token) override;
78 size_t ConnectToWaitingProcesses(lldb_private::Debugger &debugger,
79 lldb_private::Status &error) override;
81 lldb_private::ConstString GetFullNameForDylib(lldb_private::ConstString basename) override;
84 std::unique_ptr<lldb_private::OptionGroupPlatformRSync>
85 m_option_group_platform_rsync;
86 std::unique_ptr<lldb_private::OptionGroupPlatformSSH>
87 m_option_group_platform_ssh;
88 std::unique_ptr<lldb_private::OptionGroupPlatformCaching>
89 m_option_group_platform_caching;
91 std::map<lldb_private::CommandInterpreter *,
92 std::unique_ptr<lldb_private::OptionGroupOptions>>
96 EvaluateLibdlExpression(lldb_private::Process *process, const char *expr_cstr,
97 llvm::StringRef expr_prefix,
98 lldb::ValueObjectSP &result_valobj_sp);
100 std::unique_ptr<lldb_private::UtilityFunction>
101 MakeLoadImageUtilityFunction(lldb_private::ExecutionContext &exe_ctx,
102 lldb_private::Status &error);
105 llvm::StringRef GetLibdlFunctionDeclarations(lldb_private::Process *process);
108 DISALLOW_COPY_AND_ASSIGN(PlatformPOSIX);
111 #endif // liblldb_PlatformPOSIX_h_