From d61b076ede88b56f3372a55e7d1eac6a9d717120 Mon Sep 17 00:00:00 2001 From: emaste <emaste@FreeBSD.org> Date: Mon, 9 Feb 2015 01:44:09 +0000 Subject: Import LLDB as of upstream SVN 228549 (git 39760838) --- source/Commands/CommandObjectGUI.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'source/Commands/CommandObjectGUI.cpp') diff --git a/source/Commands/CommandObjectGUI.cpp b/source/Commands/CommandObjectGUI.cpp index 3d05335..359d6d2 100644 --- a/source/Commands/CommandObjectGUI.cpp +++ b/source/Commands/CommandObjectGUI.cpp @@ -42,10 +42,22 @@ CommandObjectGUI::DoExecute (Args& args, CommandReturnObject &result) if (args.GetArgumentCount() == 0) { Debugger &debugger = m_interpreter.GetDebugger(); - IOHandlerSP io_handler_sp (new IOHandlerCursesGUI (debugger)); - if (io_handler_sp) - debugger.PushIOHandler(io_handler_sp); - result.SetStatus (eReturnStatusSuccessFinishResult); + + lldb::StreamFileSP input_sp = debugger.GetInputFile(); + if (input_sp && + input_sp->GetFile().GetIsRealTerminal() && + input_sp->GetFile().GetIsInteractive()) + { + IOHandlerSP io_handler_sp (new IOHandlerCursesGUI (debugger)); + if (io_handler_sp) + debugger.PushIOHandler(io_handler_sp); + result.SetStatus (eReturnStatusSuccessFinishResult); + } + else + { + result.AppendError("the gui command requires an interactive terminal."); + result.SetStatus (eReturnStatusFailed); + } } else { -- cgit v1.1