summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter/ScriptInterpreter.cpp
blob: 9c5c086bfa3c0ceba36dcbfc21e04140f226f2a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
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 "lldb/Utility/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 
(
    CommandInterpreter &interpreter,
    BreakpointOptions *bp_options,
    CommandReturnObject &result
)
{
    result.SetStatus (eReturnStatusFailed);
    result.AppendError ("ScriptInterpreter::GetScriptCommands(StringList &) is not implemented.");
}


OpenPOWER on IntegriCloud