Ask Your Question
0

how to recompile cv_bridge w/o optimization

asked 2011-10-20 15:55:54 -0500

HZ gravatar image

Hi All,

For some particular reason, I need to step into /opt/ros/electric/stacks/vision_opencv/cv_bridge/src/cv_bridge.cpp for debugging purpose, and I want to examine the value of int source_type in the function of toCvCopy. However, when I print source_type in gdb, it says "value optimized out". So how can I re-compile & build cv_bridge without optimization, so I can examine the value of source_type?

Thanks

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2011-10-21 03:31:46 -0500

I didn't actually try this, but I believe this should be the general procedure:

First, add a directory for svn-based installs, for example

mkdir ~/ros

Next, add it to your path, by editing /opt/ros/electric/setup.sh to say

export ROS_PACKAGE_PATH=/home/<username>/ros:/opt/ros/electric/stacks

Clone the svn version of vision_opencv

cd ~/ros
svn co https://code.ros.org/svn/ros-pkg/stacks/vision_opencv/trunk

Edit the CMakeLists.txt in cv_bridge to say:

set(ROS_BUILD_TYPE Debug)

Finally, compile it:

rosmake cv_bridge
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

Stats

Asked: 2011-10-20 15:55:54 -0500

Seen: 439 times

Last updated: Oct 21 '11