glibc中printf()的跟踪代码

发布于 2024-12-29 06:41:48 字数 739 浏览 3 评论 0原文

我已经下载了 glibc(GNU c 库)的源代码,版本 - 2.15.90。我正在跟踪 printf() 函数的代码。我正在使用工具 cscopectags 浏览代码。以下是我理解 printf() 函数的路径。 (在这里,我只是提到函数调用):-

1. Opening file "glibc/stdio-common/printf.c"
2. int __printf (const char *format, ...)
3. __extern_always_inline int vfprintf (FILE *__restrict __stream, const char *__restrict __fmt, _G_va_list __ap)
4. int attribute_hidden __vfprintf_chk (FILE *s, int flag, const char *fmt, va_list ap)
5. int attribute_compat_text_section __nldbl___vfprintf_chk (FILE *s, int flag, const char *fmt, va_list ap)

一旦我到达函数 \__nldbl___vfprintf_chk(),就会调用 __vfprintf_chk() ,因此最后两个函数(提到第 4 点和第 5 点)互相调用。我哪里做错了?

I have downloaded source code of glibc (GNU c library), version - 2.15.90. I was tracing the code of printf() function. I am using tools cscope and ctags to browse through code. Following is the path I traverse to understand printf() function. (Here, am just mentioning function calls) :-

1. Opening file "glibc/stdio-common/printf.c"
2. int __printf (const char *format, ...)
3. __extern_always_inline int vfprintf (FILE *__restrict __stream, const char *__restrict __fmt, _G_va_list __ap)
4. int attribute_hidden __vfprintf_chk (FILE *s, int flag, const char *fmt, va_list ap)
5. int attribute_compat_text_section __nldbl___vfprintf_chk (FILE *s, int flag, const char *fmt, va_list ap)

Once I reached upto function \__nldbl___vfprintf_chk(), there is a call to __vfprintf_chk() and thus last 2 functions (mentioned in point 4 and 5) calls each other. Where did I go wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

拥有 2025-01-05 06:41:48

我在调用中没有看到这样的内容, printf 快速跳转到 vfprintf 真正起作用 我想说你的源代码浏览器正在运行,glibc 是相当宏密集的。

I see no such at calls, printf quickly jumps into vfprintf which does the real work I'd say your source code browser is acting up, glibc is pretty macro intensive.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文