Page 1 of 1

Use of gdb and valgrind

PostPosted: Thu 18. Sep 2014, 15:02
by chloesdaddy
Hi all,

I had a look at many tuto about ros in order to run gdb or valgrind.
The solution might be to put this in a file :
launch-prefix="gdb -ex run --args" : run your node in gdb in the same xterm as your launch without having to type run to start it
launch-prefix="valgrind" : run your node in valgrind

(cf : http://wiki.ros.org/roslaunch/Tutorials ... 20or%20GDB)

But I cannot find in which file I have to put this in order to have gdb or valgrind working.

Can you help me ?

Best regards

Posted: Thu 18. Sep 2014, 15:02
by Advertising

Re: Use of gdb and valgrind

PostPosted: Fri 19. Sep 2014, 07:17
by Peter Lehner
chloesdaddy wrote:I had a look at many tuto about ros in order to run gdb or valgrind.
The solution might be to put this in a file :
launch-prefix="gdb -ex run --args" : run your node in gdb in the same xterm as your launch without having to type run to start it
launch-prefix="valgrind" : run your node in valgrind

This syntax is used in ros launch files: http://wiki.ros.org/roslaunch. "Launch files usually bring up a set of nodes for the package that provide some aggregate functionality." You can specify the launch-prefix in the node tag.
Nevertheless for debugging I would recommend starting your program directly with gdb or valgrind:
$ gdb /path/to/your/ros/workspace/devel/lib/your_package/your_executable