diff options
author | Alex Langford <alangford@apple.com> | 2023-05-15 16:06:50 -0700 |
---|---|---|
committer | Alex Langford <alangford@apple.com> | 2023-05-15 17:24:00 -0700 |
commit | 692ae97ae71d62ce51d784681a0481fb54343fc1 (patch) | |
tree | 41659c9438c0e4e629bfde78ea4a341e4509da07 /lldb | |
parent | ce90dfc74b9018dce0f4b2d5f5867297a0521e3c (diff) | |
download | llvm-692ae97ae71d62ce51d784681a0481fb54343fc1.tar.gz |
[lldb] Fix lua build after 27b6a4e63afe
This applies the same trick for Lua that I did for python in
27b6a4e63afe.
Differential Revision: https://reviews.llvm.org/D150624
Diffstat (limited to 'lldb')
-rw-r--r-- | lldb/bindings/lua/lua-wrapper.swig | 6 | ||||
-rw-r--r-- | lldb/include/lldb/API/SBBreakpointLocation.h | 4 | ||||
-rw-r--r-- | lldb/include/lldb/API/SBFrame.h | 4 | ||||
-rw-r--r-- | lldb/include/lldb/API/SBStructuredData.h | 4 | ||||
-rw-r--r-- | lldb/include/lldb/API/SBWatchpoint.h | 6 | ||||
-rw-r--r-- | lldb/source/Plugins/ScriptInterpreter/Lua/Lua.cpp | 8 | ||||
-rw-r--r-- | lldb/source/Plugins/ScriptInterpreter/Lua/SWIGLuaBridge.h | 19 | ||||
-rw-r--r-- | lldb/unittests/ScriptInterpreter/Lua/LuaTests.cpp | 6 |
8 files changed, 42 insertions, 15 deletions
diff --git a/lldb/bindings/lua/lua-wrapper.swig b/lldb/bindings/lua/lua-wrapper.swig index a36e69a6fc93..140914887385 100644 --- a/lldb/bindings/lua/lua-wrapper.swig +++ b/lldb/bindings/lua/lua-wrapper.swig @@ -3,7 +3,8 @@ template <typename T> void PushSBClass(lua_State * L, T * obj); // This function is called from Lua::CallBreakpointCallback -llvm::Expected<bool> lldb_private::LLDBSwigLuaBreakpointCallbackFunction( +llvm::Expected<bool> +lldb_private::lua::SWIGBridge::LLDBSwigLuaBreakpointCallbackFunction( lua_State * L, lldb::StackFrameSP stop_frame_sp, lldb::BreakpointLocationSP bp_loc_sp, const StructuredDataImpl &extra_args_impl) { @@ -41,7 +42,8 @@ llvm::Expected<bool> lldb_private::LLDBSwigLuaBreakpointCallbackFunction( } // This function is called from Lua::CallWatchpointCallback -llvm::Expected<bool> lldb_private::LLDBSwigLuaWatchpointCallbackFunction( +llvm::Expected<bool> +lldb_private::lua::SWIGBridge::LLDBSwigLuaWatchpointCallbackFunction( lua_State * L, lldb::StackFrameSP stop_frame_sp, lldb::WatchpointSP wp_sp) { lldb::SBFrame sb_frame(stop_frame_sp); lldb::SBWatchpoint sb_wp(wp_sp); diff --git a/lldb/include/lldb/API/SBBreakpointLocation.h b/lldb/include/lldb/API/SBBreakpointLocation.h index bc06aeeb6f1c..fa823e2b518a 100644 --- a/lldb/include/lldb/API/SBBreakpointLocation.h +++ b/lldb/include/lldb/API/SBBreakpointLocation.h @@ -16,6 +16,9 @@ namespace lldb_private { namespace python { class SWIGBridge; } +namespace lua { +class SWIGBridge; +} } // namespace lldb_private namespace lldb { @@ -98,6 +101,7 @@ public: protected: friend class lldb_private::python::SWIGBridge; + friend class lldb_private::lua::SWIGBridge; SBBreakpointLocation(const lldb::BreakpointLocationSP &break_loc_sp); private: diff --git a/lldb/include/lldb/API/SBFrame.h b/lldb/include/lldb/API/SBFrame.h index 8fc4d510be4a..7c4477f9125d 100644 --- a/lldb/include/lldb/API/SBFrame.h +++ b/lldb/include/lldb/API/SBFrame.h @@ -16,6 +16,9 @@ namespace lldb_private { namespace python { class SWIGBridge; } +namespace lua { +class SWIGBridge; +} } // namespace lldb_private namespace lldb { @@ -198,6 +201,7 @@ protected: friend class SBValue; friend class lldb_private::python::SWIGBridge; + friend class lldb_private::lua::SWIGBridge; SBFrame(const lldb::StackFrameSP &lldb_object_sp); diff --git a/lldb/include/lldb/API/SBStructuredData.h b/lldb/include/lldb/API/SBStructuredData.h index 3021069793bd..75f8ebb7c9e7 100644 --- a/lldb/include/lldb/API/SBStructuredData.h +++ b/lldb/include/lldb/API/SBStructuredData.h @@ -16,6 +16,9 @@ namespace lldb_private { namespace python { class SWIGBridge; } +namespace lua { +class SWIGBridge; +} } // namespace lldb_private namespace lldb { @@ -104,6 +107,7 @@ protected: friend class SBBreakpointName; friend class SBTrace; friend class lldb_private::python::SWIGBridge; + friend class lldb_private::lua::SWIGBridge; SBStructuredData(const lldb_private::StructuredDataImpl &impl); diff --git a/lldb/include/lldb/API/SBWatchpoint.h b/lldb/include/lldb/API/SBWatchpoint.h index de8e87f3a732..dc613a840beb 100644 --- a/lldb/include/lldb/API/SBWatchpoint.h +++ b/lldb/include/lldb/API/SBWatchpoint.h @@ -13,7 +13,10 @@ #include "lldb/API/SBType.h" namespace lldb_private { -namespace ptyhon { +namespace python { +class SWIGBridge; +} +namespace lua { class SWIGBridge; } } // namespace lldb_private @@ -86,6 +89,7 @@ public: protected: friend class lldb_private::python::SWIGBridge; + friend class lldb_private::lua::SWIGBridge; SBWatchpoint(const lldb::WatchpointSP &wp_sp); diff --git a/lldb/source/Plugins/ScriptInterpreter/Lua/Lua.cpp b/lldb/source/Plugins/ScriptInterpreter/Lua/Lua.cpp index 9c2227cc3884..8dad22d077be 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Lua/Lua.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Lua/Lua.cpp @@ -83,8 +83,8 @@ Lua::CallBreakpointCallback(void *baton, lldb::StackFrameSP stop_frame_sp, lua_pushlightuserdata(m_lua_state, baton); lua_gettable(m_lua_state, LUA_REGISTRYINDEX); StructuredDataImpl extra_args_impl(std::move(extra_args_sp)); - return LLDBSwigLuaBreakpointCallbackFunction(m_lua_state, stop_frame_sp, - bp_loc_sp, extra_args_impl); + return lua::SWIGBridge::LLDBSwigLuaBreakpointCallbackFunction( + m_lua_state, stop_frame_sp, bp_loc_sp, extra_args_impl); } llvm::Error Lua::RegisterWatchpointCallback(void *baton, const char *body) { @@ -109,8 +109,8 @@ Lua::CallWatchpointCallback(void *baton, lldb::StackFrameSP stop_frame_sp, lua_pushlightuserdata(m_lua_state, baton); lua_gettable(m_lua_state, LUA_REGISTRYINDEX); - return LLDBSwigLuaWatchpointCallbackFunction(m_lua_state, stop_frame_sp, - wp_sp); + return lua::SWIGBridge::LLDBSwigLuaWatchpointCallbackFunction( + m_lua_state, stop_frame_sp, wp_sp); } llvm::Error Lua::CheckSyntax(llvm::StringRef buffer) { diff --git a/lldb/source/Plugins/ScriptInterpreter/Lua/SWIGLuaBridge.h b/lldb/source/Plugins/ScriptInterpreter/Lua/SWIGLuaBridge.h index 5fca18f2dd6d..27263c3b634b 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Lua/SWIGLuaBridge.h +++ b/lldb/source/Plugins/ScriptInterpreter/Lua/SWIGLuaBridge.h @@ -15,13 +15,20 @@ namespace lldb_private { -llvm::Expected<bool> LLDBSwigLuaBreakpointCallbackFunction( - lua_State *L, lldb::StackFrameSP stop_frame_sp, - lldb::BreakpointLocationSP bp_loc_sp, - const StructuredDataImpl &extra_args_impl); +namespace lua { -llvm::Expected<bool> LLDBSwigLuaWatchpointCallbackFunction( - lua_State *L, lldb::StackFrameSP stop_frame_sp, lldb::WatchpointSP wp_sp); +class SWIGBridge { +public: + static llvm::Expected<bool> LLDBSwigLuaBreakpointCallbackFunction( + lua_State *L, lldb::StackFrameSP stop_frame_sp, + lldb::BreakpointLocationSP bp_loc_sp, + const StructuredDataImpl &extra_args_impl); + + static llvm::Expected<bool> LLDBSwigLuaWatchpointCallbackFunction( + lua_State *L, lldb::StackFrameSP stop_frame_sp, lldb::WatchpointSP wp_sp); +}; + +} // namespace lua } // namespace lldb_private diff --git a/lldb/unittests/ScriptInterpreter/Lua/LuaTests.cpp b/lldb/unittests/ScriptInterpreter/Lua/LuaTests.cpp index 5e9fca597465..3b5836cfa803 100644 --- a/lldb/unittests/ScriptInterpreter/Lua/LuaTests.cpp +++ b/lldb/unittests/ScriptInterpreter/Lua/LuaTests.cpp @@ -14,14 +14,16 @@ using namespace lldb_private; extern "C" int luaopen_lldb(lua_State *L) { return 0; } -llvm::Expected<bool> lldb_private::LLDBSwigLuaBreakpointCallbackFunction( +llvm::Expected<bool> +lldb_private::lua::SWIGBridge::LLDBSwigLuaBreakpointCallbackFunction( lua_State *L, lldb::StackFrameSP stop_frame_sp, lldb::BreakpointLocationSP bp_loc_sp, const StructuredDataImpl &extra_args_impl) { return false; } -llvm::Expected<bool> lldb_private::LLDBSwigLuaWatchpointCallbackFunction( +llvm::Expected<bool> +lldb_private::lua::SWIGBridge::LLDBSwigLuaWatchpointCallbackFunction( lua_State *L, lldb::StackFrameSP stop_frame_sp, lldb::WatchpointSP wp_sp) { return false; } |