This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: what is the gcc frontend #line pragma
- From: Ian Lance Taylor <iant at google dot com>
- To: "miwei" <miwei at ict dot ac dot cn>
- Cc: <gcc-help at gcc dot gnu dot org>
- Date: 01 Aug 2006 06:59:55 -0700
- Subject: Re: what is the gcc frontend #line pragma
- References: <200608011059.k71AxMka028635@smtp.google.com>
"miwei" <miwei@ict.ac.cn> writes:
> I fine there are many Â#line xxx Âc-parse.y Âstatements in c-parse.c file.
> What is the use of the #line pragma? When I gdb the yyparse function,
> I find it is not line-by-line consistent with the c-parse.c file. How to
> make
> the gdb process easier? ÂÂThanks
#line is a standard C preprocessing directive. From ISO C 99 6.10.4:
A preprocessing directive of the form
# line digit-sequence new-line
causes the implementation to behave as if the following sequence of
source lines begins with a source line that has a line number as
specified by the digit sequence (interpreted as a decimal
integer). The digit sequence shall not specify zero, nor a number
greater than 2147483647.
A preprocessing directive of the form
# line digit-sequence "s-char-sequenceopt" new-line
sets the presumed line number similarly and changes the presumed name
of the source file to be the contents of the character string literal.
This will affect the debugging information, which is read by gdb.
Ian