Ask Your Question

How to build a debug symbol `.deb` package for my ROS nodes?

asked 2021-05-27 00:39:44 -0600

yaobin gravatar image

updated 2021-05-27 00:40:07 -0600

We have sent our field engineers to the customer site to run our system that has several ROS nodes we have implemented. During the trip, we've found some problems that we'd like to debug into. However, we built our ROS nodes without explicitly specifying -DCMAKE_BUILD_TYPE so I think they weren't built with the debugging symbols.

We are building and publishing our ROS nodes as .deb packages. I've noticed that many of the official ROS .deb packages have a corresponding -dbgsym package. A -dbgsym package typically contains the debug/.build-id folder and *.debug files. For example:

dpkg-query -L ros-melodic-camera-calibration-parsers-dbgsym

My first question is: How are these .debug files generated?

And I also want to implement this "dual-package" method:

  1. Our ROS nodes are packaged into the first .deb package, say, ywen.deb. When we install this Debian package, we would be able to run our ROS nodes but wouldn't have the debugging symbols available so debugger would print "no symbol found" error.
  2. We package the debugging symbols into the ywen-dbgsym.deb package. With this package installed, we would be able to load the debugging symbols for debugging.

I read the other questions on this site:

I also tried to run catkin_make with -DCMAKE_BUILD_TYPE=Debug, but I didn't see any .debug files be generated anywhere.

Am I missing some configuration in catkin_make or maybe CMakeList.txt?


edit retag flag offensive close merge delete



Those packages are generated as part of the release job on the buildfarm, which uses the regular Debian release toolchain, which is ultimately responsible for creating those .ddebs as part of the process (related: ros-infrastructure/buildfarm_deployment#186).

catkin_make is not involved there.

gvdhoorn gravatar image gvdhoorn  ( 2021-05-27 01:50:54 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2021-05-27 03:00:30 -0600

yaobin gravatar image

Thanks! @gvdhoom I also found the same link about an hour after you posted the comment. To answer my own question:

  • The -dbgsym Debian packages are automatically generated by the Debian packaging toolchain debhelper(7), or, dh_strip(1), specifically. (See dh_strip --automatic-dbgsym: "The default is to create debug symbol packages.") The created debug symbols are those .debug files.

  • So, no, catkin_make is not involved here, as @gvdhoom pointed out.

However, debhelper(7) generates the debug symbols into .ddeb packages which are not supported by reprepro. The GitHub issue discusses several possible approaches to publish the .ddeb files into reprepro. Note that at the very end of the thread, the PR is mentioned as the final resolution of the issue.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2021-05-27 00:39:44 -0600

Seen: 135 times

Last updated: May 27