30#include "llvm/ADT/SmallString.h" 
   38  if (permissions.size() != 9)
 
   40  bool user_r, user_w, user_x, group_r, group_w, group_x, world_r, world_w,
 
   43  user_r = (permissions[0] == 
'r');
 
   44  user_w = (permissions[1] == 
'w');
 
   45  user_x = (permissions[2] == 
'x');
 
   47  group_r = (permissions[3] == 
'r');
 
   48  group_w = (permissions[4] == 
'w');
 
   49  group_x = (permissions[5] == 
'x');
 
   51  world_r = (permissions[6] == 
'r');
 
   52  world_w = (permissions[7] == 
'w');
 
   53  world_x = (permissions[8] == 
'x');
 
   55  mode_t user, group, world;
 
   56  user = (user_r ? 4 : 0) | (user_w ? 2 : 0) | (user_x ? 1 : 0);
 
   57  group = (group_r ? 4 : 0) | (group_w ? 2 : 0) | (group_x ? 1 : 0);
 
   58  world = (world_r ? 4 : 0) | (world_w ? 2 : 0) | (world_x ? 1 : 0);
 
   60  return user | group | world;
 
 
   63#define LLDB_OPTIONS_permissions 
   64#include "CommandOptions.inc" 
   76    char short_option = (char)
GetDefinitions()[option_idx].short_option;
 
   77    switch (short_option) {
 
   82            "invalid value for permissions: %s", option_arg.str().c_str());
 
   88      if (perms == (mode_t)-1)
 
   90            "invalid value for permissions: %s", option_arg.str().c_str());
 
  122      llvm_unreachable(
"Unimplemented option");
 
 
  133    return llvm::ArrayRef(g_permissions_options);
 
 
 
  150                            "Create a platform if needed and select it as the " 
  152                            "platform select <platform-name>", 0),
 
 
  174      if (platform_name && platform_name[0]) {
 
  175        const bool select = 
true;
 
  194          "platform create takes a platform name as an argument\n");
 
 
 
  207                            "List all platforms that are available.", nullptr,
 
 
  215    ostrm.
Printf(
"Available platforms:\n");
 
  218    ostrm.
Format(
"{0}: {1}\n", host_platform_sp->GetPluginName(),
 
  219                 host_platform_sp->GetDescription());
 
  222    for (idx = 0; 
true; ++idx) {
 
  223      llvm::StringRef plugin_name =
 
  225      if (plugin_name.empty())
 
  227      llvm::StringRef plugin_desc =
 
  229      ostrm.
Format(
"{0}: {1}\n", plugin_name, plugin_desc);
 
  233      result.
AppendError(
"no platforms are available\n");
 
 
 
  244                            "Display status for the current platform.", nullptr,
 
 
  262      platform_sp->GetStatus(ostrm);
 
  265      result.
AppendError(
"no platform is currently selected\n");
 
 
 
  275            interpreter, 
"platform connect",
 
  276            "Select the current platform by providing a connection URL.",
 
  277            "platform connect <connect-url>", 0) {
 
 
  288        GetDebugger().GetPlatformList().GetSelectedPlatform());
 
  291      if (
error.Success()) {
 
  292        platform_sp->GetStatus(ostrm);
 
  303      result.
AppendError(
"no platform is currently selected\n");
 
 
  309        GetDebugger().GetPlatformList().GetSelectedPlatform());
 
  312      m_platform_options = platform_sp->GetConnectionOptions(
m_interpreter);
 
  313      if (m_platform_options != 
nullptr && !m_platform_options->
m_did_finalize)
 
  316    return m_platform_options;
 
 
 
  325                            "Disconnect from the current platform.",
 
  326                            "platform disconnect", 0) {}
 
 
  333        GetDebugger().GetPlatformList().GetSelectedPlatform());
 
  338        if (platform_sp->IsConnected()) {
 
  341          const char *hostname_cstr = platform_sp->GetHostname();
 
  342          std::string hostname;
 
  344            hostname.assign(hostname_cstr);
 
  346          error = platform_sp->DisconnectRemote();
 
  347          if (
error.Success()) {
 
  349            if (hostname.empty())
 
  350              ostrm.
Format(
"Disconnected from \"{0}\"\n",
 
  351                           platform_sp->GetPluginName());
 
  353              ostrm.
Printf(
"Disconnected from \"%s\"\n", hostname.c_str());
 
  361                                        platform_sp->GetPluginName());
 
  366            "\"platform disconnect\" doesn't take any arguments");
 
  369      result.
