Growing issue with ROS Documentation

Here’s the tutorial:
https://docs.ros.org/en/rolling/Tutorials/Intermediate/Testing/CLI.html#debugging-tests-with-gdb

There’s also a comprehensive tutorial here on debugging nodes at runtime:
https://navigation.ros.org/tutorials/docs/get_backtrace.html

Note that GDB doesn’t integrate well with ROS launch: ROS2 Launch fails to return GDB session for debugging · Issue #165 · ros2/launch_ros · GitHub

Additionally, some issues is doing similar things in VSCode because ROS requires running a setup script (install/setup.bash), but VSCode tasks only support environment variable arguments, not running a whole environment setup script.

The best recommendation I have until VSCode and ros2 launch are more GDB/ROS friendly is use terminal GDB, which you can learn a bunch from Tridge and Henry here:

I’m happy to discuss/help more, but feel it’s a bit off-topic, so feel free to follow up privately or tag me another thread or Github issue. Debugging is important, and the barrier to entry is quite high still when using ROS 2.

3 Likes