blob: b57a51be5eb47db0ec2159f800021516f5686465 [file] [log] [blame]
Greg Claytonb1888f22011-03-19 01:12:21 +00001//===-- CommandObjectPlatform.cpp -------------------------------*- 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#include "CommandObjectPlatform.h"
11
12// C Includes
13// C++ Includes
14// Other libraries and framework includes
15// Project includes
16#include "lldb/Core/DataExtractor.h"
17#include "lldb/Core/Debugger.h"
18#include "lldb/Core/PluginManager.h"
19#include "lldb/Interpreter/Args.h"
20#include "lldb/Interpreter/CommandInterpreter.h"
21#include "lldb/Interpreter/CommandReturnObject.h"
22#include "lldb/Target/ExecutionContext.h"
23#include "lldb/Target/Platform.h"
24
25using namespace lldb;
26using namespace lldb_private;
27
28//----------------------------------------------------------------------
29// "platform create <platform-name>"
30//----------------------------------------------------------------------
31class CommandObjectPlatformCreate : public CommandObject
32{
33public:
34 CommandObjectPlatformCreate (CommandInterpreter &interpreter) :
35 CommandObject (interpreter,
36 "platform create",
37 "Create a platform instance by name and select it as the current platform.",
38 "platform create <platform-name>",
39 0)
40 {
41 }
42
43 virtual
44 ~CommandObjectPlatformCreate ()
45 {
46 }
47
48 virtual bool
49 Execute (Args& args, CommandReturnObject &result)
50 {
51 Error error;
52 if (args.GetArgumentCount() == 1)
53 {
54 PlatformSP platform_sp (Platform::Create (args.GetArgumentAtIndex (0), error));
55
56 if (platform_sp)
57 {
58 m_interpreter.GetDebugger().GetPlatformList().Append (platform_sp, true);
59 if (m_options.os_version_major != UINT32_MAX)
60 {
61 platform_sp->SetOSVersion (m_options.os_version_major,
62 m_options.os_version_minor,
63 m_options.os_version_update);
64 }
65
66 platform_sp->GetStatus (result.GetOutputStream());
67 }
68 }
69 else
70 {
Greg Clayton24bc5d92011-03-30 18:16:51 +000071 result.AppendError ("platform create takes a platform name as an argument\n");
Greg Claytonb1888f22011-03-19 01:12:21 +000072 result.SetStatus (eReturnStatusFailed);
73 }
74 return result.Succeeded();
75 }
76
77 virtual Options *
78 GetOptions ()
79 {
80 return &m_options;
81 }
82
83protected:
84
85 class CommandOptions : public Options
86 {
87 public:
88
89 CommandOptions () :
90 os_version_major (UINT32_MAX),
91 os_version_minor (UINT32_MAX),
92 os_version_update (UINT32_MAX)
93 {
94 }
95
96 virtual
97 ~CommandOptions ()
98 {
99 }
100
101 virtual Error
102 SetOptionValue (int option_idx, const char *option_arg)
103 {
104 Error error;
105 char short_option = (char) m_getopt_table[option_idx].val;
106
107 switch (short_option)
108 {
109 case 'v':
110 if (Args::StringToVersion (option_arg,
111 os_version_major,
112 os_version_minor,
113 os_version_update) == option_arg)
114 {
115 error.SetErrorStringWithFormat ("invalid version string '%s'", option_arg);
116 }
117 break;
118
119 default:
120 error.SetErrorStringWithFormat ("Unrecognized option '%c'.\n", short_option);
121 break;
122 }
123
124 return error;
125 }
126
127 void
128 ResetOptionValues ()
129 {
130 os_version_major = UINT32_MAX;
131 os_version_minor = UINT32_MAX;
132 os_version_update = UINT32_MAX;
133 }
134
Greg Claytonb3448432011-03-24 21:19:54 +0000135 const OptionDefinition*
Greg Claytonb1888f22011-03-19 01:12:21 +0000136 GetDefinitions ()
137 {
138 return g_option_table;
139 }
140
141 // Options table: Required for subclasses of Options.
142
Greg Claytonb3448432011-03-24 21:19:54 +0000143 static OptionDefinition g_option_table[];
Greg Claytonb1888f22011-03-19 01:12:21 +0000144
145 // Instance variables to hold the values for command options.
146
147 uint32_t os_version_major;
148 uint32_t os_version_minor;
149 uint32_t os_version_update;
150 };
151 CommandOptions m_options;
152};
153
Greg Claytonb3448432011-03-24 21:19:54 +0000154OptionDefinition
Greg Claytonb1888f22011-03-19 01:12:21 +0000155CommandObjectPlatformCreate::CommandOptions::g_option_table[] =
156{
157 { LLDB_OPT_SET_ALL, false, "sdk-version", 'v', required_argument, NULL, 0, eArgTypeNone, "Specify the initial SDK version to use prior to connecting." },
158 { 0, false, NULL, 0, 0, NULL, 0, eArgTypeNone, NULL }
159};
160
161//----------------------------------------------------------------------
162// "platform list"
163//----------------------------------------------------------------------
164class CommandObjectPlatformList : public CommandObject
165{
166public:
167 CommandObjectPlatformList (CommandInterpreter &interpreter) :
168 CommandObject (interpreter,
169 "platform list",
170 "List all platforms that are available.",
171 NULL,
172 0)
173 {
174 }
175
176 virtual
177 ~CommandObjectPlatformList ()
178 {
179 }
180
181 virtual bool
182 Execute (Args& args, CommandReturnObject &result)
183 {
184 Stream &ostrm = result.GetOutputStream();
185 ostrm.Printf("Available platforms:\n");
186
187 PlatformSP host_platform_sp (Platform::GetDefaultPlatform());
188 ostrm.Printf ("%s: %s\n",
189 host_platform_sp->GetShortPluginName(),
190 host_platform_sp->GetDescription());
191
192 uint32_t idx;
193 for (idx = 0; 1; ++idx)
194 {
195 const char *plugin_name = PluginManager::GetPlatformPluginNameAtIndex (idx);
196 if (plugin_name == NULL)
197 break;
198 const char *plugin_desc = PluginManager::GetPlatformPluginDescriptionAtIndex (idx);
199 if (plugin_desc == NULL)
200 break;
201 ostrm.Printf("%s: %s\n", plugin_name, plugin_desc);
202 }
203
204 if (idx == 0)
205 {
Greg Clayton58e26e02011-03-24 04:28:38 +0000206 result.AppendError ("no platforms are available\n");
Greg Claytonb1888f22011-03-19 01:12:21 +0000207 result.SetStatus (eReturnStatusFailed);
208 }
209 return result.Succeeded();
210 }
211};
212
213//----------------------------------------------------------------------
214// "platform status"
215//----------------------------------------------------------------------
216class CommandObjectPlatformStatus : public CommandObject
217{
218public:
219 CommandObjectPlatformStatus (CommandInterpreter &interpreter) :
220 CommandObject (interpreter,
221 "platform status",
222 "Display status for the currently selected platform.",
223 NULL,
224 0)
225 {
226 }
227
228 virtual
229 ~CommandObjectPlatformStatus ()
230 {
231 }
232
233 virtual bool
234 Execute (Args& args, CommandReturnObject &result)
235 {
236 Stream &ostrm = result.GetOutputStream();
237
238 PlatformSP selected_platform_sp (m_interpreter.GetDebugger().GetPlatformList().GetSelectedPlatform());
239 if (selected_platform_sp)
240 {
241 selected_platform_sp->GetStatus (ostrm);
242 result.SetStatus (eReturnStatusSuccessFinishResult);
243 }
244 else
245 {
Greg Clayton58e26e02011-03-24 04:28:38 +0000246 result.AppendError ("no platform us currently selected\n");
Greg Claytonb1888f22011-03-19 01:12:21 +0000247 result.SetStatus (eReturnStatusFailed);
248 }
249 return result.Succeeded();
250 }
251};
252
253
254//----------------------------------------------------------------------
255// "platform select <platform-name>"
256//----------------------------------------------------------------------
257class CommandObjectPlatformSelect : public CommandObject
258{
259public:
260 CommandObjectPlatformSelect (CommandInterpreter &interpreter) :
261 CommandObject (interpreter,
262 "platform select",
263 "Select a platform by name to be the currently selected platform.",
264 "platform select <platform-name>",
265 0)
266 {
267 }
268
269 virtual
270 ~CommandObjectPlatformSelect ()
271 {
272 }
273
274 virtual bool
275 Execute (Args& args, CommandReturnObject &result)
276 {
Greg Clayton58e26e02011-03-24 04:28:38 +0000277 result.AppendError ("command not implemented\n");
Greg Claytonb1888f22011-03-19 01:12:21 +0000278 result.SetStatus (eReturnStatusFailed);
279 return result.Succeeded();
280 }
281};
282
283
Greg Claytoncb8977d2011-03-23 00:09:55 +0000284//----------------------------------------------------------------------
285// "platform connect <connect-url>"
286//----------------------------------------------------------------------
287class CommandObjectPlatformConnect : public CommandObject
288{
289public:
290 CommandObjectPlatformConnect (CommandInterpreter &interpreter) :
291 CommandObject (interpreter,
292 "platform connect",
293 "Connect a platform by name to be the currently selected platform.",
294 "platform connect <connect-url>",
295 0)
296 {
297 }
298
299 virtual
300 ~CommandObjectPlatformConnect ()
301 {
302 }
303
304 virtual bool
305 Execute (Args& args, CommandReturnObject &result)
306 {
307 Stream &ostrm = result.GetOutputStream();
308
Greg Claytoncb8977d2011-03-23 00:09:55 +0000309 PlatformSP selected_platform_sp (m_interpreter.GetDebugger().GetPlatformList().GetSelectedPlatform());
310 if (selected_platform_sp)
311 {
312 Error error (selected_platform_sp->ConnectRemote (args));
313 if (error.Success())
314 {
Greg Claytoncb8977d2011-03-23 00:09:55 +0000315 selected_platform_sp->GetStatus (ostrm);
316 result.SetStatus (eReturnStatusSuccessFinishResult);
317 }
318 else
319 {
Greg Clayton58e26e02011-03-24 04:28:38 +0000320 result.AppendErrorWithFormat ("%s\n", error.AsCString());
Greg Claytoncb8977d2011-03-23 00:09:55 +0000321 result.SetStatus (eReturnStatusFailed);
322 }
323 }
324 else
325 {
Greg Clayton58e26e02011-03-24 04:28:38 +0000326 result.AppendError ("no platform us currently selected\n");
Greg Claytoncb8977d2011-03-23 00:09:55 +0000327 result.SetStatus (eReturnStatusFailed);
328 }
329 return result.Succeeded();
330 }
331};
332
333//----------------------------------------------------------------------
334// "platform disconnect"
335//----------------------------------------------------------------------
336class CommandObjectPlatformDisconnect : public CommandObject
337{
338public:
339 CommandObjectPlatformDisconnect (CommandInterpreter &interpreter) :
340 CommandObject (interpreter,
341 "platform disconnect",
342 "Disconnect a platform by name to be the currently selected platform.",
343 "platform disconnect",
344 0)
345 {
346 }
347
348 virtual
349 ~CommandObjectPlatformDisconnect ()
350 {
351 }
352
353 virtual bool
354 Execute (Args& args, CommandReturnObject &result)
355 {
356 PlatformSP selected_platform_sp (m_interpreter.GetDebugger().GetPlatformList().GetSelectedPlatform());
357 if (selected_platform_sp)
358 {
359 if (args.GetArgumentCount() == 0)
360 {
361 Error error;
362
363 if (selected_platform_sp->IsConnected())
364 {
365 // Cache the instance name if there is one since we are
366 // about to disconnect and the name might go with it.
Greg Clayton58e26e02011-03-24 04:28:38 +0000367 const char *hostname_cstr = selected_platform_sp->GetHostname();
368 std::string hostname;
369 if (hostname_cstr)
370 hostname.assign (hostname_cstr);
Greg Claytoncb8977d2011-03-23 00:09:55 +0000371
372 error = selected_platform_sp->DisconnectRemote ();
373 if (error.Success())
374 {
375 Stream &ostrm = result.GetOutputStream();
Greg Clayton58e26e02011-03-24 04:28:38 +0000376 if (hostname.empty())
Greg Claytoncb8977d2011-03-23 00:09:55 +0000377 ostrm.Printf ("Disconnected from \"%s\"\n", selected_platform_sp->GetShortPluginName());
378 else
Greg Clayton58e26e02011-03-24 04:28:38 +0000379 ostrm.Printf ("Disconnected from \"%s\"\n", hostname.c_str());
Greg Claytoncb8977d2011-03-23 00:09:55 +0000380 result.SetStatus (eReturnStatusSuccessFinishResult);
381 }
382 else
383 {
Greg Clayton58e26e02011-03-24 04:28:38 +0000384 result.AppendErrorWithFormat ("%s", error.AsCString());
Greg Claytoncb8977d2011-03-23 00:09:55 +0000385 result.SetStatus (eReturnStatusFailed);
386 }
387 }
388 else
389 {
390 // Not connected...
Greg Clayton58e26e02011-03-24 04:28:38 +0000391 result.AppendErrorWithFormat ("not connected to '%s'", selected_platform_sp->GetShortPluginName());
Greg Claytoncb8977d2011-03-23 00:09:55 +0000392 result.SetStatus (eReturnStatusFailed);
393 }
394 }
395 else
396 {
397 // Bad args
398 result.AppendError ("\"platform disconnect\" doesn't take any arguments");
399 result.SetStatus (eReturnStatusFailed);
400 }
401 }
402 else
403 {
Greg Clayton58e26e02011-03-24 04:28:38 +0000404 result.AppendError ("no platform is currently selected");
Greg Claytoncb8977d2011-03-23 00:09:55 +0000405 result.SetStatus (eReturnStatusFailed);
406 }
407 return result.Succeeded();
408 }
409};
410
411
Greg Clayton24bc5d92011-03-30 18:16:51 +0000412//----------------------------------------------------------------------
413// "platform process list"
414//----------------------------------------------------------------------
415class CommandObjectPlatformProcessList : public CommandObject
416{
417public:
418 CommandObjectPlatformProcessList (CommandInterpreter &interpreter) :
419 CommandObject (interpreter,
420 "platform process list",
421 "List processes on a remote platform by name, pid, or many other matching attributes.",
422 "platform process list",
423 0)
424 {
425 }
426
427 virtual
428 ~CommandObjectPlatformProcessList ()
429 {
430 }
431
432 virtual bool
433 Execute (Args& args, CommandReturnObject &result)
434 {
435 PlatformSP platform_sp (m_interpreter.GetDebugger().GetPlatformList().GetSelectedPlatform());
436
437 if (platform_sp)
438 {
439 Error error;
440 if (args.GetArgumentCount() == 0)
441 {
442
443 if (platform_sp)
444 {
445 lldb::pid_t pid = m_options.match_info.GetProcessInfo().GetProcessID();
446 if (pid != LLDB_INVALID_PROCESS_ID)
447 {
448 ProcessInfo proc_info;
449 if (platform_sp->GetProcessInfo (pid, proc_info))
450 {
451 proc_info.Dump (result.GetOutputStream(), platform_sp.get());
452 result.SetStatus (eReturnStatusSuccessFinishResult);
453 }
454 else
455 {
456 result.AppendErrorWithFormat ("no process found with pid = %i\n", pid);
457 result.SetStatus (eReturnStatusFailed);
458 }
459 }
460 else
461 {
462 ProcessInfoList proc_infos;
463 const uint32_t matches = platform_sp->FindProcesses (m_options.match_info, proc_infos);
464 if (matches == 0)
465 {
466 const char *match_desc = NULL;
467 const char *match_name = m_options.match_info.GetProcessInfo().GetName();
468 if (match_name && match_name[0])
469 {
470 switch (m_options.match_info.GetNameMatchType())
471 {
472 case eNameMatchIgnore: break;
473 case eNameMatchEquals: match_desc = "match"; break;
474 case eNameMatchContains: match_desc = "contains"; break;
475 case eNameMatchStartsWith: match_desc = "starts with"; break;
476 case eNameMatchEndsWith: match_desc = "end with"; break;
477 case eNameMatchRegularExpression: match_desc = "match the regular expression"; break;
478 }
479 }
480 if (match_desc)
481 result.AppendErrorWithFormat ("no processes were found that %s \"%s\" on the \"%s\" platform\n",
482 match_desc,
483 match_name,
484 platform_sp->GetShortPluginName());
485 else
486 result.AppendErrorWithFormat ("no processes were found on the \"%s\" platform\n", platform_sp->GetShortPluginName());
487 result.SetStatus (eReturnStatusFailed);
488 }
489 else
490 {
491 Stream &ostrm = result.GetOutputStream();
492
493 ProcessInfo::DumpTableHeader (ostrm, platform_sp.get());
494 for (uint32_t i=0; i<matches; ++i)
495 {
496 proc_infos.GetProcessInfoAtIndex(i).DumpAsTableRow(ostrm, platform_sp.get());
497 }
498 }
499 }
500 }
501 }
502 else
503 {
504 result.AppendError ("invalid args: process list takes only options\n");
505 result.SetStatus (eReturnStatusFailed);
506 }
507 }
508 else
509 {
510 result.AppendError ("no platform is selected\n");
511 result.SetStatus (eReturnStatusFailed);
512 }
513 return result.Succeeded();
514 }
515
516 virtual Options *
517 GetOptions ()
518 {
519 return &m_options;
520 }
521
522protected:
523
524 class CommandOptions : public Options
525 {
526 public:
527
528 CommandOptions () :
529 match_info ()
530 {
531 }
532
533 virtual
534 ~CommandOptions ()
535 {
536 }
537
538 virtual Error
539 SetOptionValue (int option_idx, const char *option_arg)
540 {
541 Error error;
542 char short_option = (char) m_getopt_table[option_idx].val;
543 bool success = false;
544
545 switch (short_option)
546 {
547 case 'p':
548 match_info.GetProcessInfo().SetProcessID (Args::StringToUInt32 (option_arg, LLDB_INVALID_PROCESS_ID, 0, &success));
549 if (!success)
550 error.SetErrorStringWithFormat("invalid process ID string: '%s'", option_arg);
551 break;
552
553 case 'P':
554 match_info.GetProcessInfo().SetParentProcessID (Args::StringToUInt32 (option_arg, LLDB_INVALID_PROCESS_ID, 0, &success));
555 if (!success)
556 error.SetErrorStringWithFormat("invalid parent process ID string: '%s'", option_arg);
557 break;
558
559 case 'u':
560 match_info.GetProcessInfo().SetRealUserID (Args::StringToUInt32 (option_arg, UINT32_MAX, 0, &success));
561 if (!success)
562 error.SetErrorStringWithFormat("invalid user ID string: '%s'", option_arg);
563 break;
564
565 case 'U':
566 match_info.GetProcessInfo().SetEffectiveUserID (Args::StringToUInt32 (option_arg, UINT32_MAX, 0, &success));
567 if (!success)
568 error.SetErrorStringWithFormat("invalid effective user ID string: '%s'", option_arg);
569 break;
570
571 case 'g':
572 match_info.GetProcessInfo().SetRealGroupID (Args::StringToUInt32 (option_arg, UINT32_MAX, 0, &success));
573 if (!success)
574 error.SetErrorStringWithFormat("invalid group ID string: '%s'", option_arg);
575 break;
576
577 case 'G':
578 match_info.GetProcessInfo().SetEffectiveGroupID (Args::StringToUInt32 (option_arg, UINT32_MAX, 0, &success));
579 if (!success)
580 error.SetErrorStringWithFormat("invalid effective group ID string: '%s'", option_arg);
581 break;
582
583 case 'a':
584 match_info.GetProcessInfo().GetArchitecture().SetTriple (option_arg);
585 break;
586
587 case 'n':
588 match_info.GetProcessInfo().SetName (option_arg);
589 if (match_info.GetNameMatchType() == eNameMatchIgnore)
590 match_info.SetNameMatchType (eNameMatchEquals);
591 break;
592
593 case 'e':
594 match_info.SetNameMatchType (eNameMatchEndsWith);
595 break;
596
597 case 's':
598 match_info.SetNameMatchType (eNameMatchStartsWith);
599 break;
600
601 case 'c':
602 match_info.SetNameMatchType (eNameMatchContains);
603 break;
604
605 case 'r':
606 match_info.SetNameMatchType (eNameMatchRegularExpression);
607 break;
608
609 default:
610 error.SetErrorStringWithFormat ("unrecognized option '%c'", short_option);
611 break;
612 }
613
614 return error;
615 }
616
617 void
618 ResetOptionValues ()
619 {
620 match_info.Clear();
621 }
622
623 const OptionDefinition*
624 GetDefinitions ()
625 {
626 return g_option_table;
627 }
628
629 // Options table: Required for subclasses of Options.
630
631 static OptionDefinition g_option_table[];
632
633 // Instance variables to hold the values for command options.
634
635 ProcessInfoMatch match_info;
636 };
637 CommandOptions m_options;
638};
639
640OptionDefinition
641CommandObjectPlatformProcessList::CommandOptions::g_option_table[] =
642{
643{ LLDB_OPT_SET_1, false, "pid" , 'p', required_argument, NULL, 0, eArgTypePid , "List the process info for a specific process ID." },
644{ LLDB_OPT_SET_2|
645 LLDB_OPT_SET_3|
646 LLDB_OPT_SET_4|
647 LLDB_OPT_SET_5, true , "name" , 'n', required_argument, NULL, 0, eArgTypeProcessName , "Find processes that match the supplied name." },
648{ LLDB_OPT_SET_2, false, "ends-with" , 'e', no_argument , NULL, 0, eArgTypeNone , "Process names must end with the name supplied with the --name option." },
649{ LLDB_OPT_SET_3, false, "starts-with" , 's', no_argument , NULL, 0, eArgTypeNone , "Process names must start with the name supplied with the --name option." },
650{ LLDB_OPT_SET_4, false, "contains" , 'c', no_argument , NULL, 0, eArgTypeNone , "Process names must contain the name supplied with the --name option." },
651{ LLDB_OPT_SET_5, false, "regex" , 'r', no_argument , NULL, 0, eArgTypeNone , "Process names must match name supplied with the --name option as a regular expression." },
652{ LLDB_OPT_SET_2|
653 LLDB_OPT_SET_3|
654 LLDB_OPT_SET_4|
655 LLDB_OPT_SET_5|
656 LLDB_OPT_SET_6, false, "parent" , 'P', required_argument, NULL, 0, eArgTypePid , "Find processes that have a matching parent process ID." },
657{ LLDB_OPT_SET_2|
658 LLDB_OPT_SET_3|
659 LLDB_OPT_SET_4|
660 LLDB_OPT_SET_5|
661 LLDB_OPT_SET_6, false, "uid" , 'u', required_argument, NULL, 0, eArgTypeNone , "Find processes that have a matching user ID." },
662{ LLDB_OPT_SET_2|
663 LLDB_OPT_SET_3|
664 LLDB_OPT_SET_4|
665 LLDB_OPT_SET_5|
666 LLDB_OPT_SET_6, false, "euid" , 'U', required_argument, NULL, 0, eArgTypeNone , "Find processes that have a matching effective user ID." },
667{ LLDB_OPT_SET_2|
668 LLDB_OPT_SET_3|
669 LLDB_OPT_SET_4|
670 LLDB_OPT_SET_5|
671 LLDB_OPT_SET_6, false, "gid" , 'g', required_argument, NULL, 0, eArgTypeNone , "Find processes that have a matching group ID." },
672{ LLDB_OPT_SET_2|
673 LLDB_OPT_SET_3|
674 LLDB_OPT_SET_4|
675 LLDB_OPT_SET_5|
676 LLDB_OPT_SET_6, false, "egid" , 'G', required_argument, NULL, 0, eArgTypeNone , "Find processes that have a matching effective group ID." },
677{ LLDB_OPT_SET_2|
678 LLDB_OPT_SET_3|
679 LLDB_OPT_SET_4|
680 LLDB_OPT_SET_5|
681 LLDB_OPT_SET_6, false, "arch" , 'a', required_argument, NULL, 0, eArgTypeArchitecture , "Find processes that have a matching architecture." },
682{ 0 , false, NULL , 0 , 0 , NULL, 0, eArgTypeNone , NULL }
683};
684
685class CommandObjectPlatformProcess : public CommandObjectMultiword
686{
687public:
688 //------------------------------------------------------------------
689 // Constructors and Destructors
690 //------------------------------------------------------------------
691 CommandObjectPlatformProcess (CommandInterpreter &interpreter) :
692 CommandObjectMultiword (interpreter,
693 "platform process",
694 "A set of commands to query, launch and attach to platform processes",
695 "platform process [attach|launch|list] ...")
696 {
697// LoadSubCommand ("attach", CommandObjectSP (new CommandObjectPlatformProcessAttach (interpreter)));
698// LoadSubCommand ("launch", CommandObjectSP (new CommandObjectPlatformProcessLaunch (interpreter)));
699 LoadSubCommand ("list" , CommandObjectSP (new CommandObjectPlatformProcessList (interpreter)));
700
701 }
702
703 virtual
704 ~CommandObjectPlatformProcess ()
705 {
706 }
707
708private:
709 //------------------------------------------------------------------
710 // For CommandObjectPlatform only
711 //------------------------------------------------------------------
712 DISALLOW_COPY_AND_ASSIGN (CommandObjectPlatformProcess);
713};
Greg Claytonb1888f22011-03-19 01:12:21 +0000714
715//----------------------------------------------------------------------
716// CommandObjectPlatform constructor
717//----------------------------------------------------------------------
718CommandObjectPlatform::CommandObjectPlatform(CommandInterpreter &interpreter) :
719 CommandObjectMultiword (interpreter,
720 "platform",
721 "A set of commands to manage and create platforms.",
Greg Claytoncb8977d2011-03-23 00:09:55 +0000722 "platform [connect|create|disconnect|list|status|select] ...")
Greg Claytonb1888f22011-03-19 01:12:21 +0000723{
724 LoadSubCommand ("create", CommandObjectSP (new CommandObjectPlatformCreate (interpreter)));
725 LoadSubCommand ("list" , CommandObjectSP (new CommandObjectPlatformList (interpreter)));
726 LoadSubCommand ("select", CommandObjectSP (new CommandObjectPlatformSelect (interpreter)));
727 LoadSubCommand ("status", CommandObjectSP (new CommandObjectPlatformStatus (interpreter)));
Greg Claytoncb8977d2011-03-23 00:09:55 +0000728 LoadSubCommand ("connect", CommandObjectSP (new CommandObjectPlatformConnect (interpreter)));
729 LoadSubCommand ("disconnect", CommandObjectSP (new CommandObjectPlatformDisconnect (interpreter)));
Greg Clayton24bc5d92011-03-30 18:16:51 +0000730 LoadSubCommand ("process", CommandObjectSP (new CommandObjectPlatformProcess (interpreter)));
Greg Claytonb1888f22011-03-19 01:12:21 +0000731}
732
733
734//----------------------------------------------------------------------
735// Destructor
736//----------------------------------------------------------------------
737CommandObjectPlatform::~CommandObjectPlatform()
738{
739}