Debugging printf source code with gdb on ubuntu by default, the library function does not contain debugging information, so gdb cannot be used to enter the printf () function. Www.2cto.com solution: 1. install libc: sudoapt-getinstalllibc6-dbg with debugging information... debugging printf source code with gdb on ubuntu by default, the library function does not contain debugging information, so gdb cannot be used to enter the printf () function. Www.2cto.com solution: 1. install libc: sudo apt-get install libc6-dbg with debugging information 2. download libc source code. select a directory to place the source code and enter, such as/home/kent/dev-OS/libc6-source B. run sudo apt-get source libc6 to download the source code to the current directory.
The last source directory is probably:/home/kent/dev-OS/libc6-source/eglibc-2.15 www.2cto.com 3. specify the libc source 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;
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.