1 //===-- CommandObjectGUI.cpp ------------------------------------*- 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 #include "lldb/lldb-python.h"
12 #include "CommandObjectGUI.h"
16 // Other libraries and framework includes
18 #include "lldb/lldb-private.h"
19 #include "lldb/Interpreter/CommandInterpreter.h"
20 #include "lldb/Interpreter/CommandReturnObject.h"
23 using namespace lldb_private;
25 //-------------------------------------------------------------------------
27 //-------------------------------------------------------------------------
29 CommandObjectGUI::CommandObjectGUI (CommandInterpreter &interpreter) :
30 CommandObjectParsed (interpreter, "gui", "Switch into the curses based GUI mode.", "gui")
34 CommandObjectGUI::~CommandObjectGUI ()
39 CommandObjectGUI::DoExecute (Args& args, CommandReturnObject &result)
41 #ifndef LLDB_DISABLE_CURSES
42 if (args.GetArgumentCount() == 0)
44 Debugger &debugger = m_interpreter.GetDebugger();
45 IOHandlerSP io_handler_sp (new IOHandlerCursesGUI (debugger));
47 debugger.PushIOHandler(io_handler_sp);
48 result.SetStatus (eReturnStatusSuccessFinishResult);
52 result.AppendError("the gui command takes no arguments.");
53 result.SetStatus (eReturnStatusFailed);
57 result.AppendError("lldb was not build with gui support");