Introduction
This extension allows you to register a number of test machines (as name/address pairs) and nominate one as a debug target.
The machine name and address can be accessed with the commands/variables from your launch.json and tasks.json
It also provides facilities to aid in using rsync in the debug configuration, launch.json
Getting Started
Open the VS Code settings, and select Extensions and then Datapath Debug Tools
Add your test machine(s) as name and address pairs.
To nominate a machine as the debug target, select the navigation bar and type > Set the debug target
and then use the quick select menu.
The following commands are available to use in your launch.json and tasks.json:
${commands:datapath.debugTargetName}
- gets the debug target machine name
${commands:datapath.debugTargetAddress}
- gets the debug target machine address
${commands:datapath.debugPort}
- gets the port for the debug session
${commands:datapath.userName}
- gets the username
${commands:datapath.builtDirectory}
- gets the binaries built directory
${commands:datapath.targetDirectory}
- gets the binaries target directory (on the remote machine)
${commands:datapath.sshKey}
- gets the ssh key
${commands:datapath.rsyncIncludes}
- provides a string that can be passed to rsync to alow it to copy only the required binaries
${commands:datapath.rsyncCommand}
- provides a whole rsync command. Use in the 'initCommands' section as "platform shell ${command:datapath.rsyncCommand}
"
${commands:datapath.tempDirectory}
- the directory for temporary files used by the extension, e.g. scripts
${commands:datapath.targetCreateCommandsScript}
- provides a script to setup the target to debug. Use in the 'targetCreateCommands' section as "command script import ${command:datapath.targetCreateCommandsScript}
"
${commands:datapath.targetCreateChildDebugScript}
- provides a script to automatically attach to child processes when debugging. Use in the 'targetCreateCommands' section as "command script import ${command:datapath.targetCreateChildDebugScript}
"
An optional external script named external_analysis.py
located in ${command:datapath.externalAnalysisDirectory}
which defines the analyse_callstack(frame)
function, which determines whether to attach, provides a custom session name, and specifies a target create script can be provided.
def analyse_callstack(frame):
result = {
"attach": True, # Set this to False if you don't want to attach to this process
"session_name": None, # Set this to a custom session name if you want to override the default
"target_create_script": None # Set this to a custom target create script if you want to override the default
}
...
return result
${commands:datapath.externalAnalysisDirectory}
- the directory for the external_analysis.py
file used by ${commands:datapath.targetCreateChildDebugScript}