This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: what is the gcc frontend #line pragma


"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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]