Robotics StackExchange | Archived questions

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

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:

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

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?

Asked by cpagravel on 2017-04-12 10:38:32 UTC

Comments

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

Asked by ahendrix on 2017-04-12 15:26:15 UTC

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

Asked by cpagravel on 2017-04-12 17:33:53 UTC

You are correct! Thank you for that.

Asked by cpagravel on 2017-04-12 18:41:04 UTC

Answers