LLDB mainline
Lua.h
Go to the documentation of this file.
1//===-- ScriptInterpreterLua.h ----------------------------------*- C++ -*-===//
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 liblldb_Lua_h_
10#define liblldb_Lua_h_
11
13#include "lldb/API/SBFrame.h"
15#include "lldb/lldb-types.h"
16#include "llvm/ADT/StringRef.h"
17#include "llvm/Support/Error.h"
18
19#include "lua.hpp"
20
21#include <mutex>
22
23namespace lldb_private {
24
25extern "C" {
26int luaopen_lldb(lua_State *L);
27}
28
29class Lua {
30public:
31 Lua();
32 ~Lua();
33
34 llvm::Error Run(llvm::StringRef buffer);
35 llvm::Error RegisterBreakpointCallback(void *baton, const char *body);
36 llvm::Expected<bool>
37 CallBreakpointCallback(void *baton, lldb::StackFrameSP stop_frame_sp,
39 StructuredData::ObjectSP extra_args_sp);
40 llvm::Error RegisterWatchpointCallback(void *baton, const char *body);
41 llvm::Expected<bool> CallWatchpointCallback(void *baton,
42 lldb::StackFrameSP stop_frame_sp,
43 lldb::WatchpointSP wp_sp);
44 llvm::Error LoadModule(llvm::StringRef filename);
45 llvm::Error CheckSyntax(llvm::StringRef buffer);
46 llvm::Error ChangeIO(FILE *out, FILE *err);
47
48private:
49 lua_State *m_lua_state;
50};
51
52} // namespace lldb_private
53
54#endif // liblldb_Lua_h_
llvm::Expected< bool > CallWatchpointCallback(void *baton, lldb::StackFrameSP stop_frame_sp, lldb::WatchpointSP wp_sp)
Definition: Lua.cpp:107
llvm::Error RegisterBreakpointCallback(void *baton, const char *body)
Definition: Lua.cpp:62
llvm::Error CheckSyntax(llvm::StringRef buffer)
Definition: Lua.cpp:116
llvm::Error ChangeIO(FILE *out, FILE *err)
Definition: Lua.cpp:161
llvm::Error LoadModule(llvm::StringRef filename)
Definition: Lua.cpp:133
llvm::Error Run(llvm::StringRef buffer)
Definition: Lua.cpp:47
llvm::Expected< bool > CallBreakpointCallback(void *baton, lldb::StackFrameSP stop_frame_sp, lldb::BreakpointLocationSP bp_loc_sp, StructuredData::ObjectSP extra_args_sp)
Definition: Lua.cpp:79
llvm::Error RegisterWatchpointCallback(void *baton, const char *body)
Definition: Lua.cpp:90
lua_State * m_lua_state
Definition: Lua.h:49
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
Definition: lldb-forward.h:420
std::shared_ptr< lldb_private::BreakpointLocation > BreakpointLocationSP
Definition: lldb-forward.h:322
std::shared_ptr< lldb_private::Watchpoint > WatchpointSP
Definition: lldb-forward.h:485