AppendError(
"no platform is currently selected");
 
 
 
  379                            "Set settings for the current target's platform.",
 
  380                            "platform settings", 0),
 
  383                             "The working directory for the platform.") {
 
 
  392        GetDebugger().GetPlatformList().GetSelectedPlatform());
 
  395        platform_sp->SetWorkingDirectory(
 
  398      result.
AppendError(
"no platform is currently selected");
 
 
 
  417                            "Make a new directory on the remote end.", nullptr,
 
 
  426        GetDebugger().GetPlatformList().GetSelectedPlatform());
 
  428      std::string cmd_line;
 
  433      if (options_permissions)
 
  436        mode = lldb::eFilePermissionsUserRWX | lldb::eFilePermissionsGroupRWX |
 
  437               lldb::eFilePermissionsWorldRX;
 
  439      if (
error.Success()) {
 
  445      result.
AppendError(
"no platform currently selected\n");
 
 
 
  466                            "Open a file on the remote end.", nullptr, 0) {
 
 
  474        GetDebugger().GetPlatformList().GetSelectedPlatform());
 
  477      std::string cmd_line;
 
  482      if (options_permissions)
 
  485        perms = lldb::eFilePermissionsUserRW | lldb::eFilePermissionsGroupRW |
 
  486                lldb::eFilePermissionsWorldRead;
 
  491      if (
error.Success()) {
 
  498      result.
AppendError(
"no platform currently selected\n");
 
 
 
  519                            "Close a file on the remote end.", nullptr, 0) {
 
 
  527        GetDebugger().GetPlatformList().GetSelectedPlatform());
 
  529      std::string cmd_line;
 
  532      if (!llvm::to_integer(cmd_line, fd)) {
 
  538      bool success = platform_sp->CloseFile(fd, 
error);
 
  546      result.
AppendError(
"no platform currently selected\n");
 
 
 
  553#define LLDB_OPTIONS_platform_fread 
  554#include "CommandOptions.inc" 
  560                            "Read data from a file on the remote end.", nullptr,
 
 
  569        GetDebugger().GetPlatformList().GetSelectedPlatform());
 
  571      std::string cmd_line;
 
  574      if (!llvm::to_integer(cmd_line, fd)) {
 
  579      std::string buffer(
m_options.m_count, 0);
 
  581      uint64_t retcode = platform_sp->ReadFile(
 
  591      result.
AppendError(
"no platform currently selected\n");
 
 
  609      switch (short_option) {
 
  611        if (option_arg.getAsInteger(0, 
m_offset))
 
  613                                                    option_arg.str().c_str());
 
  616        if (option_arg.getAsInteger(0, 
m_count))
 
  618                                                    option_arg.str().c_str());
 
  621        llvm_unreachable(
"Unimplemented option");
 
 
  633      return llvm::ArrayRef(g_platform_fread_options);
 
 
 
 
  647#define LLDB_OPTIONS_platform_fwrite 
  648#include "CommandOptions.inc" 
  654                            "Write data to a file on the remote end.", nullptr,
 
 
  663        GetDebugger().GetPlatformList().GetSelectedPlatform());
 
  665      std::string cmd_line;
 
  669      if (!llvm::to_integer(cmd_line, fd)) {
 
  684      result.
AppendError(
"no platform currently selected\n");
 
 
  702      switch (short_option) {
 
  704        if (option_arg.getAsInteger(0, 
m_offset))
 
  706                                                    option_arg.str().c_str());
 
  709        m_data.assign(std::string(option_arg));
 
  712        llvm_unreachable(
"Unimplemented option");
 
 
  724      return llvm::ArrayRef(g_platform_fwrite_options);
 
 
 
 
  741            interpreter, 
"platform file",
 
  742            "Commands to access files on the current platform.",
 
  743            "platform file [open|close|read|write] ...") {
 
 
 
  768            interpreter, 
"platform get-file",
 
  769            "Transfer a file from the remote end to the local host.",
 
  770            "platform get-file <remote-file-spec> <local-file-spec>", 0) {
 
  774(lldb) platform get-file /the/remote/file/path /the/local/file/path 
  776    Transfer a file from the remote end with file path /the/remote/file/path to the local host.)"); 
  786    arg1.push_back(file_arg_remote);
 
  793    arg2.push_back(file_arg_host);
 
 
  818      result.
