GCC预处理器输出中的调试信息 [英] Debugging information in GCC preprocessor output

查看:366
本文介绍了GCC预处理器输出中的调试信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在检查由GCC生成的预处理输出,我在 .i 文件中看到很多这些,我使用 save-temps flag:

I was inspecting the preprocessed output generated by GCC, and I see a lot of these in the .i file that I generated using the -save-temps flag:

# 8 "/usr/include/i386-linux-gnu/gnu/stubs.h" 2 3 4

code> stubs.h 是什么意思?它似乎是由预处理器插入的某种调试信息,并允许编译器发出引用此信息的错误消息。

What do the numbers before and after the absolute path of stubs.h mean? It seems to be some kind of debugging information that is inserted by the preprocessor and allows the compiler to issue error messages referring to this information. These lines do not affect the program itself, but what specifically is each number for?

推荐答案

基于文档之前的文件名是行号。文件名后面的数字是一个标志,意味着以下内容:

Based on the documentation the number before the filename is the line number. The numbers after the file name are a flag and mean the following:


  • 1

  • 2 表示返回文件(在包含另一个文件之后)。

  • 3 表示以下文本来自系统头文件,因此应禁止某些警告。

  • 4 表示以下文本应被视为包含在隐式外部C块中。

  • 1 indicates the start of a new file.
  • 2 indicates returning to a file (after having included another file).
  • 3 indicates that the following text comes from a system header file, so certain warnings should be suppressed.
  • 4 indicates that the following text should be treated as being wrapped in an implicit extern "C" block.

这篇关于GCC预处理器输出中的调试信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