Ask Your Question

emacs + gdb + roslaunch all at once .

asked 2013-02-14 05:38:12 -0500

navderm gravatar image

updated 2013-02-14 05:43:54 -0500

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 !

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-11-25 08:05:18 -0500

hersh gravatar image

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2013-02-14 05:38:12 -0500

Seen: 878 times

Last updated: Nov 25 '13