0
$\begingroup$

Rosanswers logo

I run a launch file from within emacs. But when i have gdb debugging turned on, it always opens up a new window for gdb terminal. I can use gdb in emacs when not using a ros node but can't do so while debugging a ros node. How do I do this ??

The command I use is : launch-prefix="xterm -ex gdb --args"

EDIT: The primary reason for doing this is to get the gdb-many-windows to run so that by debugging is not a typing nightmare !


Originally posted by navderm on ROS Answers with karma: 78 on 2013-02-14

Post score: 2

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Hey, I've been wanting this for a while myself and after seeing your question I decided to work on it.

I got it to work pretty simply. There are two things that you need to do different than normal:

  1. Add --annotate=3 to your gdb call in the launch file.
  2. When you hit M-x gdb to invoke gdb inside emacs, erase the default gdb invocation line and replace it with your roslaunch command.

So for example, I used: launch-prefix="gdb --annotate=3 --args" in my launch file because I wanted to set a breakpoint before it started running. If you wanted it to run immediately, you would use launch-prefix="gdb --annotate=3 --ex run --args"

One thing to be careful of is that Emacs invokes subcommands like gdb or roslaunch with the same set of environment variables which Emacs was invoked with. So if you source a setup.bash script for a catkin workspace before you run roslaunch, you'll need to source that same setup script before you run Emacs.


Originally posted by hersh with karma: 1351 on 2013-11-25

This answer was ACCEPTED on the original site

Post score: 2

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.