blob: f3ef2d94a15ff4a489f284d0f0f8bbe01aee2887 [file] [log] [blame]
Chris Lattner24943d22010-06-08 16:52:24 +00001//===-- CommandObjectFile.h -------------------------------------*- 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#ifndef liblldb_CommandObjectFile_h_
11#define liblldb_CommandObjectFile_h_
12
13// C Includes
14// C++ Includes
Greg Clayton143fcc32011-04-13 00:18:08 +000015#include <vector>
Chris Lattner24943d22010-06-08 16:52:24 +000016// Other libraries and framework includes
17// Project includes
Jim Ingham84cdc152010-06-15 19:49:27 +000018#include "lldb/Interpreter/Options.h"
Chris Lattner24943d22010-06-08 16:52:24 +000019#include "lldb/Core/ArchSpec.h"
20#include "lldb/Interpreter/CommandObject.h"
Greg Clayton143fcc32011-04-13 00:18:08 +000021#include "CommandObjectPlatform.h"
Chris Lattner24943d22010-06-08 16:52:24 +000022
23namespace lldb_private {
24
25//-------------------------------------------------------------------------
26// CommandObjectFile
27//-------------------------------------------------------------------------
28
Greg Clayton5e342f52011-04-13 22:47:15 +000029class FileOptionGroup : public OptionGroup
30{
31public:
32
33 FileOptionGroup ();
34
35 virtual
36 ~FileOptionGroup ();
Greg Clayton143fcc32011-04-13 00:18:08 +000037
Greg Clayton5e342f52011-04-13 22:47:15 +000038
39 virtual uint32_t
40 GetNumDefinitions ();
41
42 virtual const OptionDefinition*
43 GetDefinitions ();
44
45 virtual Error
46 SetOptionValue (CommandInterpreter &interpreter,
47 uint32_t option_idx,
48 const char *option_value);
49
50 virtual void
51 OptionParsingStarting (CommandInterpreter &interpreter);
52
53 bool
54 GetArchitecture (Platform *platform, ArchSpec &arch);
55
56 std::string m_arch_str; // Save the arch triple in case a platform is specified after the architecture
57};
Greg Clayton143fcc32011-04-13 00:18:08 +000058
Chris Lattner24943d22010-06-08 16:52:24 +000059class CommandObjectFile : public CommandObject
60{
61public:
62
Greg Clayton238c0a12010-09-18 01:14:36 +000063 CommandObjectFile (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +000064
65 virtual
66 ~CommandObjectFile ();
67
68 virtual bool
Greg Clayton238c0a12010-09-18 01:14:36 +000069 Execute (Args& command,
Chris Lattner24943d22010-06-08 16:52:24 +000070 CommandReturnObject &result);
71
72 virtual Options *
73 GetOptions ();
74
Jim Ingham802f8b02010-06-30 05:02:46 +000075
76 virtual int
Greg Clayton238c0a12010-09-18 01:14:36 +000077 HandleArgumentCompletion (Args &input,
Jim Ingham802f8b02010-06-30 05:02:46 +000078 int &cursor_index,
79 int &cursor_char_position,
80 OptionElementVector &opt_element_vector,
81 int match_start_point,
82 int max_return_elements,
83 bool &word_complete,
84 StringList &matches);
85
Chris Lattner24943d22010-06-08 16:52:24 +000086
87private:
Greg Clayton143fcc32011-04-13 00:18:08 +000088 OptionGroupOptions m_option_group;
89 FileOptionGroup m_file_options;
90 PlatformOptionGroup m_platform_options;
Chris Lattner24943d22010-06-08 16:52:24 +000091};
92
93} // namespace lldb_private
94
95#endif // liblldb_CommandObjectFile_h_