1 //===-- Driver.h ------------------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef lldb_Driver_h_
11 #define lldb_Driver_h_
14 #include "lldb/Utility/PseudoTerminal.h"
21 #include "lldb/API/SBDefines.h"
22 #include "lldb/API/SBBroadcaster.h"
23 #include "lldb/API/SBDebugger.h"
24 #include "lldb/API/SBError.h"
28 class Driver : public lldb::SBBroadcaster
31 typedef enum CommandPlacement
33 eCommandPlacementBeforeFile,
34 eCommandPlacementAfterFile,
35 eCommandPlacementAfterCrash,
47 ParseArgs (int argc, const char *argv[], FILE *out_fh, bool &do_exit);
53 GetCrashLogFilename() const;
59 GetScriptLanguage() const;
62 WriteCommandsForSourcing (CommandPlacement placement, lldb::SBStream &strm);
78 AddInitialCommand (const char *command, CommandPlacement placement, bool is_file, lldb::SBError &error);
80 //static OptionDefinition m_cmd_option_table[];
82 struct InitialCmdEntry
84 InitialCmdEntry (const char *in_contents, bool in_is_file, bool in_quiet = false) :
85 contents (in_contents),
87 source_quietly(in_quiet)
95 std::vector<std::string> m_args;
96 lldb::ScriptLanguage m_script_lang;
97 std::string m_core_file;
98 std::string m_crash_log;
99 std::vector<InitialCmdEntry> m_initial_commands;
100 std::vector<InitialCmdEntry> m_after_file_commands;
101 std::vector<InitialCmdEntry> m_after_crash_commands;
103 bool m_source_quietly;
104 bool m_print_version;
105 bool m_print_python_path;
108 std::string m_process_name;
109 lldb::pid_t m_process_pid;
110 bool m_use_external_editor; // FIXME: When we have set/show variables we can remove this from here.
112 typedef std::set<char> OptionSet;
113 OptionSet m_seen_options;
118 SetOptionValue (int option_idx,
119 const char *option_arg,
120 Driver::OptionData &data);
130 ResizeWindow (unsigned short col);
133 lldb::SBDebugger m_debugger;
134 OptionData m_option_data;
137 ResetOptionValues ();
143 #endif // lldb_Driver_h_