AppendError(
"required arguments missing; specify both the " 
  819                         "source and destination file paths");
 
  824        GetDebugger().GetPlatformList().GetSelectedPlatform());
 
  828      Status error = platform_sp->GetFile(FileSpec(remote_file_path),
 
  829                                          FileSpec(local_file_path));
 
  830      if (
error.Success()) {
 
  832            "successfully get-file from %s (remote) to %s (host)\n",
 
  833            remote_file_path, local_file_path);
 
 
  840      result.
AppendError(
"no platform currently selected\n");
 
 
  850                            "Get the file size from the remote end.",
 
  851                            "platform get-size <remote-file-spec>", 0) {
 
  855(lldb) platform get-size /the/remote/file/path 
 
  857    Get the file size from the remote end with path /the/remote/file/path.)"); 
  867      result.
AppendError(
"required argument missing; specify the source file " 
  868                         "path as the only argument");
 
  873        GetDebugger().GetPlatformList().GetSelectedPlatform());
 
  876      user_id_t size = platform_sp->GetFileSize(FileSpec(remote_file_path));
 
  880                                       remote_file_path.c_str(), size);
 
  884            "Error getting file size of %s (remote)\n",
 
  885            remote_file_path.c_str());
 
 
  888      result.
AppendError(
"no platform currently selected\n");
 
 
  898                            "Get the file permission bits from the remote end.",
 
  899                            "platform get-permissions <remote-file-spec>", 0) {
 
  903(lldb) platform get-permissions /the/remote/file/path 
 
  905    Get the file permissions from the remote end with path /the/remote/file/path.)"); 
  915      result.
AppendError(
"required argument missing; specify the source file " 
  916                         "path as the only argument");
 
  921        GetDebugger().GetPlatformList().GetSelectedPlatform());
 
  924      uint32_t permissions;
 
  925      Status error = platform_sp->GetFilePermissions(FileSpec(remote_file_path),
 
  927      if (
error.Success()) {
 
  929            "File permissions of %s (remote): 0o%04" PRIo32 
"\n",
 
  930            remote_file_path.c_str(), permissions);
 
 
  935      result.
AppendError(
"no platform currently selected\n");
 
 
  945                            "Check if the file exists on the remote end.",
 
  946                            "platform file-exists <remote-file-spec>", 0) {
 
  950(lldb) platform file-exists /the/remote/file/path 
 
  952    Check if /the/remote/file/path exists on the remote end.)"); 
  962      result.
AppendError(
"required argument missing; specify the source file " 
  963                         "path as the only argument");
 
  968        GetDebugger().GetPlatformList().GetSelectedPlatform());
 
  971      bool exists = platform_sp->GetFileExists(FileSpec(remote_file_path));
 
  973          "File %s (remote) %s\n",
 
  974          remote_file_path.c_str(), exists ? 
"exists" : 
"does not exist");
 
 
  977      result.
AppendError(
"no platform currently selected\n");
 
 
  987            interpreter, 
