Visual debug with a mod - bimbam2103/space_engineers GitHub Wiki
There is a mod to help PB devs with visually debugging things, (DevTool) Programmable Block DebugAPI on Steam workshop.
Adding a mod to a world is pretty simple, but for this mod in particular you need an offline world because it doesn't have MP support.
In your world's options -> mods you have subscribed mods on the left, move'em to the right to activate them for that world, and that's it.
After that, see mod's description for how to use it.
A preview of what the example ForPB.cs would draw: