ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
4

ROS2 Colcon debug symbols for use with DDD

asked 2019-04-03 13:29:17 -0500

mlanting gravatar image

Is there a way to get Colcon to build ROS2 binaries with debug symbols so that I can run nodes with something like DDD?

I'm able to run using DDD with the following command:

ros2 run --prefix 'ddd' ros1_bridge dynamic_bridge

But without debug symbols, I can't use feature like breakpoints or stepping through the source code.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
11

answered 2019-04-03 14:16:36 -0500

gvdhoorn gravatar image

updated 2019-04-03 14:21:31 -0500

You should be able to do this with:

colcon build <other_args> --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo

instead of using RelWithDebInfo you could use Debug if you really don't want any optimisation.

Assuming the project you're building is a CMake project of course (which the bridge is).


Edit:

Is there a way to get Colcon to build ROS2 binaries

pedantic perhaps, but colcon doesn't build anything. It drives other tools. So in this case we're asking colcon to pass on some arguments for CMake, which in the end will cause it to generate build scripts that will actually compile things with debug flags enabled.

edit flag offensive delete link more

Comments

Exactly what I needed, thanks!

mlanting gravatar image mlanting  ( 2019-04-03 14:58:33 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2019-04-03 13:29:17 -0500

Seen: 5,907 times

Last updated: Apr 03 '19