From 30fdc8d841c9d24ac5f3d452b6ece84ee0ac991c Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 8 Jun 2010 16:52:24 +0000 Subject: Initial checkin of lldb code from internal Apple repo. llvm-svn: 105619 --- lldb/source/Interpreter/ScriptInterpreter.cpp | 66 +++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 lldb/source/Interpreter/ScriptInterpreter.cpp (limited to 'lldb/source/Interpreter/ScriptInterpreter.cpp') diff --git a/lldb/source/Interpreter/ScriptInterpreter.cpp b/lldb/source/Interpreter/ScriptInterpreter.cpp new file mode 100644 index 00000000000..fa3ac31e691 --- /dev/null +++ b/lldb/source/Interpreter/ScriptInterpreter.cpp @@ -0,0 +1,66 @@ +//===-- ScriptInterpreter.cpp -----------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "lldb/Interpreter/ScriptInterpreter.h" + +#include +#include +#include + +#include "lldb/Core/Error.h" +#include "lldb/Core/Stream.h" +#include "lldb/Core/StringList.h" +#include "lldb/Interpreter/CommandReturnObject.h" + +#include "PseudoTerminal.h" + +using namespace lldb; +using namespace lldb_private; + +ScriptInterpreter::ScriptInterpreter (ScriptLanguage script_lang) : + m_script_lang (script_lang), + m_interpreter_pty () +{ + if (m_interpreter_pty.OpenFirstAvailableMaster (O_RDWR|O_NOCTTY, NULL, 0)) + { + const char *slave_name = m_interpreter_pty.GetSlaveName(NULL, 0); + if (slave_name) + m_pty_slave_name.assign(slave_name); + } +} + +ScriptInterpreter::~ScriptInterpreter () +{ + m_interpreter_pty.CloseMasterFileDescriptor(); +} + +const char * +ScriptInterpreter::GetScriptInterpreterPtyName () +{ + return m_pty_slave_name.c_str(); +} + +int +ScriptInterpreter::GetMasterFileDescriptor () +{ + return m_interpreter_pty.GetMasterFileDescriptor(); +} + +void +ScriptInterpreter::CollectDataForBreakpointCommandCallback +( + BreakpointOptions *bp_options, + CommandReturnObject &result +) +{ + result.SetStatus (eReturnStatusFailed); + result.AppendError ("ScriptInterpreter::GetScriptCommands(StringList &) is not implemented."); +} + + -- cgit v1.2.3