Open liuty10 opened 5 years ago
Install libglib2 debug symbols. when I install libglib2 debug symbols, other symbols, like gdk are also installed automatically.
$ mkdir libglib2.0-0 $ cd libglib2.0-0 $ sudo apt install -y libglib2.0-0-dbgsym $ dpkg -L libglib2.0-0-dbgsym $ apt source libglib2.0-0 $ ls
Then, you need to find the PID of the process that you are going to debug. $ top or $ pstree -p $ sudo gdb -p PID --directory ./glib2.0-2.48.2
Now, you can set break points and see the stack backtrace (gdb) b cairo_surface_set_mime_data (gdb) c (gdb) bt
You can check the source code of your process: (gdb) la src or use CTRL + x + a to enter or exit TUI(text user interface) of gdb.
For reference: https://www.hiroom2.com/2016/07/14/ubuntu-16-04-debug-package-with-debug-symbol/
1 Add repository of dbgsym dbgsym package is published in ddebs.ubuntu.com. Add ddebs.ubuntu.com to repository list.
$ D= /etc/apt/sources.list.d/ddebs.list
deb http://ddebs.ubuntu.com ${D} main restricted universe multiverse
deb http://ddebs.ubuntu.com ${D}-security main restricted universe multiverse
deb http://ddebs.ubuntu.com ${D}-updates main restricted universe multiverse
lsb_release -cs
$ sudo su -c " cat <deb http://ddebs.ubuntu.com ${D}-proposed main restricted universe multiverse
EOF "
Import GPG key of ddebs.ubuntu.com. $ wget -O - http://ddebs.ubuntu.com/dbgsym-release-key.asc | sudo apt-key add -
Update repository database. $ sudo apt update -y
2 Install dbgsym package The package which has a suffix of dbgsym provides debug symbol.