LLDB  mainline
Classes | Functions | Variables
CommandObjectPlatform.cpp File Reference
#include <mutex>
#include "CommandObjectPlatform.h"
#include "lldb/Core/Debugger.h"
#include "lldb/Core/Module.h"
#include "lldb/Core/PluginManager.h"
#include "lldb/Host/OptionParser.h"
#include "lldb/Host/StringConvert.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandOptionValidators.h"
#include "lldb/Interpreter/CommandReturnObject.h"
#include "lldb/Interpreter/OptionGroupFile.h"
#include "lldb/Interpreter/OptionGroupPlatform.h"
#include "lldb/Target/ExecutionContext.h"
#include "lldb/Target/Platform.h"
#include "lldb/Target/Process.h"
#include "lldb/Utility/Args.h"
#include "lldb/Utility/DataExtractor.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/Support/Threading.h"
Include dependency graph for CommandObjectPlatform.cpp:

Go to the source code of this file.

Classes

class  OptionPermissions
 
class  CommandObjectPlatformSelect
 
class  CommandObjectPlatformList
 
class  CommandObjectPlatformStatus
 
class  CommandObjectPlatformConnect
 
class  CommandObjectPlatformDisconnect
 
class  CommandObjectPlatformSettings
 
class  CommandObjectPlatformMkDir
 
class  CommandObjectPlatformFOpen
 
class  CommandObjectPlatformFClose
 
class  CommandObjectPlatformFRead
 
class  CommandObjectPlatformFRead::CommandOptions
 
class  CommandObjectPlatformFWrite
 
class  CommandObjectPlatformFWrite::CommandOptions
 
class  CommandObjectPlatformFile
 
class  CommandObjectPlatformGetFile
 
class  CommandObjectPlatformGetSize
 
class  CommandObjectPlatformPutFile
 
class  CommandObjectPlatformProcessLaunch
 
class  CommandObjectPlatformProcessList
 
class  CommandObjectPlatformProcessList::CommandOptions
 
class  CommandObjectPlatformProcessInfo
 
class  CommandObjectPlatformProcessAttach
 
class  CommandObjectPlatformProcessAttach::CommandOptions
 
class  CommandObjectPlatformProcess
 
class  CommandObjectPlatformShell
 
class  CommandObjectPlatformShell::CommandOptions
 
class  CommandObjectPlatformInstall
 

Functions

static mode_t ParsePermissionString (const char *)=delete
 
static mode_t ParsePermissionString (llvm::StringRef permissions)
 

Variables

static constexpr OptionDefinition g_permissions_options []
 
static constexpr OptionDefinition g_platform_fread_options []
 
static constexpr OptionDefinition g_platform_fwrite_options []
 
static OptionDefinition g_platform_process_list_options []
 
static constexpr OptionDefinition g_platform_process_attach_options []
 
static constexpr OptionDefinition g_platform_shell_options []
 

Function Documentation

◆ ParsePermissionString() [1/2]

static mode_t ParsePermissionString ( const char *  )
staticdelete

◆ ParsePermissionString() [2/2]

static mode_t ParsePermissionString ( llvm::StringRef  permissions)
static

Definition at line 35 of file CommandObjectPlatform.cpp.

Variable Documentation

◆ g_permissions_options

