EmmyLua / IntelliJ-EmmyLua

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

mobdebug: basepath #503

Open neopaf opened 1 year ago

neopaf commented 1 year ago

Environment(环境)

name version
IDEA version Build #IU-213.7172.25, built on March 15, 2022
EmmyLua version 1.3.6.251-IDEA213
OS OSX 10.15.7 (19H2026)

Currently this conifiguration does not work:

script1.lua
test/for_script1.lua

When I start debug on test/for_script1.lua breakpoints in script1.lua don't work.

neopaf commented 1 year ago

Run configuration has Working directory as root of that project.

Investigation showed that Emmy does not inform mobdebug of a basepath, hence when mobdebug.debug_hook is invoked debug.getinfo(2, "S") returns paths like '@./script1.lua` which would work... if mobdebug was informed of a working directory of a program being executed.

But EmmyLua does NOT use basedir command that mobdebug provides.

neopaf commented 1 year ago

Additionally, I see that Emmy-side basedir is not determined in a situation described:

Start mobdebug server at port:8172
Waiting for process connection...
Connected.
Base dir: 

As I see from code, it was supposed to be the shortest path of all items from stack trace. It would not help in my case anyway, as script1.lua is not in stack trace on first run.

I feel the basepath to be passed to mobdebug must be just Working directory.

neopaf commented 1 year ago

A hack for mobdebug 0.703 to ignore path completely and look at only file names allowed me to continue my work

idea-paf-fix2-diff.txt

(for the Googlers sake; please put a smile if you've used this and it helped)

CppCXY commented 1 year ago

If you want to use mobdebug, you need to go to 'project structure' to set the source