Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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.