2010-06-09 00:52:24 +08:00
|
|
|
//===-- Driver.h ------------------------------------------------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef lldb_Driver_h_
|
|
|
|
#define lldb_Driver_h_
|
|
|
|
|
2013-10-15 23:46:40 +08:00
|
|
|
#include "Platform.h"
|
2010-06-10 05:28:42 +08:00
|
|
|
#include "lldb/Utility/PseudoTerminal.h"
|
2010-06-09 00:52:24 +08:00
|
|
|
|
|
|
|
#include <set>
|
|
|
|
#include <bitset>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
2010-06-09 14:50:29 +08:00
|
|
|
#include "lldb/API/SBDefines.h"
|
|
|
|
#include "lldb/API/SBBroadcaster.h"
|
2010-06-23 09:19:29 +08:00
|
|
|
#include "lldb/API/SBDebugger.h"
|
2010-06-09 14:50:29 +08:00
|
|
|
#include "lldb/API/SBError.h"
|
2010-06-09 00:52:24 +08:00
|
|
|
|
|
|
|
class IOChannel;
|
|
|
|
|
|
|
|
class Driver : public lldb::SBBroadcaster
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Driver ();
|
|
|
|
|
|
|
|
virtual
|
|
|
|
~Driver ();
|
|
|
|
|
|
|
|
void
|
|
|
|
MainLoop ();
|
|
|
|
|
2010-06-23 09:19:29 +08:00
|
|
|
lldb::SBError
|
|
|
|
ParseArgs (int argc, const char *argv[], FILE *out_fh, bool &do_exit);
|
2010-06-09 00:52:24 +08:00
|
|
|
|
|
|
|
const char *
|
|
|
|
GetFilename() const;
|
|
|
|
|
|
|
|
const char *
|
|
|
|
GetCrashLogFilename() const;
|
|
|
|
|
|
|
|
const char *
|
|
|
|
GetArchName() const;
|
|
|
|
|
|
|
|
lldb::ScriptLanguage
|
|
|
|
GetScriptLanguage() const;
|
|
|
|
|
2013-09-14 08:20:24 +08:00
|
|
|
void
|
2014-07-31 01:38:47 +08:00
|
|
|
WriteInitialCommands (bool before_file, lldb::SBStream &strm);
|
2013-09-14 08:20:24 +08:00
|
|
|
|
2010-06-09 00:52:24 +08:00
|
|
|
bool
|
|
|
|
GetDebugMode() const;
|
|
|
|
|
|
|
|
|
|
|
|
class OptionData
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
OptionData ();
|
|
|
|
~OptionData ();
|
|
|
|
|
|
|
|
void
|
|
|
|
Clear();
|
|
|
|
|
2013-09-14 08:20:24 +08:00
|
|
|
void
|
|
|
|
AddInitialCommand (const char *command, bool before_file, bool is_file, lldb::SBError &error);
|
|
|
|
|
2011-03-25 05:19:54 +08:00
|
|
|
//static OptionDefinition m_cmd_option_table[];
|
2010-06-09 00:52:24 +08:00
|
|
|
|
2010-12-09 06:23:24 +08:00
|
|
|
std::vector<std::string> m_args;
|
2010-06-09 00:52:24 +08:00
|
|
|
lldb::ScriptLanguage m_script_lang;
|
2012-08-16 06:10:42 +08:00
|
|
|
std::string m_core_file;
|
2010-06-09 00:52:24 +08:00
|
|
|
std::string m_crash_log;
|
2013-09-14 08:20:24 +08:00
|
|
|
std::vector<std::pair<bool,std::string> > m_initial_commands;
|
|
|
|
std::vector<std::pair<bool,std::string> > m_after_file_commands;
|
2010-06-09 00:52:24 +08:00
|
|
|
bool m_debug_mode;
|
2013-09-14 08:20:24 +08:00
|
|
|
bool m_source_quietly;
|
2010-06-09 00:52:24 +08:00
|
|
|
bool m_print_version;
|
2012-12-22 06:22:26 +08:00
|
|
|
bool m_print_python_path;
|
2010-06-09 00:52:24 +08:00
|
|
|
bool m_print_help;
|
2011-09-14 07:25:31 +08:00
|
|
|
bool m_wait_for;
|
|
|
|
std::string m_process_name;
|
|
|
|
lldb::pid_t m_process_pid;
|
2010-08-31 03:44:40 +08:00
|
|
|
bool m_use_external_editor; // FIXME: When we have set/show variables we can remove this from here.
|
2010-06-09 00:52:24 +08:00
|
|
|
typedef std::set<char> OptionSet;
|
|
|
|
OptionSet m_seen_options;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static lldb::SBError
|
|
|
|
SetOptionValue (int option_idx,
|
|
|
|
const char *option_arg,
|
|
|
|
Driver::OptionData &data);
|
|
|
|
|
|
|
|
|
2010-06-23 09:19:29 +08:00
|
|
|
lldb::SBDebugger &
|
|
|
|
GetDebugger()
|
|
|
|
{
|
|
|
|
return m_debugger;
|
|
|
|
}
|
2011-05-10 07:06:58 +08:00
|
|
|
|
2013-02-23 06:56:55 +08:00
|
|
|
void
|
|
|
|
ResizeWindow (unsigned short col);
|
2012-02-29 12:21:24 +08:00
|
|
|
|
2010-06-09 00:52:24 +08:00
|
|
|
private:
|
2010-06-23 09:19:29 +08:00
|
|
|
lldb::SBDebugger m_debugger;
|
2010-06-09 00:52:24 +08:00
|
|
|
OptionData m_option_data;
|
|
|
|
|
|
|
|
void
|
|
|
|
ResetOptionValues ();
|
|
|
|
|
|
|
|
void
|
|
|
|
ReadyForCommand ();
|
|
|
|
};
|
|
|
|
|
2010-06-09 17:50:17 +08:00
|
|
|
#endif // lldb_Driver_h_
|