53#define GCOV_MODE_STDIN 2
97#if !IN_LIBGCOV || defined (IN_GCOV_TOOL)
99 return __builtin_bswap32 (value);
117 struct flock s_flock;
123 s_flock.l_pid = getpid ();
124#elif GCOV_LOCKED_WITH_LOCKING
130#if !IN_LIBGCOV || defined (IN_GCOV_TOOL)
147 s_flock.l_type = F_RDLCK;
149 fd = open (name,
O_RDONLY, S_IRUSR | S_IWUSR);
154 s_flock.l_type = F_WRLCK;
156 fd = open (name, O_RDWR | O_CREAT | (mode < 0 ? O_TRUNC : 0), 0666);
161 while (fcntl (fd, F_SETLKW, &s_flock) &&
errno == EINTR)
171#elif GCOV_LOCKED_WITH_LOCKING
180 fd = open (name, O_RDWR |
O_BINARY | O_CREAT | (mode < 0 ? O_TRUNC : 0),
186 if (_locking (fd, _LK_LOCK,
LONG_MAX) < 0)
241#if !IN_LIBGCOV || defined (IN_GCOV_TOOL)
249 if (magic == expected)
252 if (__builtin_bswap32 (magic) == expected)
292 length = strlen (
string) + 1;
311 if (profile_abs_path_flag && filename && filename[0]
312 && !(IS_DIR_SEPARATOR (filename[0])
313#
if HAVE_DOS_BASED_FILE_SYSTEM
314 || filename[1] ==
':'
318 char *buf = getcwd (
NULL, 0);
319 if (buf !=
NULL && buf[0])
321 size_t len = strlen (buf);
322 buf = (
char*)xrealloc (buf, len + strlen (filename) + 2);
323 if (!IS_DIR_SEPARATOR (buf[len - 1]))
325 strcat (buf, filename);
378gcov_write_object_summary (
const struct gcov_summary *summary)
468 char *buffer = (
char *)xmalloc (strlen (base) + 1);
471#if HAVE_DOS_BASED_FILE_SYSTEM
472 if (base[0] && base[1] ==
':')
480 for (; *base; base = probe)
484 for (probe = base; *probe; probe++)
488 if (len == 2 && base[0] ==
'.' && base[1] ==
'.')
492 memcpy (ptr, base, len);
510#if !IN_LIBGCOV || defined (IN_GCOV_TOOL)
523 void *buffer = XNEWVEC (
char *, length);
537#if !IN_LIBGCOV || defined (IN_GCOV_TOOL)
572 return status.st_mtime;
Definition genoutput.cc:150
int64_t gcov_type
Definition coretypes.h:46
#define GCOV_LINKAGE
Definition coverage.cc:25
static unsigned int count[debug_counter_number_of_counters]
Definition dbgcnt.cc:50
static unsigned int current_position
Definition dse.cc:604
static void * gcov_read_bytes(void *buffer, unsigned count)
Definition gcov-io.cc:394
GCOV_LINKAGE void gcov_write_length(gcov_position_t position)
Definition gcov-io.cc:362
GCOV_LINKAGE void gcov_sync(gcov_position_t base, gcov_unsigned_t length)
Definition gcov-io.cc:542
static void gcov_seek(gcov_position_t base)
Definition gcov-io.cc:338
GCOV_LINKAGE void gcov_write_unsigned(gcov_unsigned_t value)
Definition gcov-io.cc:275
GCOV_LINKAGE void gcov_write(const void *data, unsigned length)
Definition gcov-io.cc:265
char * mangle_path(char const *base)
Definition gcov-io.cc:463
static gcov_unsigned_t * gcov_read_words(void *buffer, unsigned)
Definition gcov-io.cc:416
gcov_file_error
Definition gcov-io.cc:35
@ GCOV_FILE_WRITE_ERROR
Definition gcov-io.cc:38
@ GCOV_FILE_COUNTER_OVERFLOW
Definition gcov-io.cc:36
@ GCOV_FILE_NO_ERROR
Definition gcov-io.cc:37
@ GCOV_FILE_EOF
Definition gcov-io.cc:39
GCOV_LINKAGE gcov_position_t gcov_write_tag(gcov_unsigned_t tag)
Definition gcov-io.cc:347
static int gcov_is_error(void)
Definition gcov-io.cc:76
static gcov_unsigned_t from_file(gcov_unsigned_t value)
Definition gcov-io.cc:95
GCOV_LINKAGE gcov_type gcov_read_counter(void)
Definition gcov-io.cc:442
GCOV_LINKAGE int gcov_open(const char *name, int mode)
Definition gcov-io.cc:114
static gcov_position_t gcov_position(void)
Definition gcov-io.cc:61
GCOV_LINKAGE int gcov_magic(gcov_unsigned_t magic, gcov_unsigned_t expected)
Definition gcov-io.cc:247
#define GCOV_MODE_STDIN
Definition gcov-io.cc:53
GCOV_LINKAGE void gcov_write_filename(const char *filename)
Definition gcov-io.cc:309
GCOV_LINKAGE void gcov_write_string(const char *string)
Definition gcov-io.cc:287
GCOV_LINKAGE gcov_unsigned_t gcov_read_unsigned(void)
Definition gcov-io.cc:425
GCOV_LINKAGE int gcov_close(void)
Definition gcov-io.cc:223
GCOV_LINKAGE void gcov_read_summary(struct gcov_summary *summary)
Definition gcov-io.cc:529
GCOV_LINKAGE const char * gcov_read_string(void)
Definition gcov-io.cc:516
unsigned gcov_unsigned_t
Definition gcov-io.h:192
#define GCOV_TAG_OBJECT_SUMMARY
Definition gcov-io.h:271
#define gcov_nonruntime_assert(EXPR)
Definition gcov-io.h:227
#define GCOV_WORD_SIZE
Definition gcov-io.h:255
unsigned gcov_position_t
Definition gcov-io.h:193
#define GCOV_TAG_OBJECT_SUMMARY_LENGTH
Definition gcov-io.h:272
#define LONG_MAX
Definition glimits.h:96
poly_int< N, C > r
Definition poly-int.h:774
gcov_type sum_max
Definition gcov-io.h:348
gcov_unsigned_t runs
Definition gcov-io.h:347
int endian
Definition gcov-io.cc:47
int mode
Definition gcov-io.cc:46
enum gcov_file_error error
Definition gcov-io.cc:45
FILE * file
Definition gcov-io.cc:44
Definition genrecog.cc:213
#define NULL
Definition system.h:50
#define SEEK_SET
Definition system.h:370
#define O_BINARY
Definition system.h:387
#define O_RDONLY
Definition system.h:381
#define fopen(PATH, MODE)
Definition system.h:62
#define fdopen(FILDES, MODE)
Definition system.h:63