"platform put-file",
 
  988            "Transfer a file from this system to the remote end.",
 
  989            "platform put-file <source> [<destination>]", 0) {
 
  993(lldb) platform put-file /source/foo.txt /destination/bar.txt 
  995(lldb) platform put-file /source/foo.txt 
 
  997    Relative source file paths are resolved against lldb's local working directory. 
  999    Omitting the destination places the file in the platform working directory.)"); 
 1026    FileSpec dst_fs(dst ? dst : src_fs.GetFilename().GetCString());
 
 1029        GetDebugger().GetPlatformList().GetSelectedPlatform());
 
 1031      Status error(platform_sp->PutFile(src_fs, dst_fs));
 
 1032      if (
error.Success()) {
 
 
 1038      result.
AppendError(
"no platform currently selected\n");
 
 
 1048                            "Launch a new process on a remote platform.",
 
 1049                            "platform process launch program",
 
 1050                            eCommandRequiresTarget | eCommandTryTargetAPILock),
 
 
 1091        llvm::SmallString<128> exe_path;
 
 1092        m_options.launch_info.GetExecutableFile().GetPath(exe_path);
 
 1093        if (!exe_path.empty())
 
 1094          m_options.launch_info.GetArguments().AppendArgument(exe_path);
 
 1099        m_options.launch_info.SetProcessPluginName(
"ScriptedProcess");
 
 1102        m_options.launch_info.SetScriptedMetadata(metadata_sp);
 
 1107        if (
m_options.launch_info.GetExecutableFile()) {
 
 1110          m_options.launch_info.GetArguments().AppendArguments(args);
 
 1114          const bool first_arg_is_executable = 
true;
 
 1115          m_options.launch_info.SetArguments(args, first_arg_is_executable);
 
 1119      if (
m_options.launch_info.GetExecutableFile()) {
 
 1124          Args target_run_args;
 
 1126          m_options.launch_info.GetArguments().AppendArguments(target_run_args);
 
 1129        ProcessSP process_sp(platform_sp->DebugProcess(
 
 1132        if (!process_sp && 
error.Success()) {
 
 1133          result.
AppendError(
"failed to launch or debug process");
 
 1135        } 
else if (!
error.Success()) {
 
 1140        const bool synchronous_execution =
 
 1142        auto launch_info = 
m_options.launch_info;
 
 1143        bool rebroadcast_first_stop =
 
 1144            !synchronous_execution &&
 
 1145            launch_info.GetFlags().Test(eLaunchFlagStopAtEntry);
 
 1148        StateType state = process_sp->WaitForProcessToStop(
 
 1149            std::nullopt, &first_stop_event_sp, rebroadcast_first_stop,
 
 1150            launch_info.GetHijackListener());
 
 1151        process_sp->RestoreProcessEvents();
 
 1153        if (rebroadcast_first_stop) {
 
 1154          assert(first_stop_event_sp);
 
 1155          process_sp->BroadcastEvent(first_stop_event_sp);
 
 1161          if (launch_info.GetFlags().Test(eLaunchFlagStopAtEntry))
 
 1163          if (synchronous_execution) {
 
 1169            error = process_sp->Resume();
 
 1170            if (!
error.Success()) {
 
 1172                  "process resume at entry point failed: %s",
 
 1179              "initial process state wasn't stopped: %s",
 
 1184        if (process_sp && process_sp->IsAlive()) {
 
 1189        result.
AppendError(
"'platform process launch' uses the current target " 
 1190                           "file and arguments, or the executable and its " 
 1191                           "arguments can be specified in this command");
 
 
 
 1207#define LLDB_OPTIONS_platform_process_list 
 1208#include "CommandOptions.inc" 
 1214                            "List processes on a remote platform by name, pid, " 
 1215                            "or many other matching attributes.",
 
 1216                            "platform process list", 0) {}
 
 
 1239        if (platform_sp->GetProcessInfo(pid, proc_info)) {
 
 1242          proc_info.
DumpAsTableRow(ostrm, platform_sp->GetUserIDResolver(),
 
 1247              "no process found with pid = %" PRIu64 
"\n", pid);
 
 1251        const uint32_t matches =
 
 1252            platform_sp->FindProcesses(
m_options.match_info, proc_infos);
 
 1253        const char *match_desc = 
nullptr;
 
 1254        const char *match_name =
 
 1255            m_options.match_info.GetProcessInfo().GetName();
 
 1256        if (match_name && match_name[0]) {
 
 1257          switch (
m_options.match_info.GetNameMatchType()) {
 
 1261            match_desc = 
"matched";
 
 1264            match_desc = 
"contained";
 
 1267            match_desc = 
"started with";
 
 1270            match_desc = 
"ended with";
 
 1273            match_desc = 
"matched the regular expression";
 
 1281                "no processes were found that {0} \"{1}\" on the \"{2}\" " 
 1283                match_desc, match_name, platform_sp->GetName());
 
 1286                "no processes were found on the \"{0}\" platform\n",
 
 1287                platform_sp->GetName());
 
 1290              "{0} matching process{1} found on \"{2}\"", matches,
 
 1291              matches > 1 ? 
"es were" : 
" was", platform_sp->GetName());
 
 1298          for (uint32_t i = 0; i < matches; ++i) {
 
 1299            proc_infos[i].DumpAsTableRow(
 
 1300                ostrm, platform_sp->GetUserIDResolver(), 
m_options.show_args,
 
 
 1320      bool success = 
false;
 
 1323      success = !option_arg.getAsInteger(0, 
id);
 
 1324      switch (short_option) {
 
 1326        match_info.GetProcessInfo().SetProcessID(
id);
 
 1329              "invalid process ID string: '%s'", option_arg.str().c_str());
 
 1333        match_info.GetProcessInfo().SetParentProcessID(
id);
 
 1336              "invalid parent process ID string: '%s'",
 
 1337              option_arg.str().c_str());
 
 1344              "invalid user ID string: '%s'", option_arg.str().c_str());
 
 1348        match_info.GetProcessInfo().SetEffectiveUserID(success ? 
id 
 1352              "invalid effective user ID string: '%s'",
 
 1353              option_arg.str().c_str());
 
 1360              "invalid group ID string: '%s'", option_arg.str().c_str());
 
 1364        match_info.GetProcessInfo().SetEffectiveGroupID(success ? 
id 
 1368              "invalid effective group ID string: '%s'",
 
 1369              option_arg.str().c_str());
 
 1376            target_sp ? target_sp->GetDebugger().shared_from_this()
 
 1379            debugger_sp ? debugger_sp->GetPlatformList().GetSelectedPlatform()
 
 1381        match_info.GetProcessInfo().GetArchitecture() =
 
 1386        match_info.GetProcessInfo().GetExecutableFile().SetFile(
 
 1387            option_arg, FileSpec::Style::native);
 
 1392        match_info.GetProcessInfo().GetExecutableFile().SetFile(
 
 1393            option_arg, FileSpec::Style::native);
 
 1398        match_info.GetProcessInfo().GetExecutableFile().SetFile(
 
 1399            option_arg, FileSpec::Style::native);
 
 1404        match_info.GetProcessInfo().GetExecutableFile().SetFile(
 
 1405            option_arg, FileSpec::Style::native);
 
 1410        match_info.GetProcessInfo().GetExecutableFile().SetFile(
 
 1411            option_arg, FileSpec::Style::native);
 
 1428        llvm_unreachable(
"Unimplemented option");
 
 
 1441      return llvm::ArrayRef(g_platform_process_list_options);
 
 
 
 
 1459            interpreter, 
"platform process info",
 
 1460            "Get detailed information for one or more process by process ID.",
 
 1461            "platform process info <pid> [<pid> <pid> ...]", 0) {
 
 
 1483        if (platform_sp->IsConnected()) {
 
 1485          for (
auto &entry : args.
entries()) {
 
 1487            if (entry.ref().getAsInteger(0, pid)) {
 
 1489                                           entry.ref().str().c_str());
 
 1493              if (platform_sp->GetProcessInfo(pid, proc_info)) {
 
 1494                ostrm.
Printf(
"Process information for process %" PRIu64 
":\n",
 
 1496                proc_info.
Dump(ostrm, platform_sp->GetUserIDResolver());
 
 1498                ostrm.
Printf(
"error: no process information is available for " 
 1499                             "process %" PRIu64 
"\n",
 
 1508                                        platform_sp->GetPluginName());
 
 1512        result.
AppendError(
"one or more process id(s) must be specified");
 
 1515      result.
AppendError(
"no platform is currently selected");
 
 
 
 1520#define LLDB_OPTIONS_platform_process_attach 
 1521#include "CommandOptions.inc" 
 1527                            "Attach to a process.",
 
 1528                            "platform process attach <cmd-options>"),
 
 
 1540        GetDebugger().GetPlatformList().GetSelectedPlatform());
 
 1544        m_options.attach_info.SetProcessPluginName(
"ScriptedProcess");
 
 1547        m_options.attach_info.SetScriptedMetadata(metadata_sp);
 
 1551      ProcessSP remote_process_sp = platform_sp->Attach(
 
 1555      } 
else if (!remote_process_sp) {
 
 1556        result.
AppendError(
"could not attach: unknown reason");
 
 1560      result.
AppendError(
"no platform is currently selected");
 
 
 
 1577                               "Commands to query, launch and attach to " 
 1578                               "processes on the current platform.",
 
 1579                               "platform process [attach|launch|list] ...") {
 
 
 
 1602#define LLDB_OPTIONS_platform_shell 
 1603#include "CommandOptions.inc" 
 1614      return llvm::ArrayRef(g_platform_shell_options);
 
 
 1621      const char short_option = (char)
GetDefinitions()[option_idx].short_option;
 
 1623      switch (short_option) {
 
 1628        uint32_t timeout_sec;
 
 1629        if (option_arg.getAsInteger(10, timeout_sec))
 
 1631              "could not convert \"%s\" to a numeric value.",
 
 1632              option_arg.str().c_str());
 
 1634          m_timeout = std::chrono::seconds(timeout_sec);
 
 1637        if (option_arg.empty()) {
 
 1639              "missing shell interpreter path for option -i|--interpreter.");
 
 1647        llvm_unreachable(
"Unimplemented option");
 
 
 
 1666                         "Run a shell command on the current platform.",
 
 1667                         "platform shell <shell-command>", 0) {
 
 
 1678    m_options.NotifyOptionParsingStarting(&exe_ctx);
 
 1681    if (raw_command_line.empty()) {
 
 1686    const bool is_alias = !raw_command_line.contains(
"platform");
 
 1695                                      is_alias ? 
"shell" : 
"platform shell");
 
 1704            : 
GetDebugger().GetPlatformList().GetSelectedPlatform());
 
 1711      error = (platform_sp->RunShellCommand(
m_options.m_shell_interpreter, cmd,
 
 1712                                            working_dir, &status, &signo,
 
 1714      if (!output.empty())
 
 1721                "error: command returned with status %i and signal %s\n",
 
 1722                status, signo_cstr);
 
 1725                "error: command returned with status %i and signal %i\n",
 
 1729              "error: command returned with status %i\n", status);
 
 1733          "error: cannot run remote shell commands without a platform\n");
 
 1735          "error: cannot run remote shell commands without a platform");
 
 
 
 1753            interpreter, 
"platform target-install",
 
 1754            "Install a target (bundle or executable file) to the remote end.",
 
 1755            "platform target-install <local-thing> <remote-sandbox>", 0) {
 
 
 1775      result.
AppendError(
"platform target-install takes two arguments");
 
 1783      result.
AppendError(
"source location does not exist or is not accessible");
 
 1787        GetDebugger().GetPlatformList().GetSelectedPlatform());
 
 1789      result.
AppendError(
"no platform currently selected");
 
 1794    if (
error.Success()) {
 
 
 
 1804          interpreter, 
"platform", 
"Commands to manage and create platforms.",
 
 1805          "platform [connect|disconnect|info|list|status|select] ...") {
 
 
static llvm::raw_ostream & error(Stream &strm)
const OptionPermissions & operator=(const OptionPermissions &)=delete
void OptionParsingStarting(ExecutionContext *execution_context) override
OptionPermissions()=default
lldb_private::Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
~OptionPermissions() override=default
OptionPermissions(const OptionPermissions &)=delete
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
An architecture specification class.
A command line argument class.
size_t GetArgumentCount() const
Gets the number of arguments left in this command object.
llvm::ArrayRef< ArgEntry > entries() const
const char * GetArgumentAtIndex(size_t idx) const
Gets the NULL terminated C string argument pointer for the argument at index idx.
bool GetCommandString(std::string &command) const
static bool InvokeCommonCompletionCallbacks(CommandInterpreter &interpreter, uint32_t completion_mask, lldb_private::CompletionRequest &request, SearchFilter *searcher)
static void PlatformPluginNames(CommandInterpreter &interpreter, CompletionRequest &request, SearchFilter *searcher)
ExecutionContext GetExecutionContext() const
bool LoadSubCommand(llvm::StringRef cmd_name, const lldb::CommandObjectSP &command_obj) override
CommandObjectMultiword(CommandInterpreter &interpreter, const char *name, const char *help=nullptr, const char *syntax=nullptr, uint32_t flags=0)
friend class CommandInterpreter
CommandObjectParsed(CommandInterpreter &interpreter, const char *name, const char *help=nullptr, const char *syntax=nullptr, uint32_t flags=0)
CommandObjectRaw(CommandInterpreter &interpreter, llvm::StringRef name, llvm::StringRef help="", llvm::StringRef syntax="", uint32_t flags=0)
std::vector< CommandArgumentData > CommandArgumentEntry
virtual void SetHelpLong(llvm::StringRef str)
void AddSimpleArgumentList(lldb::CommandArgumentType arg_type, ArgumentRepetitionType repetition_type=eArgRepeatPlain)
ExecutionContext m_exe_ctx
std::vector< CommandArgumentEntry > m_arguments
CommandInterpreter & GetCommandInterpreter()
CommandInterpreter & m_interpreter
bool ParseOptions(Args &args, CommandReturnObject &result)
virtual llvm::StringRef GetSyntax()
void void AppendError(llvm::StringRef in_string)
void SetStatus(lldb::ReturnStatus status)
void AppendErrorWithFormat(const char *format,...) __attribute__((format(printf
void AppendMessageWithFormat(const char *format,...) __attribute__((format(printf
void void AppendMessageWithFormatv(const char *format, Args &&...args)
void AppendErrorWithFormatv(const char *format, Args &&...args)
Stream & GetOutputStream()
"lldb/Utility/ArgCompletionRequest.h"
size_t GetCursorIndex() const
A class to manage flag bits.
lldb::TargetSP GetSelectedTarget()
CommandInterpreter & GetCommandInterpreter()
PlatformList & GetPlatformList()
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
const lldb::TargetSP & GetTargetSP() const
Get accessor to get the target shared pointer.
void Resolve(llvm::SmallVectorImpl< char > &path)
Resolve path to make it canonical.
static FileSystem & Instance()
static const char * GetSignalAsCString(int signo)
A class that describes an executable image and its associated object and symbol files.
const ArchSpec & GetArchitecture() const
Get const accessor for the module architecture.
const FileSpec & GetFileSpec() const
Get const accessor for the module file specification.
A pair of an option list with a 'raw' string as a suffix.
bool HasArgs() const
Returns true if there are any arguments before the raw suffix.
Args & GetArgs()
Returns the list of arguments.
const std::string & GetRawPart() const
Returns the raw suffix part of the parsed string.
A command line option parsing protocol class.
std::vector< Option > m_getopt_table
static llvm::StringRef GetPlatformPluginDescriptionAtIndex(uint32_t idx)
static llvm::StringRef GetPlatformPluginNameAtIndex(uint32_t idx)
static void DumpTableHeader(Stream &s, bool show_args, bool verbose)
void Dump(Stream &s, UserIDResolver &resolver) const
void DumpAsTableRow(Stream &s, UserIDResolver &resolver, bool show_args, bool verbose) const
static Status FromErrorStringWithFormat(const char *format,...) __attribute__((format(printf
static Status FromErrorString(const char *str)
bool Fail() const
Test for error condition.
const char * AsCString(const char *default_error_str="unknown error") const
Get the error string associated with the current error.
A stream class that can stream formatted output to a file.
void Format(const char *format, Args &&... args)
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
size_t EOL()
Output and End of Line character to the stream.
void SetProcessLaunchInfo(const ProcessLaunchInfo &launch_info)
bool GetRunArguments(Args &args) const
Module * GetExecutableModulePointer()
lldb::PlatformSP GetPlatform()
#define LLDB_INVALID_PROCESS_ID
A class that represents a running process on the host machine.
std::vector< OptionArgElement > OptionElementVector
const char * StateAsCString(lldb::StateType state)
Converts a StateType to a C string.
std::vector< ProcessInstanceInfo > ProcessInstanceInfoList
@ eRemoteDiskDirectoryCompletion
@ eRemoteDiskFileCompletion
std::shared_ptr< lldb_private::ScriptedMetadata > ScriptedMetadataSP
std::shared_ptr< lldb_private::CommandObject > CommandObjectSP
std::shared_ptr< lldb_private::Platform > PlatformSP
StateType
Process and Thread States.
@ eStateStopped
Process or thread is stopped and can be examined.
std::shared_ptr< lldb_private::Process > ProcessSP
std::shared_ptr< lldb_private::Debugger > DebuggerSP
std::shared_ptr< lldb_private::Event > EventSP
@ eReturnStatusSuccessFinishResult
@ eReturnStatusSuccessFinishNoResult
@ eArgTypeUnsignedInteger
std::shared_ptr< lldb_private::Target > TargetSP
Used to build individual command argument lists.
ArgumentRepetitionType arg_repetition
lldb::CommandArgumentType arg_type