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:
- Add
--annotate=3
to your gdb call in the launch file.
- 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