GDB step into Dynamic linker(ld.so) code

别来无恙 提交于 2019-12-01 09:39:54

If you've libc's source code available, you can add sources to gdb's source path with dir command: Source_Path

Edit: To debug libc related files (in a Ubuntu distro) you would need to:

  1. Get libc's debug information by installing libc6-dbg packet.
  2. Get libc's source code by enabling source repositories (by running software-sources and and checking "enable source code repositories") and running apt-get source libc6
  3. Add libc's debug information into LD_LIBRARY_PATH: export LD_LIBRARY_PATH=/usr/lib/debug or LD_LIBRARY_PATH=/usr/lib/debug gdb <application>
  4. Add full path to c file to gdb's source path, this is: dir directory_path_libc_source/stdio-common

Download the Glibc source and path the same with gdb before debugging. Check this ubuntu blog

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!