Skip to content

Commit 6cb6a12

Browse files
adding updates for GDB tutorial (#119)
* adding updates for GDB * adding xterm of snippet
1 parent e882ce4 commit 6cb6a12

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tutorials/docs/get_backtrace.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,10 @@ While we could set this up through the commandline, we can instead make use of t
134134
In your launch file, find the node that you're interested in debugging.
135135
For this section, we assume that your launch file contains only a single node (and potentially other information as well).
136136
The ``Node`` function used in the ``launch_ros`` package will take in a field ``prefix`` taking a list of prefix arguments.
137-
We will insert the same GDB snippet here as used in our node example.
137+
We will insert the GDB snippet here with one change from our node example, use of ``xterm``.
138+
``xterm`` will pop up a new terminal window to show and interact with GDB.
139+
We do this because of issues handling ``stdin`` on launch files (e.g. if you hit control+C, are you talking to GDB or launch?).
140+
See `this ticket <https://github.com/ros2/launch_ros/issues/165>`_ for more information.
138141
See below for an example debugging SLAM Toolbox.
139142

140143
.. code-block:: python
@@ -147,15 +150,12 @@ See below for an example debugging SLAM Toolbox.
147150
package='slam_toolbox',
148151
executable='sync_slam_toolbox_node',
149152
name='slam_toolbox',
150-
prefix=['gdb -ex run --args'],
153+
prefix=['xterm -e gdb -ex run --args'],
151154
output='screen')
152155
153-
Just as before, this prefix will launch a GDB session and run the launch file you requested with all the additional launch arguments defined.
156+
Just as before, this prefix will launch a GDB session, now in ``xterm`` and run the launch file you requested with all the additional launch arguments defined.
154157

155-
.. note::
156-
As of ROS2 Foxy, there may be an issue with ``prefix`` in launch files not returning ``gdb`` prompts after a crash. See `this ticket <https://github.com/ros2/launch_ros/issues/165>`_ for more information.
157-
158-
Once your server crashes, you'll see a prompt like below. At this point you can now get a backtrace.
158+
Once your server crashes, you'll see a prompt like below, now in the ``xterm`` session. At this point you can now get a backtrace.
159159

160160
.. code-block:: bash
161161

0 commit comments

Comments
 (0)