#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "util.h"
#include "version.h"
#include "compat.h"
#include "options.h"
#include "image.h"
#include "cache.h"
#include "log2lines.h"
#include "help.h"
#include "cmd.h"
#include "match.h"
Go to the source code of this file.
|
static void | clearLastLine (void) |
|
static void | log_file (FILE *outFile, char *fileName, int line) |
|
static void | logSource (FILE *outFile) |
|
static void | reportSource (FILE *outFile) |
|
static void | report (FILE *outFile) |
|
static int | print_offset (void *data, size_t offset, char *toString) |
|
static int | process_data (const void *FileData, size_t offset, char *toString) |
|
static int | process_file (const char *file_name, size_t offset, char *toString) |
|
static int | translate_file (const char *cpath, size_t offset, char *toString) |
|
static void | translate_char (int c, FILE *outFile) |
|
static char * | remove_mark (char *Line) |
|
static void | translate_line (FILE *outFile, char *Line, char *path, char *LineOut) |
|
static int | translate_files (FILE *inFile, FILE *outFile) |
|
int | main (int argc, const char **argv) |
|
◆ clearLastLine()
◆ log_file()
Definition at line 46 of file log2lines.c.
47{
51
54
57 {
61 {
63 {
65 log(outFile,
"| ----\n");
66 log(outFile,
"| %4.4d %s",
i + 1,
s);
67 }
69 }
72 log(outFile,
"| S--- source has only %d lines! (check source/revision)\n",
i);
73 }
74 else
76}
char * strcat(char *DstString, const char *SrcString)
char * strcpy(char *DstString, const char *SrcString)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
_Check_return_opt_ _CRTIMP char *__cdecl fgets(_Out_writes_z_(_MaxCount) char *_Buf, _In_ int _MaxCount, _Inout_ FILE *_File)
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
◆ logSource()
◆ main()
Definition at line 547 of file log2lines.c.
548{
550 int optInit = 0;
551 int optCount = 0;
552
557
562
565
566 if (optCount < 0 || optInit < 0)
567 {
570 }
571
573
575 {
578 }
579
582 {
585 }
586
588 l2l_dbg(4,
"Cache read complete\n");
589
591 {
594 }
595 l2l_dbg(4,
"opt_logFile processed\n");
596
598 {
600
602 {
607 }
608 }
609 l2l_dbg(4,
"opt_Pipe processed\n");
610
612 {
614 const char *exefile =
NULL;
619
620
622 {
625 {
626 if (exefile)
627 {
629
633 }
634 else
635 {
636 l2l_dbg(0,
"<exefile> expected\n");
638 break;
639 }
640 }
641 else
642 {
643
645 }
646 }
647 }
648 else
649 {
651 }
652
655
658
660
662 {
665 }
666
669
671}
static UINT check_directory(MSIPACKAGE *package, const WCHAR *dir, WCHAR **appValue)
static void cleanup(void)
static int translate_files(FILE *inFile, FILE *outFile)
static void report(FILE *outFile)
static void translate_line(FILE *outFile, char *Line, char *path, char *LineOut)
static void clearLastLine(void)
#define create_cache(iid)
const char * strerror(int err)
◆ print_offset()
Definition at line 107 of file log2lines.c.
108{
112 int bFileOffsetChanged = 0;
115
119 {
121
124 else
126
128 {
131
132 }
133 }
135 {
141 if (e2)
142 {
147 bFileOffsetChanged =
e->FileOffset != e2->
FileOffset;
150
151
152
153
154
155
157 if (bFileOffsetChanged)
159 else
161
163 if (
e->SourceLine != e2->
SourceLine || bFileOffsetChanged)
165 else
167
171 else
173
174 if (toString)
175 {
179 (
unsigned int)
e->SourceLine,
183 }
184 else
185 {
190 (
unsigned int)
e->SourceLine,
194 }
195 }
196 else
197 {
198 if (toString)
199 {
202 (
unsigned int)
e->SourceLine,
204 }
205 else
206 {
209 (
unsigned int)
e->SourceLine,
211 }
212 }
213 return 0;
214 }
215 return 1;
216}
static const WCHAR Strings[]
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
struct _SYMBOLFILE_HEADER * PSYMBOLFILE_HEADER
Referenced by process_data().
◆ process_data()
Definition at line 219 of file log2lines.c.
220{
222
224 if (!PERosSymSectionHeader)
225 return 2;
226
229 {
230 if (toString)
232 else
236 }
237
239}
static FILEDATA FileData[MAX_FDS]
static int print_offset(void *data, size_t offset, char *toString)
#define sprintf(buf, format,...)
Referenced by process_file().
◆ process_file()
Definition at line 242 of file log2lines.c.
243{
247
250 {
252 }
253 else
254 {
257 }
259}
static UINT load_file(MSIRECORD *row, LPVOID param)
_Must_inspect_result_ _Out_ PLARGE_INTEGER FileSize
static int process_data(const void *FileData, size_t offset, char *toString)
Referenced by translate_file().
◆ remove_mark()
static char * remove_mark |
( |
char * |
Line | ) |
|
|
static |
◆ report()
◆ reportSource()
static void reportSource |
( |
FILE * |
outFile | ) |
|
|
static |
Definition at line 90 of file log2lines.c.
91{
93 return;
96}
static void logSource(FILE *outFile)
Referenced by report().
◆ translate_char()
Definition at line 304 of file log2lines.c.
305{
309}
_Check_return_opt_ _CRTIMP int __cdecl fputc(_In_ int _Ch, _Inout_ FILE *_File)
Referenced by translate_files().
◆ translate_file()
Definition at line 262 of file log2lines.c.
263{
268
271 return 1;
272
273
275 {
277 if (pentry)
278 {
282 {
283 l2l_dbg(1,
"No, or invalid base address: %s\n",
path);
285 }
286 }
287 else
288 {
291 }
292 }
293
295 {
297 }
298
301}
static int process_file(const char *file_name, size_t offset, char *toString)
char * convert_path(char *origpath)
Referenced by translate_line().
◆ translate_files()
static int translate_files |
( |
FILE * |
inFile, |
|
|
FILE * |
outFile |
|
) |
| |
|
static |
Definition at line 409 of file log2lines.c.
410{
415 unsigned char ch;
420
423 {
425 {
427
428 ch = (
unsigned char)
c;
430 {
431 switch (ch)
432 {
433 case '\n':
435 {
437 }
438 else
439 {
442 {
444 {
445
448 }
449 else
450 {
452 {
456 }
457 }
458 }
459 }
463 break;
464 case '<':
467 break;
468 case '>':
470 {
473 }
474
476 {
478 {
481 }
482 else
483 {
486 }
487 }
488 else
491 break;
492 default:
494 if (ch == *pc)pc++;
496 {
499 {
501 }
502 else if (!*pc)
503 {
506 }
507 }
508 else
509 {
513 }
514 }
515 }
516 else
518 }
519 }
520 else
521 {
523 {
525
527 {
530 }
531 else
533 }
534 }
535
537 {
541 }
542 return 0;
543}
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
_Check_return_opt_ _CRTIMP int __cdecl fgetc(_Inout_ FILE *_File)
int match_line(FILE *outFile, char *Line)
static const char * kdbg_prompt
static void translate_char(int c, FILE *outFile)
static const char * kdbg_cont
Referenced by main().
◆ translate_line()
Definition at line 321 of file log2lines.c.
322{
325 char *sep, *
tail, *mark, *
s;
326 unsigned char ch;
327
329 return;
330
332 mark = "";
335 {
336
341 }
342
344 if (sep)
345 {
346 *sep = ' ';
349 {
350 if (cnt == 3 && ch == ' ')
351 {
355 {
360 {
363 }
364 else
365 {
368 }
369 }
370 else
371 {
374 }
376 }
377 }
378
380 {
381 if (cnt == 3 && ch == '>')
382 {
385 {
389 }
390 else
391 {
394 }
396 }
397 }
398 }
400 {
401 if (sep)
402 *sep = ':';
403 log(outFile,
"%s%s", mark,
s);
404 }
406}
int strcmp(const char *String1, const char *String2)
char * strchr(const char *String, int ch)
struct outqueuenode * tail
GLenum GLuint GLenum GLsizei const GLchar * buf
_Check_return_ _CRTIMP int __cdecl sscanf(_In_z_ const char *_Src, _In_z_ _Scanf_format_string_ const char *_Format,...)
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
static int translate_file(const char *cpath, size_t offset, char *toString)
static char * remove_mark(char *Line)
Referenced by main(), and translate_files().
◆ cache
◆ conIn
◆ conOut
◆ dbgIn
◆ dbgOut
◆ kdbg_cont
◆ kdbg_prompt
◆ lastLine
◆ logFile
◆ sources
◆ summ