Lines Matching refs:FILE
27 // This file is part of ThreadSanitizer, a dynamic data race detector.
32 // Reads program events from a file and detects races.
56 //------------- Read binary file Utils ------------ {{{1
60 static bool Read(FILE *fp, T *res) {
72 static bool ReadANSI(FILE *file, string *res) {
75 if (!Read<unsigned short>(file, &length)) {
78 int size = fread(buf, 1, (int)length, file);
100 static void SkipCommentText(FILE *file) {
104 int c = fgetc(file);
117 char file[kBufSize];
121 img, rtn, file, &line) == 5 &&
127 pc_info.file_name = file;
139 static void SkipWhiteSpaceAndComments(FILE *file) {
142 c = fgetc(file);
145 SkipCommentText(file);
151 ungetc(c, file);
154 typedef bool (*EventReader)(FILE *, Event *);
156 bool ReadOneStrEventFromFile(FILE *file, Event *event) {
161 SkipWhiteSpaceAndComments(file);
163 if (5 == fscanf(file, "%s%x%lx%lx%lx", name, &tid, &pc, &a, &info)) {
170 bool ProcessCodePosition(FILE *input, int *pc, string *str) {
176 bool ProcessMessage(FILE *input, string *str) {
181 bool ProcessEvent(FILE *input, EventType type, Event *event) {
226 bool ReadOneBinEventFromFile(FILE *input, Event *event) {
234 char file[kBufSize];
244 if (sscanf(str.c_str(), "%s %s %d", rtn, file, &line) == 3 && pc != 0) {
249 pc_info.file_name = file;
267 void DecodeEventsFromFile(FILE *input, FILE *output) {
304 INLINE void ReadEventsFromFile(FILE *file, EventReader event_reader_cb) {
308 while (event_reader_cb(file, &event)) {
343 string img, rtn, file;
345 PcToStrings(pc, demangle, &img, &rtn, &file, &line);
364 FILE* output;