Skip to content

Instantly share code, notes, and snippets.

@btgoodwin
Last active August 29, 2015 14:18
Show Gist options
  • Save btgoodwin/69401739c8e508531288 to your computer and use it in GitHub Desktop.
Save btgoodwin/69401739c8e508531288 to your computer and use it in GitHub Desktop.
Debug a Python REDHAWK Device on a running domain
In this case, I'm suggesting using `winpdb` because it should be available to you in the CentOS 6.x EPEL repos (which gets around some issues of what software can be used, where).
1) Find the `entrypoint` tag entry in your SPD.XML file, duplicate it
2) Comment the original `entrypoint` line
3) Edit the new entry to use a shell script instead, e.g.: `<entrypoint>python/debug.sh</entrypoint>`
4) Create `python/debug.sh`:
#!/bin/bash
exec winpdb `dirname $0`/<DeviceName>.py "$@"
>**NOTE:** The __dirname $0__ is surrounded in back-ticks.
5) Make the `python/debug.sh` executable: `chmod ug+x python/debug.sh`.
The next time you launch a Node using that device, winpdb will launch with it. **Don't forget** to "run" the Device as soon as this window launches so that it can register with the DeviceManager.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment