在gdb中用原始碼debug glibc

打開/etc/apt/sources.list # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to # newer versions of the distribution. deb http://debian.linux.org.tw/ubuntu/ bionic main restricted deb-src http://debian.linux.org.tw/ubuntu/ bionic main restricted 把main restricted的deb-src取消註解找個適當的地方執行apt-get source glibc在.gdbinit中加入 set directories /path/to/glibc-source/glibc-2.27/mallocdone!