constexpr OptionDefinition g_permissions_options[]
static
Initial value:
= {
{LLDB_OPT_SET_ALL, false, "permissions-value", 'v', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypePermissionsNumber, "Give out the numeric value for permissions (e.g. 757)"},
{LLDB_OPT_SET_ALL, false, "permissions-string", 's', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypePermissionsString, "Give out the string value for permissions (e.g. rwxr-xr--)."},
{LLDB_OPT_SET_ALL, false, "user-read", 'r', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Allow user to read."},
{LLDB_OPT_SET_ALL, false, "user-write", 'w', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Allow user to write."},
{LLDB_OPT_SET_ALL, false, "user-exec", 'x', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Allow user to execute."},
{LLDB_OPT_SET_ALL, false, "group-read", 'R', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Allow group to read."},
{LLDB_OPT_SET_ALL, false, "group-write", 'W', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Allow group to write."},
{LLDB_OPT_SET_ALL, false, "group-exec", 'X', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Allow group to execute."},
{LLDB_OPT_SET_ALL, false, "world-read", 'd', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Allow world to read."},
{LLDB_OPT_SET_ALL, false, "world-write", 't', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Allow world to write."},
{LLDB_OPT_SET_ALL, false, "world-exec", 'e', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Allow world to execute."},
}
#define LLDB_OPT_SET_ALL
Definition: lldb-defines.h:110

Definition at line 61 of file CommandObjectPlatform.cpp.

Referenced by OptionPermissions::GetDefinitions().

◆ g_platform_fread_options

constexpr OptionDefinition g_platform_fread_options[]
static
Initial value:
= {
{ LLDB_OPT_SET_1, false, "offset", 'o', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeIndex, "Offset into the file at which to start reading." },
{ LLDB_OPT_SET_1, false, "count", 'c', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeCount, "Number of bytes to read from the file." },
}
#define LLDB_OPT_SET_1
Definition: lldb-defines.h:111

Definition at line 588 of file CommandObjectPlatform.cpp.

Referenced by CommandObjectPlatformFRead::CommandOptions::GetDefinitions().

◆ g_platform_fwrite_options

constexpr OptionDefinition g_platform_fwrite_options[]
static
Initial value:
= {
{ LLDB_OPT_SET_1, false, "offset", 'o', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeIndex, "Offset into the file at which to start reading." },
{ LLDB_OPT_SET_1, false, "data", 'd', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeValue, "Text to write to the file." },
}
#define LLDB_OPT_SET_1
Definition: lldb-defines.h:111

Definition at line 681 of file CommandObjectPlatform.cpp.

Referenced by CommandObjectPlatformFWrite::CommandOptions::GetDefinitions().

◆ g_platform_process_attach_options

constexpr OptionDefinition g_platform_process_attach_options[]
static
Initial value:
= {
{ LLDB_OPT_SET_ALL, false, "plugin", 'P', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypePlugin, "Name of the process plugin you want to use." },
{ LLDB_OPT_SET_1, false, "pid", 'p', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypePid, "The process ID of an existing process to attach to." },
{ LLDB_OPT_SET_2, false, "name", 'n', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeProcessName, "The name of the process to attach to." },
{ LLDB_OPT_SET_2, false, "waitfor", 'w', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Wait for the process with <process-name> to launch." },
}
#define LLDB_OPT_SET_2
Definition: lldb-defines.h:112
#define LLDB_OPT_SET_ALL
Definition: lldb-defines.h:110
#define LLDB_OPT_SET_1
Definition: lldb-defines.h:111

Definition at line 1439 of file CommandObjectPlatform.cpp.

Referenced by CommandObjectPlatformProcessAttach::CommandOptions::GetDefinitions().

◆ g_platform_process_list_options

OptionDefinition g_platform_process_list_options[]
static
Initial value:
= {
{ LLDB_OPT_SET_1, false, "pid", 'p', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypePid, "List the process info for a specific process ID." },
{ LLDB_OPT_SET_2, true, "name", 'n', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeProcessName, "Find processes with executable basenames that match a string." },
{ LLDB_OPT_SET_3, true, "ends-with", 'e', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeProcessName, "Find processes with executable basenames that end with a string." },
{ LLDB_OPT_SET_4, true, "starts-with", 's', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeProcessName, "Find processes with executable basenames that start with a string." },
{ LLDB_OPT_SET_5, true, "contains", 'c', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeProcessName, "Find processes with executable basenames that contain a string." },
{ LLDB_OPT_SET_6, true, "regex", 'r', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeRegularExpression, "Find processes with executable basenames that match a regular expression." },
{ LLDB_OPT_SET_FROM_TO(2, 6), false, "parent", 'P', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypePid, "Find processes that have a matching parent process ID." },
{ LLDB_OPT_SET_FROM_TO(2, 6), false, "uid", 'u', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeUnsignedInteger, "Find processes that have a matching user ID." },
{ LLDB_OPT_SET_FROM_TO(2, 6), false, "euid", 'U', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeUnsignedInteger, "Find processes that have a matching effective user ID." },
{ LLDB_OPT_SET_FROM_TO(2, 6), false, "gid", 'g', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeUnsignedInteger, "Find processes that have a matching group ID." },
{ LLDB_OPT_SET_FROM_TO(2, 6), false, "egid", 'G', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeUnsignedInteger, "Find processes that have a matching effective group ID." },
{ LLDB_OPT_SET_FROM_TO(2, 6), false, "arch", 'a', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeArchitecture, "Find processes that have a matching architecture." },
{ LLDB_OPT_SET_FROM_TO(1, 6), false, "show-args", 'A', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Show process arguments instead of the process executable basename." },
{ LLDB_OPT_SET_FROM_TO(1, 6), false, "verbose", 'v', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Enable verbose output." },
}
#define LLDB_OPT_SET_3
Definition: lldb-defines.h:113
#define LLDB_OPT_SET_4
Definition: lldb-defines.h:114
#define LLDB_OPT_SET_2
Definition: lldb-defines.h:112
#define LLDB_OPT_SET_FROM_TO(A, B)
Definition: lldb-defines.h:122
#define LLDB_OPT_SET_1
Definition: lldb-defines.h:111
#define LLDB_OPT_SET_5
Definition: lldb-defines.h:115
#define LLDB_OPT_SET_6
Definition: lldb-defines.h:116

Definition at line 1059 of file CommandObjectPlatform.cpp.

Referenced by CommandObjectPlatformProcessList::CommandOptions::CommandOptions(), and CommandObjectPlatformProcessList::CommandOptions::GetDefinitions().

◆ g_platform_shell_options

constexpr OptionDefinition g_platform_shell_options[]
static
Initial value:
= {
{ LLDB_OPT_SET_ALL, false, "timeout", 't', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeValue, "Seconds to wait for the remote host to finish running the command." },
}
#define LLDB_OPT_SET_ALL
Definition: lldb-defines.h:110

Definition at line 1618 of file CommandObjectPlatform.cpp.

Referenced by CommandObjectPlatformShell::CommandOptions::GetDefinitions().