By default, the library function does not contain debugging information in Ubuntu, so gdb cannot be used to enter the printf () function. Solution: 1. install libc: sudoapt-getinstalllibc6-dbg2 with debugging information. download libc source code. select a directory to place the source code and enter, such as/home/kent/dev-OS/libc6-sourceb. perform sudoapt-getsourcelibc6,
By default, the library function does not contain debugging information in Ubuntu, so gdb cannot be used to enter the printf () function.
Solution:
1. install the libc: sudo apt-get install libc6-dbg with debugging information
2. Download the libc source code
A. Select a directory to place the source code and enter, such as/home/kent/dev-OS/libc6-source
B. Execute sudo apt-get source libc6 and download the source code to the current directory. The last source directory is probably:/home/kent/dev-OS/libc6-source/eglibc-2.15
3. Specify the libc source code directory when running gdb: gdb 'Find/home/kent/dev-OS/libc6-source/eglibc-2.15-type d-printf'-d % P' my_program
4. Enter the printf () function. The first line of code I see here is
Va_list arg;
For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2