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

Revision history [back]

click to hide/show revision 1
initial version

You probably want to take a look at roslaunch/Tutorials/Roslaunch Nodes in Valgrind or GDB. Make sure to build proper Debug binaries.

Btw: this is not really specific to catkin_make. The launch-prefix just makes this convenient when starting things from launch files. For single nodes (and an already running master), you can also just do:

gdb --args /path/to/your/node/binary

You probably want to take a look at roslaunch/Tutorials/Roslaunch Nodes in Valgrind or GDB. Make sure to build proper Debug binaries.

Btw: this is not really specific to catkin_make. The launch-prefix just makes this convenient when starting things from launch files. For single nodes (and an already running master), you can also just do:

gdb --args /path/to/your/node/binary

[..] I haven't found anything regarding this on the internet so far.

The tutorial I linked was actually the first result after searching for ros gdb on Google.

You probably want to take a look at roslaunch/Tutorials/Roslaunch Nodes in Valgrind or GDB. Make sure to build proper Debug binaries.

Btw: this is not really specific to catkin_make. The launch-prefix just makes this convenient when starting things from launch files. For single nodes (and an already running master), you can also just do:

gdb --args /path/to/your/node/binary

[..] I haven't found anything regarding this on the internet so far.

The tutorial I linked was actually the first result after searching for ros gdb on Google.


Edit:

I have tried starting gdb directly with the executable but it says no debugging symbols found.

I have also tried to do set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -std=c++11 -march=native" ) without success.

This has been answered before, see fi Cmake debug option:

This will set -g for you:

catkin_make -DCMAKE_BUILD_TYPE=Debug

catkin is just a thin layer on top of CMake in this case.

You probably want to take a look at roslaunch/Tutorials/Roslaunch Nodes in Valgrind or GDB. Make sure to build proper Debug binaries.

Btw: this is not really specific to catkin_make. The launch-prefix just makes this convenient when starting things from launch files. For single nodes (and an already running master), you can also just do:

gdb --args /path/to/your/node/binary

[..] I haven't found anything regarding this on the internet so far.

The tutorial I linked was actually the first result after searching for ros gdb on Google.


Edit:

I have tried starting gdb directly with the executable but it says no debugging symbols found.

I have also tried to do set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -std=c++11 -march=native" ) without success.

This has been answered before, see fi Cmake debug option:

This will set -g for you:

catkin_make -DCMAKE_BUILD_TYPE=Debug

catkin is just a thin layer on top of CMake in this case.

And if you need optimisation with debug symbols, see catkin_make's option for optimization:

For a release configuration with opmizations and no debugging symbols, you can use the Release build type:

catkin_make -DCMAKE_BUILD_TYPE=Release

For a release with debug configuration, with optimizations and debug symbols, you can use the RelWithDebInfo build type:

catkin_make -DCMAKE_BUILD_TYPE=RelWithDebInfo

CMake's useful variables page gives more information about build types.

You probably want to take a look at roslaunch/Tutorials/Roslaunch Nodes in Valgrind or GDB. Make sure to build proper Debug binaries.

Btw: this is not really specific to catkin_make. The launch-prefix just makes this convenient when starting things from launch files. For single nodes (and an already running master), you can also just do:

gdb --args /path/to/your/node/binary

[..] I haven't found anything regarding this on the internet so far.

The tutorial I linked was actually the first result after searching for ros gdb on Google.


Edit:

I have tried starting gdb directly with the executable but it says no debugging symbols found.

I have also tried to do set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -std=c++11 -march=native" ) without success.

This has been answered before, see fi Cmake debug option:

This will set -g for you:

catkin_make -DCMAKE_BUILD_TYPE=Debug

catkin is just a thin layer on top of CMake in this case.

And if you need optimisation with debug symbols, see catkin_make's option for optimization:

For a release configuration with opmizations and no debugging symbols, you can use the Release build type:

catkin_make -DCMAKE_BUILD_TYPE=Release

-DCMAKE_BUILD_TYPE=Release

For a release with debug configuration, with optimizations and debug symbols, you can use the RelWithDebInfo build type:

catkin_make -DCMAKE_BUILD_TYPE=RelWithDebInfo

-DCMAKE_BUILD_TYPE=RelWithDebInfo

CMake's useful variables page gives more information about build types.