EmmyLua / IntelliJ-EmmyLua

Lua IDE/Debugger Plugin for IntelliJ IDEA
https://emmylua.github.io
Apache License 2.0
1.74k stars 292 forks source link

Unable to set "Sources Root" for Mobdebug configuration on Jetbrains Rider 2022.2.4 with EmmyLua Plugin #508

Closed david-grem-armstrong closed 1 year ago

david-grem-armstrong commented 1 year ago

Environment(环境)

name version
IDEA version RD-222.4459.9
EmmyLua version v 1.3.7.2-IDEA222
OS OSX 12.6

What are the steps to reproduce this issue?(重现步骤?)

  1. Install the EmmyLua plug-in for JetBrains Rider
  2. Add a Mobdebug configuration
  3. Attempting to run gives a "Error: Sources root not found." message
  4. There seems to be no way to set the sources root in Rider

What happens?(出现什么问题?)

I can't use the Mobdebug debugger

What were you expecting to happen?(期望?)

I should be able to set the sources root in some settings panel somewhere (and the EmmyLua documentation should tell me where that is) and then I should be able to use the Mobdebug debugger.

Any logs, error output, etc?(有没有什么log, error输出?)

"Error: Sources root not found"

Any other comments?(其它说明)

CppCXY commented 1 year ago

use emmylua attach debugger, Or emmy new debugger

CppCXY commented 1 year ago

the emmylua documentation hasn't been updated for a long time, and mobdebug has long been deprecated. we recommend using Emmy New Debug, which has superior performance. Emmylua attach debugger was also fine, but it was removed from the Emmylua plugin due to a virus, you can get from EmmyLua-AttachDebugger-1.0.9.zip

david-grem-armstrong commented 1 year ago

Unfortunately, I'm on in an OSX development environment, so the .dll libs won't work for me. I originally attempted to use "Emmy Debugger(NEW)", but I couldn't get my project to properly load and called into emmy_core.dylib. My project has a Lua layer on top of a C# layer. Do you have any recommendations on how to get C# to called into the emmy_core.dylib correctly?

CppCXY commented 1 year ago

if you use, xlua or other unity lua plugin, please recompile the xlua.dylib or other-plugin.dylib with C macro LUA_USE_DLOPEN and LUA_USE_MACOSX. then you can paste the code into you codebase

local dbg = require "emmy_core"
dbg.tcpListen("localhost", 9966)
dbg.waitIDE()

first play the game in unity, and then start debug configuration

CppCXY commented 1 year ago

EmmyLua has special support for xlua and tolua, which can reflect explicit Unity variables when debugging

david-grem-armstrong commented 1 year ago

I'm using tolua as the Unity plug-in for running Lua and when attempting the above code, I get an error that emmy_core can't be found. Is there something special I need to do for Unity to be able to load emmy_core?

CppCXY commented 1 year ago

in Emmy Debug(NEW), it generate code contain package.cpath = package.cpath .. copy also.

CppCXY commented 1 year ago

Or you copy emmy_core.dylib under unity project mean -| Assets/ -| others -| emmy_core.dylib

david-grem-armstrong commented 1 year ago

Based on this recommendation, I will close this issue and move further questions/issues to new thread directed at Emmy Debugger(NEW) https://github.com/EmmyLua/IntelliJ-EmmyLua/issues/513 Thanks