Re: what is the gcc frontend #line pragma

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"miwei" <miwei@xxxxxxxxx> 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 of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux