How to properly use the Lua Remote DeBugger

Discussion in 'Utilities and programming' started by Derpitron, Dec 22, 2022.

  1. Derpitron

    Derpitron
    Expand Collapse

    Joined:
    Jun 25, 2017
    Messages:
    252
    Hello, I'm trying to use the vscode-lrdb tool. I've followed the guide at the Github page: https://github.com/BeamNG/vscode-lrdb/blob/master/Readme_BeamNG.md, but when I attach the debugger in VSCode, it works for half a second, then disconnects.

    Output of Debug Console:

    Debugger connecting to localhost:21110 ...
    Debugger disconnected.

    Video of what happens:


    Am I doing something wrong?
     
    • Like Like x 1
  2. tdev

    tdev
    Expand Collapse
    Developer
    BeamNG Team

    Joined:
    Aug 3, 2012
    Messages:
    3,085
    oh crap, not good.I'll have a look!

    What does the beamng.log file say about this?
    Did you start the game with -luadebug ?
     
  3. Derpitron

    Derpitron
    Expand Collapse

    Joined:
    Jun 25, 2017
    Messages:
    252
    • I ran the game binary with -luadebug -attachonstart flags.
    • beamng.log says nothing about this at all.
     
  4. angelo234

    angelo234
    Expand Collapse
    Programmer
    BeamNG Team

    Joined:
    Aug 11, 2017
    Messages:
    587
    The command line arguments are actually case sensitive so you need to run the game with:
    Code:
    -luadebug -attachOnStart
    :)
     
    • Like Like x 2
  5. Derpitron

    Derpitron
    Expand Collapse

    Joined:
    Jun 25, 2017
    Messages:
    252
    This worked for me! But why are there no variables in the debug view? Do I need to set breakpoints?
    upload_2022-12-26_18-23-32.png
     
    • Like Like x 1
  6. angelo234

    angelo234
    Expand Collapse
    Programmer
    BeamNG Team

    Joined:
    Aug 11, 2017
    Messages:
    587
    Yeah the variables and call stack sections are populated when a breakpoint is reached.
     
    • Like Like x 1
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice