LLDB mainline
LuaState.h
Go to the documentation of this file.
1//===----------------------------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_LUA_LUASTATE_H
10#define LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_LUA_LUASTATE_H
11
13#include "lldb/lldb-types.h"
14#include "llvm/ADT/StringRef.h"
15#include "llvm/Support/Error.h"
16
17#include "lua.hpp"
18
19namespace lldb_private {
20
21extern "C" {
22int luaopen_lldb(lua_State *L);
23}
24
25class LuaState {
26public:
27 LuaState();
28 ~LuaState();
29
30 llvm::Error Run(llvm::StringRef buffer);
31 llvm::Error RegisterBreakpointCallback(void *baton, const char *body);
32 llvm::Expected<bool>
33 CallBreakpointCallback(void *baton, lldb::StackFrameSP stop_frame_sp,
35 StructuredData::ObjectSP extra_args_sp);
36 llvm::Error RegisterWatchpointCallback(void *baton, const char *body);
37 llvm::Expected<bool> CallWatchpointCallback(void *baton,
38 lldb::StackFrameSP stop_frame_sp,
39 lldb::WatchpointSP wp_sp);
40 llvm::Error LoadModule(llvm::StringRef filename);
41 llvm::Error CheckSyntax(llvm::StringRef buffer);
42 llvm::Error ChangeIO(FILE *out, FILE *err);
43
44private:
45 lua_State *m_lua_state;
46};
47
48} // namespace lldb_private
49
50#endif // LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_LUA_LUA_H
lua_State * m_lua_state
Definition LuaState.h:45
llvm::Error LoadModule(llvm::StringRef filename)
Definition LuaState.cpp:135
llvm::Expected< bool > CallBreakpointCallback(void *baton, lldb::StackFrameSP stop_frame_sp, lldb::BreakpointLocationSP bp_loc_sp, StructuredData::ObjectSP extra_args_sp)
Definition LuaState.cpp:80
llvm::Expected< bool > CallWatchpointCallback(void *baton, lldb::StackFrameSP stop_frame_sp, lldb::WatchpointSP wp_sp)
Definition LuaState.cpp:109
llvm::Error RegisterWatchpointCallback(void *baton, const char *body)
Definition LuaState.cpp:91
llvm::Error CheckSyntax(llvm::StringRef buffer)
Definition LuaState.cpp:118
llvm::Error Run(llvm::StringRef buffer)
Definition LuaState.cpp:47
llvm::Error ChangeIO(FILE *out, FILE *err)
Definition LuaState.cpp:163
llvm::Error RegisterBreakpointCallback(void *baton, const char *body)
Definition LuaState.cpp:62
std::shared_ptr< Object > ObjectSP
A class that represents a running process on the host machine.
int luaopen_lldb(lua_State *L)
std::shared_ptr< lldb_private::StackFrame > StackFrameSP
std::shared_ptr< lldb_private::BreakpointLocation > BreakpointLocationSP
std::shared_ptr< lldb_private::Watchpoint > WatchpointSP