Weird behavior of GDB with roslaunch
I am trying to debug a ROS project which is started by the followinng (simplified) launch file. When the launch file is executed with launch-prefix="gdb --args"
appended to the last part of every node tag, gdb
seems to start fine. (I also compile the project with catkin_make -DCMAKE_BUILD_TYPE=Debug
.)
However, when I try to type run
command, it's showing a weird behavior, seeeming not getting the correct input that I type (please see at the very last part of the output).
project.launch
<launch>
<arg name="cf_path" default = "..." />
<arg name="path" default = "..." />
<node name="feature_tracker" pkg="feature_tracker" type="feature_tracker" output="log" launch-prefix="gdb --args">
<param name="cf_file" type="string" value="..." />
<param name="folder" type="string" value="..." />
</node>
<node name="estimator" pkg="estimator" type="estimator" output="screen" launch-prefix="gdb --args">
<param name="cf_file" type="string" value="..." />
<param name="folder" type="string" value="..." />
</node>
<node name="pose_graph" pkg="pose_graph" type="pose_graph" output="screen" launch-prefix="gdb --args">
...
</node>
</launch>
Output
x@laptop:~/project$ roslaunch estimator project.launch
... logging to /home/x/.ros/log/9a2f20e0-0b9d-11ea-be50-380025e3d4b0/roslaunch-laptop-14259.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.
started roslaunch server http://laptop:45849/
SUMMARY
========
PARAMETERS
* /feature_tracker/cf_file: /home/x/project...
* /feature_tracker/folder: /home/x/project...
* /pose_graph/cf_file: /home/x/project...
* /pose_graph/skip_cnt: 0
* /pose_graph/skip_dis: 0.0
* /pose_graph/visualization_shift_x: 0
* /pose_graph/visualization_shift_y: 0
* /rosdistro: kinetic
* /rosversion: 1.12.14
* /estimator/cf_file: /home/x/project...
* /estimator/folder: /home/x/project...
NODES
/
feature_tracker (feature_tracker/feature_tracker)
pose_graph (pose_graph/pose_graph)
estimator (estimator/estimator)
auto-starting new master
process[master]: started with pid [14269]
ROS_MASTER_URI=http://localhost:11311
setting /run_id to 9a2f20e0-0b9d-11ea-be50-380025e3d4b0
process[rosout-1]: started with pid [14282]
started core service [/rosout]
process[feature_tracker-2]: started with pid [14294]
process[estimator-3]: started with pid [14301]
process[pose_graph-4]: started with pid [14303]
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1
...
This GDB was configured as "x86_64-linux-gnu".
...
Type "apropos word" to search for commands related to "word"
...
...
Reading symbols from /home/x/project/devel/lib/estimator/estimator...GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1
...
...
Reading symbols from /home/x/project/devel/lib/pose_graph/pose_graph...done.
(gdb) done.
(gdb) The program is not being run.
(gdb) The program is not being run.
(gdb) Undefined command: "nnu". Try "help".
(gdb) Undefined command: "rrnu". Try "help".
Undefined command: "rrnu". Try "help".
Undefined command: "nq". Try "help".