VIDEO: Connecting Lua Debugger to a Remote Target

The Storyboard development environment includes a Debugger to allow for stepping through your live code. By default, the Debugger is attached to your Simulator running on the desktop. This video demonstrates the process of setting up your Debugger to point to and walk through the Lua code running remotely on a linux target.

  • 0:42 – Step 1. Add the luasocket module to your Storyboard project. This module is compiled for your runtime and can be obtained by contacting the Crank team.

  • 1:20 – Step 2. Copy the debugger.lua file from Storyboard Designer into your project.

  • 2:38 – Step 3. In Lua, set up requirements and package paths to include the new module and debugger code.

  • 2:55 – Step 4. Create function and event to initiate connection between target and debugger.

    function CBStartDebugging(mapargs)  
      -- IP address of your desktop running the debugger 
      initconnection("000.00.0.000", 10000, "idekey")    
    end 
  • 3:30 – Step 5. Edit debugger.lua in project to add paths for the local project in your Storyboard workspace and the Storyboard project on target.

    local HOST_PATH_ROOT = "C:/Workspace_Dir/SB_Project/"
    local TARGET_PATH_ROOT = "usr/crank/apps/SB_Project/"

    In M.breakpoint_set() :

    filename = string.gsub(filename, "file:///" .. HOST_PATH_ROOT, "file:///" .. TARGET_PATH_ROOT) 

    In make_level():

    attr.filename = uri:gsub("file:///" .. TARGET_PATH_ROOT, "file:///" .. HOST_PATH_ROOT) 
  • 5:49 – Step 6. Create a new “Lua Attach to Application” configuration in the Debugger for connecting to your remote target

  • 7:42 – Step 7. Export Project to target, make sure to include new luasocket module and debugger code.

  • 8:15 – Step 8. Launch Debugger manually, and launch application on target to establish connection

  • 8:38 – Step 9. Test out breakpoints and walk through code in debugger

Was this article helpful?
0 out of 0 found this helpful