IntelliJ-EmmyLua
IntelliJ-EmmyLua copied to clipboard
Not working debug after resume
Environment(环境)
IDEA version IC-201.6668.121 EmmyLua version 1.3.3.150-IDEA201 OS macOS 10.14.6
What are the steps to reproduce this issue?(重现步骤?)
No steps
What happens?(出现什么问题?)
I added to the script local mobdebug = require ('mobdebug') mobdebug.start ()
After calling the function "start" and client connected to server, the debugger works correctly. I click button "resume program" and after that debugger not working correctly(pause not available, breakpoints not working and not send "SETB") . Between server and client isn't sending anything after cmd "RUN; 200 OK"(Wireshark showed it). In mobdebug.lua script I added wrapper functions to detect a problem. Results: function debug_hook in "mobdebug.lua" call function is_pending every time and check the socket buffer, but "peer:receive(1)" return always "nill, timeout"
I don't know what is happening. I do the same in ZeroBraneStudio and it works correctly
I just came up here to discover I am seeing the same issue. On Windows instead. For me, the debugger would initialize on main.lua only and I could set breakpoints on that file and have them stop. Here is my small test program. It starts at the top when debugging starts.. I am showing all the breakpoints.
I hit 'Resume Program' and it stops at line 10 of main.lua.
I hit 'Resume Program' again and it does NOT stop on line willnotbreak.lua:8. It stops on main.lua:15 instead.

I did some digging into this the other night and I think the debugging problem is related to a bad path situation... I noticed that the competition's 'Lua plugin' is able to use the breakpoints in subdirectory files, BUT.... It invokes the debugger with this command line
C:\Program Files (x86)\Lua\5.1\lua.exe" -e "package.path=[[C:/Users/Sam/AppData/Local/JetBrains/Toolbox/apps/WebStorm/ch-1/201.7223.93.plugins/Lua/mobdebug/?.lua;]] .. package.path" -l mobdebug -e require([[mobdebug]]).start() C:/Users/Sam/Dropbox/_code/code/lua/sandbox/main.lua
Debugger connected at /127.0.0.1
I think it KNOWS where the basedir is located for the project.
I compared a similar situation with ZeroBrane studio... Its output looks like this
Program starting as '"L:\_gaming\_computer\Fantasy Grounds\develop\ZeroBraneStudio\bin\lua.exe" -e "io.stdout:setvbuf('no')" "C:\Users\Sam\AppData\Local\Temp\.2CB2.tmp"'.
Program 'lua.exe' started in 'C:\Users\Sam\Dropbox\_code\code\lua\sandbox' (pid: 2572).
[169.254.57.70:53153] Debugger sent (command): basedir C:\Users\Sam\Dropbox\_code\code\lua\sandbox\
New base directory is C:/Users/Sam/Dropbox/_code/code/lua/sandbox/
It physically calls a basedir C:\Users\Sam\Dropbox\_code\code\lua\sandbox\
when it starts a session
I do not see ANY mapping of a basedir with EmmyLua
With EmmyLua I get an additional message AFTER the connection....
Start mobdebug server at port:8172
Waiting for process connection...
Connected.
Base dir: C:
Base dir: C:
should be C:/Users/Sam/Dropbox/_code/code/lua/sandbox
I think that issue is what is causing the SKIPPED debugging in subdirectory files....
Basedir needs for mobdebug cause client side set breakpoint using information from server side. In my case path is corrected. With a bad basedir you can check it on client side that mobdebug can't find path. In my situation server doesn't send anything to client after 'resume'
the same issue,just show connected. then hanged,nothing happens after connected.
very similar problem. 0. placing breakpoint
- starting debug server in IDEA
- starting Lua program with following code at beginning Following code at the start of project
require('mobdebug').basedir('C:/pathtothescriptsbase')
require('mobdebug').start()
require('mobdebug').off()
it breaks at line with off
for some reason. I continue
3. calling require('mobdebug').on()
(on the reaction to key press)
it sometimes breaks on breakpoint and somtimes not
4. calling require('mobdebug').off()
5. calling require('mobdebug').on()
again
it never stops in breakpoint now and further
very similar problem. 0. placing breakpoint
- starting debug server in IDEA
- starting Lua program with following code at beginning Following code at the start of project
require('mobdebug').basedir('C:/pathtothescriptsbase') require('mobdebug').start() require('mobdebug').off()
it breaks at line with
off
for some reason. I continue 3. callingrequire('mobdebug').on()
(on the reaction to key press) it sometimes breaks on breakpoint and somtimes not 4. callingrequire('mobdebug').off()
5. callingrequire('mobdebug').on()
again it never stops in breakpoint now and further
emmylua does not recommend mobdebug,emmy new debug is a better choice,Or use emmylua attach。
@CppCXY wow. just... wow. I've missed it somehow and even ported part of mobdebug to C to improve its performance (my app has bottleneck on scripts, so I had 3 FPS with debug)... wow. But this NEW Debug
is just works. With good Step into
behavior and GOOD FPS!!!
... sorry, I'm crying.
Thanks :)
I can't get new debugger working from WSL because it would run a require on a DLL from Ubuntu
I can't get new debugger working from WSL because it would run a require on a DLL from Ubuntu
Seems like you use Copy this code to lua
snippet generated by Windows IDEA/Rider/CLion - it contains dll
suffix. I guess you need correct one for linux (one that IDEA generates on linux). actually, I believe you also need linux EmmyLua installation if you run your Lua/LuaJIT on linux.
Not sure if this is related, but here's an interesting find: https://github.com/pkulchenko/MobDebug/issues/74
Not sure if this is related, but here's some findings: pkulchenko/MobDebug#74
Please use emmy new debug
, I know it doesn't have English documentation, but you can open a new issue and ask me
emmy new debug
I very much prefer seamless integration of mobdebug. IDEA itself does all the magic (I guess, EmmyLua does that) of requiring mobdebug and I don't need to monkey with connect.
Maybe someday emmy new debug would be as seamless as that?