actboy168 / lua-debug

Lua Debug Adapter for Visual Studio Code
MIT License
435 stars 94 forks source link

remotedebug.dll statically link to lua51.lib #168

Closed honestabelink closed 2 years ago

honestabelink commented 2 years ago

Hi,

Is there an easy way to include lua51.dll instead as a statically linked library for remotedebug.dll?

I've removed LUA_BUILD_AS_DLL, and then included a reference to the lib. I only get unresolved symbols error.

For some context, My project is for another application in which the package loader has been modified and restricted. To keep things short, remotedebug.dll fails to load because it's dependency lua51.dll can not be found.

Placing lua51.dll along side the application binary corrects the problem and the debugger works, but is something my users would then have to do manually.

Therefore, it would be much easy to have remotedebug.dll include lua51.dll as a statically linked library, removing the need to have the lua51.dll along side remotedebug.dll.

actboy168 commented 2 years ago

remotedebug needs access to the debug target's lua vm (memory data and machine code). So linking lua51.lib statically is wrong.

You should fix the problem with remotedebug.dll loading. Or link remotedebug statically to your app.

honestabelink commented 2 years ago

Thanks for your time.

I will consider what you have mentioned as the correct way going forward.

Curiously though, remotedebug statically linked with lau51.lib does in fact fully work on my target (breakpoints, watches, ect). I am stuck trying to understand how then this would be possible, given what you've claimed.

How is it that the normal lua env in my target is reachable via a statically linked lua51.lib? Is there some sort of common lua env reachable at the process level and not tied down to a specific loaded library?

I would have to familiarize myself with remotedebug to offer any more understanding.