Is there a way to run a rostest with the gdb debugger?

asked 2017-04-12 10:38:32 -0500

cpagravel gravatar image

updated 2017-04-12 10:38:56 -0500

I'm trying to port my ROS code to using the newer ROS Kinetic. I have a Docker container with Ubuntu 16.04, which I have ROS Kinetic setup. There is one particular unit test (involving the use of ActionLib) which now fails, giving me the following error:

C++ exception with description "std::bad_alloc" thrown in the test fixture's constructor.

I want to debug this by connecting the gdb debugger and setting a break point on std::bad_alloc::bad_alloc constructor. The test is defined in my CMakeLists in a add_rostest_gtest() call. This is my launch file:

  <test test-name="transition_query_client_test" pkg="intra_sector_planner" type="transition_query_client_test" />

I've tried adding output="screen" launch-prefix="xterm -e gdb --args" but I get an error saying I cannot use the output tag with the test tag.

Is this possible?

edit retag flag offensive close merge delete



Have you tried it without the output="screen" ?

ahendrix gravatar image ahendrix  ( 2017-04-12 15:26:15 -0500 )edit

I have not... I thought I read somewhere that output="screen" was necessary for gdb. I'll give it a try though. :S

cpagravel gravatar image cpagravel  ( 2017-04-12 17:33:53 -0500 )edit

You are correct! Thank you for that.

cpagravel gravatar image cpagravel  ( 2017-04-12 18:41:04 -0500 )edit