Skip to content

Debug SITL

Robotics / uav / ardupilot

Debug ardupilot SITL using vscode

Debugging with GDB using VSCode

Debug steps

  • Build SITL with debug symbols
./waf configure --debug

or

sim_vehicle.py -v ArduCopter -f quad --console --map -D
check if build with debug symbols
1
2
3
4
5
6
7
8
9
# with
file arducopter 
#
arducopter: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=9d5c29c3cd71ea0de53ee3585adc661d1650e8f8, for GNU/Linux 3.2.0, with debug_info, not stripped

# without (download precompiled from firmware.ardupilot.org)
file arducopter 
#
arducopter: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, BuildID[sha1]=2a762be075efcc4fe2b39bf1ce56873b3aa33a6d, for GNU/Linux 3.2.0, not stripped