Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugging embedded lua #23

Open
rpatters1 opened this issue Oct 9, 2021 · 1 comment
Open

Debugging embedded lua #23

rpatters1 opened this issue Oct 9, 2021 · 1 comment

Comments

@rpatters1
Copy link

I am trying to get LRDB working with a lua instance embedded in a larger program by means of a third-party plugin. I have compiled my plugin with the server code as described in the docs. But I am stumped on how to get the vscode-lrdb extension to connect to my plugin.

This launch.json launches the debugger.

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "lrdb",
            "request": "launch",
            "name": "Lua Launch",
            "program": "${file}",
            "cwd": "${workspaceFolder}",
            "stopOnEntry": true
        }
    ]
}

But because the script isn't running under the control of my plugin, none of its environment is available so it fails immediately. Conversely I can change the "program" tag to point to the host program. That successfully launches the host program, but then the code hangs when I try to launch my .lua script.

The docs seems to imply that what I want to do is possible, but I don't see the options to do it.

@rpatters1
Copy link
Author

rpatters1 commented Oct 10, 2021

I made a little headway by adding a line to the given launch.json file:

"useInternalLua" : false

which leads to a full file of:

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "lrdb",
            "request": "launch",
            "name": "Lua Launch",
            "program": "${file}",
            "cwd": "${workspaceFolder}",
            "stopOnEntry": true,
            "useInternalLua" : false
        }
    ]
}

This leads to the most hopeful result. It actually breaks inside my plugin and acts as though it is going to proceed with debugging. The problem is that the client terminates immediately with:

exit status: -13

This happens whether I have my server app running or not. I have not been able to find what this status code means. But it suggests I need to change the launch.json file. However the only thing I can think to change is:

 "program": "/My/Host/Program",

This change indeed launches the host program but then everything hangs once I launch my lua script. Any help would be appreciated. I have used telnet to confirm that the server is responding on the port.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant