GCC Wikia
Advertisement

このページを編集する際は,編集に関する方針に従ってください.[]

概要[]

実装[]

228 /* In gcov we want function linkage to be static.  In the compiler we want
229    it extern, so that they can be accessed from elsewhere.  In libgcov we
230    need these functions to be extern, so prefix them with __gcov.  In
231    libgcov they must also be hidden so that the instance in the executable
232    is not also used in a DSO.  */
233 #if IN_LIBGCOV


237 #define gcov_var __gcov_var



484 GCOV_LINKAGE struct gcov_var
485 {
486   FILE *file;
487   gcov_position_t start;        /* Position of first byte of block */
488   unsigned offset;              /* Read/write position within the block.  */
489   unsigned length;              /* Read limit in the block.  */
490   unsigned overread;            /* Number of words overread.  */
491   int error;                    /* < 0 overflow, > 0 disk error.  */
492   int mode;                     /* < 0 writing, > 0 reading */
493 #if IN_LIBGCOV
494   /* Holds one block plus 4 bytes, thus all coverage reads & writes
495      fit within this buffer and we always can transfer GCOV_BLOCK_SIZE
496      to and from the disk. libgcov never backtracks and only writes 4
497      or 8 byte objects.  */
498   gcov_unsigned_t buffer[GCOV_BLOCK_SIZE + 1];
499 #else
500   int endian;                   /* Swap endianness.  */
501   /* Holds a variable length block, as the compiler can write
502      strings and needs to backtrack.  */
503   size_t alloc;
504   gcov_unsigned_t *buffer;
505 #endif
506 } gcov_var ATTRIBUTE_HIDDEN;



リンク元

Advertisement