summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter/ScriptInterpreter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-06-08 16:52:24 +0000
committerChris Lattner <sabre@nondot.org>2010-06-08 16:52:24 +0000
commit30fdc8d841c9d24ac5f3d452b6ece84ee0ac991c (patch)
treef70013106f6a461a14abcd71c65f48a95a2979a6 /lldb/source/Interpreter/ScriptInterpreter.cpp
parent312c4c799da215b337f790fda330f70c4aa757cf (diff)
downloadbcm5719-llvm-30fdc8d841c9d24ac5f3d452b6ece84ee0ac991c.tar.gz
bcm5719-llvm-30fdc8d841c9d24ac5f3d452b6ece84ee0ac991c.zip
Initial checkin of lldb code from internal Apple repo.
llvm-svn: 105619
Diffstat (limited to 'lldb/source/Interpreter/ScriptInterpreter.cpp')
-rw-r--r--lldb/source/Interpreter/ScriptInterpreter.cpp66
1 files changed, 66 insertions, 0 deletions
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 <string>
+#include <stdlib.h>
+#include <stdio.h>
+
+#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.");
+}
+
+
OpenPOWER on IntegriCloud