How to build a debug symbol `.deb` package for my ROS nodes?
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
/.
/usr
/usr/lib
/usr/lib/debug
/usr/lib/debug/.build-id
/usr/lib/debug/.build-id/09
/usr/lib/debug/.build-id/09/9674f81c0faf75504bbedcde1d02928ccdf947.debug
/usr/lib/debug/.build-id/12
/usr/lib/debug/.build-id/12/b8e145b553888235ab83a20ff8ab115c01a92d.debug
/usr/lib/debug/.build-id/9b
/usr/lib/debug/.build-id/9b/af74a99bc6c2e5b2d7b1e61fd5a3c7e418c3e0.debug
/usr/share
/usr/share/doc
/usr/share/doc/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:
- 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. - 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:
- How to debug executable, built with catkin_make (without roslaunch) which refers to the following articles:
- Cmake debug option
- catkin_make's option for optimization
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
?
Thanks!
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
.ddeb
s as part of the process (related: ros-infrastructure/buildfarm_deployment#186).catkin_make
is not involved there.