CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
119 lines
4.4 KiB
C++
119 lines
4.4 KiB
C++
//===-- ScriptInterpreterLua.h ----------------------------------*- C++ -*-===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_LUA_SCRIPTINTERPRETERLUA_H
|
|
#define LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_LUA_SCRIPTINTERPRETERLUA_H
|
|
|
|
#include <vector>
|
|
|
|
#include "lldb/Breakpoint/WatchpointOptions.h"
|
|
#include "lldb/Core/StructuredDataImpl.h"
|
|
#include "lldb/Interpreter/ScriptInterpreter.h"
|
|
#include "lldb/Utility/Status.h"
|
|
#include "lldb/lldb-enumerations.h"
|
|
|
|
namespace lldb_private {
|
|
class LuaState;
|
|
class ScriptInterpreterLua : public ScriptInterpreter {
|
|
public:
|
|
class CommandDataLua : public BreakpointOptions::CommandData {
|
|
public:
|
|
CommandDataLua() : BreakpointOptions::CommandData() {
|
|
interpreter = lldb::eScriptLanguageLua;
|
|
}
|
|
CommandDataLua(StructuredData::ObjectSP extra_args_sp)
|
|
: BreakpointOptions::CommandData(), m_extra_args_sp(extra_args_sp) {
|
|
interpreter = lldb::eScriptLanguageLua;
|
|
}
|
|
StructuredData::ObjectSP m_extra_args_sp;
|
|
};
|
|
|
|
ScriptInterpreterLua(Debugger &debugger);
|
|
|
|
~ScriptInterpreterLua() override;
|
|
|
|
bool ExecuteOneLine(
|
|
llvm::StringRef command, CommandReturnObject *result,
|
|
const ExecuteScriptOptions &options = ExecuteScriptOptions()) override;
|
|
|
|
void ExecuteInterpreterLoop() override;
|
|
|
|
bool LoadScriptingModule(const char *filename,
|
|
const LoadScriptOptions &options,
|
|
lldb_private::Status &error,
|
|
StructuredData::ObjectSP *module_sp = nullptr,
|
|
FileSpec extra_search_dir = {},
|
|
lldb::TargetSP loaded_into_target_sp = {}) override;
|
|
|
|
StructuredData::DictionarySP GetInterpreterInfo() override;
|
|
|
|
// Static Functions
|
|
static void Initialize();
|
|
|
|
static void Terminate();
|
|
|
|
static lldb::ScriptInterpreterSP CreateInstance(Debugger &debugger);
|
|
|
|
static llvm::StringRef GetPluginNameStatic() { return "script-lua"; }
|
|
|
|
static llvm::StringRef GetPluginDescriptionStatic();
|
|
|
|
static bool BreakpointCallbackFunction(void *baton,
|
|
StoppointCallbackContext *context,
|
|
lldb::user_id_t break_id,
|
|
lldb::user_id_t break_loc_id);
|
|
|
|
static bool WatchpointCallbackFunction(void *baton,
|
|
StoppointCallbackContext *context,
|
|
lldb::user_id_t watch_id);
|
|
|
|
// PluginInterface protocol
|
|
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
|
|
|
|
LuaState &GetLuaState();
|
|
|
|
llvm::Error EnterSession(lldb::user_id_t debugger_id);
|
|
llvm::Error LeaveSession();
|
|
|
|
void CollectDataForBreakpointCommandCallback(
|
|
std::vector<std::reference_wrapper<BreakpointOptions>> &bp_options_vec,
|
|
CommandReturnObject &result) override;
|
|
|
|
void
|
|
CollectDataForWatchpointCommandCallback(WatchpointOptions *wp_options,
|
|
CommandReturnObject &result) override;
|
|
|
|
Status SetBreakpointCommandCallback(BreakpointOptions &bp_options,
|
|
const char *command_body_text,
|
|
bool is_callback) override;
|
|
|
|
void SetWatchpointCommandCallback(WatchpointOptions *wp_options,
|
|
const char *command_body_text,
|
|
bool is_callback) override;
|
|
|
|
Status SetBreakpointCommandCallbackFunction(
|
|
BreakpointOptions &bp_options, const char *function_name,
|
|
StructuredData::ObjectSP extra_args_sp) override;
|
|
|
|
private:
|
|
std::unique_ptr<LuaState> m_lua_state;
|
|
bool m_session_is_active = false;
|
|
|
|
Status RegisterBreakpointCallback(BreakpointOptions &bp_options,
|
|
const char *command_body_text,
|
|
StructuredData::ObjectSP extra_args_sp);
|
|
|
|
Status RegisterWatchpointCallback(WatchpointOptions *wp_options,
|
|
const char *command_body_text,
|
|
StructuredData::ObjectSP extra_args_sp);
|
|
};
|
|
|
|
} // namespace lldb_private
|
|
|
|
#endif // LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_LUA_SCRIPTINTERPRETERLUA_H
|