Home | Tutorials | Wiki | Issues
Ask Your Question

Debug Gazebo (without ROS) using GDB

asked 2017-05-09 15:06:48 -0500

dbrodeur gravatar image

How is it possible to use gdb to debug Gazebo.

I do not use ROS, only Gazebo 7 on Ubuntu 14.04 (a bit old but I have other dependencies that require me to use 14.04). I built Gazebo from source and it worked fine. Following the instructions I used the command :

cmake -DCMAKE_BUILD_TYPE=Debug ../

to make sure I will be able to use gdb but when I start the program with gdb and I make the program crash, the stack is always empty. Should this be because I did not configure or start gdb correctly?

edit retag flag offensive close merge delete


Are you starting gzserver and gzclient separately? Running gdb on both?

chapulina gravatar imagechapulina ( 2017-05-09 15:26:48 -0500 )edit

No I was running both at the same time using gazebo instead of gzserver <world> and then gzclient as was suggested to me on the other answer below. Thanks for your help!

dbrodeur gravatar imagedbrodeur ( 2017-05-10 07:25:34 -0500 )edit

1 Answer

Sort by » oldest newest most voted

answered 2017-05-09 15:30:37 -0500

Carlos Agüero gravatar image

Instead of using gazebo, you have to use gzserver <world>, and then, gzclient.

E.g. for debugging gzserver:

gdb gzserver
r <your_world>

Once gzserver is running, you can launch gzclient if you want.

Alternatively, you can just launch gzserver as usual:

gzserver <your_world>

And run gdb on gzclient with:

gdb gzclient

Take a look at this related question too.

edit flag offensive delete link more


Ah you're right! I was running both server and client at the same time. Thanks it works!

dbrodeur gravatar imagedbrodeur ( 2017-05-10 07:21:28 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2017-05-09 15:06:48 -0500

Seen: 45 times

Last updated: May 09