Debugging - mwicat/personal GitHub Wiki

Autotools debugging

./configure CFLAGS="-ggdb3 -O0" CXXFLAGS="-ggdb3 -O0" LDFLAGS="-ggdb3"

GDB

Subsitute path

set substitute-path "/bad/path" "/good/path"

Backtrace

bt
bt full
thread apply all bt
thread apply all bt full 

Background execution

set target-async on Enable asynchronous mode.

set target-async off Disable asynchronous mode.

show target-async Show the current target-async setting.

Emacs GDB

M-x gdb-many-windows

Core dump

ulimit -c unlimited

Non stop mode

     # Enable the async interface.
     set target-async 1
     
     # If using the CLI, pagination breaks non-stop.
     set pagination off
     
     # Finally, turn it on!
     set non-stop on

Commands

(gdb) info source
Current source file is src/switch.c
Compilation directory is /home/mwiewiorski/src/freeswitch
Located in /home/mwiewiorski/src/freeswitch/src/switch.c
Contains 976 lines.
Source language is c.
Compiled with DWARF 2 debugging format.
Does not include preprocessor macro info.

List breakpoints

info breakpoints

Disable breakpoint

disable N

Sysdig

wget https://s3.amazonaws.com/download.draios.com/stable/deb/stable-amd64/sysdig-0.10.1-x86_64.deb
sudo apt-get install dkms linux-headers-`uname -r`
sudo dpkg -i sysdig-0.10.1-x86_64.deb