For this project, I cannot seem to get M-x gdb to work in Emacs 25.1 (on Ubuntu 14.04.5 64-bit if it matters - this should be the case for any Ubuntu-based Linux in general I imagine). Steps to reproduce:

sudo apt-get install subversion cmake libopencv-dev libeigen3-dev libv4l-dev
cd ~/Downloads/
svn co https://svn.csail.mit.edu/apriltags
cd apriltags
make BUILD_TYPE=Debug
./build/bin/apriltags_demo # run program to see that it works

Now fire up Emacs and go to the file located in examples/apriltags_demo.cpp of the downloaded directory. Running M-x gdb and accepting the default gdb -i=mi main as the gdb command, I cannot place breakpoints anywhere by mouse clicking in the left fringe of the gdb-many-windows view - like I can do for any other simple program that I create and compile with g++ -std=c++11 -g main.cpp -o main.

Can you please try to reproduce my steps/explain how to get this to work? Thank you!

Note: using realgud works flawlessly - but I want to see why it doesn't work with Emacs' built-in GDB functionality.

  • Note: typing M-x gdb and then replacing the default command with gdb -i=mi -s ../build/bin/apriltags_demo -e apriltags_demo -d ../../src -d ../../AprilTags seems to do the trick. But is there a better way? For example, set this command to be the default for the project? – space_voyager Dec 15 '16 at 0:02

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.