Author: dgorbachev
Date: Mon Mar 15 18:03:37 2010
New Revision: 46211
URL:
http://svn.reactos.org/svn/reactos?rev=46211&view=rev
Log:
Update log2lines to ver. 2.2. Jan Roeloffzen, bug #4342.
Added:
trunk/reactos/tools/log2lines/match.c (with props)
trunk/reactos/tools/log2lines/match.h (with props)
Modified:
trunk/reactos/tools/log2lines/cache.c
trunk/reactos/tools/log2lines/cache.h
trunk/reactos/tools/log2lines/cmd.c
trunk/reactos/tools/log2lines/config.h
trunk/reactos/tools/log2lines/help.c
trunk/reactos/tools/log2lines/image.c
trunk/reactos/tools/log2lines/list.c
trunk/reactos/tools/log2lines/list.h
trunk/reactos/tools/log2lines/log2lines.c
trunk/reactos/tools/log2lines/log2lines.mak
trunk/reactos/tools/log2lines/options.c
trunk/reactos/tools/log2lines/options.h
trunk/reactos/tools/log2lines/revision.c
trunk/reactos/tools/log2lines/stat.c
trunk/reactos/tools/log2lines/util.c
trunk/reactos/tools/log2lines/util.h
trunk/reactos/tools/log2lines/version.h
Modified: trunk/reactos/tools/log2lines/cache.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/log2lines/cache.c?re…
==============================================================================
--- trunk/reactos/tools/log2lines/cache.c [iso-8859-1] (original)
+++ trunk/reactos/tools/log2lines/cache.c [iso-8859-1] Mon Mar 15 18:03:37 2010
@@ -4,6 +4,7 @@
*
* - Image directory caching
*/
+
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@@ -63,6 +64,14 @@
if (iso_copied)
remove(iso_tmp);
return res;
+}
+
+int
+cleanable(char *path)
+{
+ if (strcmp(basename(path),DEF_OPT_DIR) == 0)
+ return 1;
+ return 0;
}
int
@@ -135,7 +144,10 @@
cache_name = malloc(MAX_PATH);
tmp_name = malloc(MAX_PATH);
strcpy(cache_name, opt_dir);
- strcat(cache_name, PATH_STR CACHEFILE);
+ if (cleanable(opt_dir))
+ strcat(cache_name, ALT_PATH_STR CACHEFILE);
+ else
+ strcat(cache_name, PATH_STR CACHEFILE);
strcpy(tmp_name, cache_name);
strcat(tmp_name, "~");
return 0;
@@ -271,4 +283,4 @@
return 0;
}
-
+/* EOF */
Modified: trunk/reactos/tools/log2lines/cache.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/log2lines/cache.h?re…
==============================================================================
--- trunk/reactos/tools/log2lines/cache.h [iso-8859-1] (original)
+++ trunk/reactos/tools/log2lines/cache.h [iso-8859-1] Mon Mar 15 18:03:37 2010
@@ -10,5 +10,6 @@
int check_directory(int force);
int read_cache(void);
int create_cache(int force, int skipImageBase);
+int cleanable(char *path);
/* EOF */
Modified: trunk/reactos/tools/log2lines/cmd.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/log2lines/cmd.c?rev=…
==============================================================================
--- trunk/reactos/tools/log2lines/cmd.c [iso-8859-1] (original)
+++ trunk/reactos/tools/log2lines/cmd.c [iso-8859-1] Mon Mar 15 18:03:37 2010
@@ -4,6 +4,7 @@
*
* - Cli for escape commands
*/
+
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@@ -17,7 +18,7 @@
/* When you edit the cmd line and/or use the history instead of just typing,
* a bunch of editing BS and space characters
* is inserted, so the string looks right on the console but still
- * starts with the original string:
+ * contains the original string, plus other garbage:
*/
static char
*backSpaceEdit(char *s)
@@ -140,6 +141,39 @@
}
return changed;
+}
+
+static int
+handle_address_cmd(FILE *outFile, char *arg)
+{
+ PLIST_MEMBER plm;
+ char Image[NAMESIZE];
+ DWORD Offset;
+ int cnt;
+ char *s;
+
+ if(( s = strchr(arg, ':') ))
+ {
+ *s = ' ';
+ if ( (cnt = sscanf(arg,"%20s %lx", Image, &Offset)) == 2)
+ {
+ if (( plm = entry_lookup(&cache, Image) ))
+ {
+ if (plm->RelBase != INVALID_BASE)
+ esclog(outFile, "Address: 0x%lx\n", plm->RelBase + Offset)
+ else
+ esclog(outFile, "Relocated base missing for '%s'
('mod' will update)\n", Image);
+ }
+ else
+ esclog(outFile, "Image '%s' not found\n", Image);
+ }
+ else
+ esclog(outFile, "usage: `a <Image>:<offset>\n");
+ }
+ else
+ esclog(outFile, "':' expected\n");
+
+ return 1;
}
char
@@ -177,12 +211,15 @@
opt_cli = 1;
switch (cmd)
{
+ case 'a':
+ handle_address_cmd(outFile, arg);
+ break;
case 'h':
usage(1);
break;
case 'b':
if (handle_switch(outFile, &opt_buffered, arg, "-b Logfile
buffering"))
- set_LogFile(logFile); //re-open same logfile
+ set_LogFile(&logFile); //re-open same logfile
break;
case 'c':
handle_switch(outFile, &opt_console, NULL, "-c Console option");
@@ -191,8 +228,18 @@
handle_switch_str(outFile, opt_dir, NULL, "-d Directory option");
break;
case 'l':
- if (handle_switch_str(outFile, opt_logFile, arg, "-l logfile"))
- set_LogFile(logFile); //open new logfile
+ if (handle_switch_str(outFile, opt_logFile, arg, "-l logfile") ||
(strcmp(opt_mod,"a")!=0))
+ {
+ opt_mod = "a";
+ set_LogFile(&logFile); //open new logfile
+ }
+ break;
+ case 'L':
+ if (handle_switch_str(outFile, opt_logFile, arg, "-L logfile") ||
(strcmp(opt_mod,"w")!=0))
+ {
+ opt_mod = "w";
+ set_LogFile(&logFile); //open new logfile
+ }
break;
case 'm':
handle_switch(outFile, &opt_Mark, arg, "-m mark (*)");
@@ -212,8 +259,10 @@
break;
case 'R':
changed = handle_switch_pstr(outFile, &opt_Revision, arg, NULL);
+ opt_Revision_check = 0;
if (opt_Revision)
{
+ opt_Revision_check = 1;
if (strstr(opt_Revision, "check") == opt_Revision)
{
esclog(outFile, "-R is \"%s\" (%s)\n", opt_Revision,
changed ? "changed":"unchanged");
@@ -253,6 +302,7 @@
{
handle_switch(outFile, &opt_undo, "1", "-u Undo");
handle_switch(outFile, &opt_redo, "1", "-U Undo and
reprocess");
+ opt_Revision_check = 1;
}
esclog(outFile, "-S Sources option is %d+%d,\"%s\"\n",
opt_Source, opt_SrcPlus, opt_SourcesPath);
esclog(outFile, "(Setting source tree not implemented)\n");
@@ -289,3 +339,5 @@
return KDBG_ESC_CHAR; //handled escaped command
}
+
+/* EOF */
Modified: trunk/reactos/tools/log2lines/config.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/log2lines/config.h?r…
==============================================================================
--- trunk/reactos/tools/log2lines/config.h [iso-8859-1] (original)
+++ trunk/reactos/tools/log2lines/config.h [iso-8859-1] Mon Mar 15 18:03:37 2010
@@ -26,6 +26,11 @@
"%s x -y -r %s" PATH_STR "reactos" PATH_STR "reactos.cab
-o%s" \
PATH_STR "reactos" PATH_STR "reactos > " DEV_NULL
+/* When we can't use a normal path, because it gets cleaned,
+ * fallback to name mangling:
+ */
+#define ALT_PATH_STR "#"
+
#define LINESIZE 1024
#define NAMESIZE 80
Modified: trunk/reactos/tools/log2lines/help.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/log2lines/help.c?rev…
==============================================================================
--- trunk/reactos/tools/log2lines/help.c [iso-8859-1] (original)
+++ trunk/reactos/tools/log2lines/help.c [iso-8859-1] Mon Mar 15 18:03:37 2010
@@ -4,6 +4,7 @@
*
* - Help text and functions
*/
+
#include <stdio.h>
#include "version.h"
@@ -50,6 +51,9 @@
" -h This text.\n\n"
" -l <logFile>\n"
" <logFile>: Append copy to specified logFile.\n"
+" Default: no logFile\n\n"
+" -L <logFile>\n"
+" <logFile>: (Over)write copy to specified logFile.\n"
" Default: no logFile\n\n"
" -m Prefix (mark) each translated line with '* '.\n\n"
" -M Prefix (mark) each NOT translated line with '? '.\n"
@@ -112,7 +116,7 @@
" For a reliable result, these sources should be up to date with\n"
" the tested revision (or try '-R check').\n"
" Can be combined with -tTR.\n"
-" Implies -U (For retrieving source info).\n\n"
+" Implies -U (For retrieving source info) and -R check.\n\n"
" -t Translate twice. The address itself and for (address-1).\n"
" Show extra filename, func and linenumber between [..] if they
differ\n"
" So if only the linenumbers differ, then only show the extra\n"
@@ -139,7 +143,10 @@
" Options accepting a string as argument can be cleared by the value '"
KDBG_ESC_OFF "'.\n"
" Some ClI commands are read only or not (entirely) implemented.\n"
" If no value is provided, the current one is printed.\n"
-" There are only a few extra ClI commands or with different behaviour:\n"
+" There are a few extra ClI commands or with different behaviour:\n"
+" - `a <module>:<reladdress>:\n"
+" - Outputs absolute address e.g. for setting breakpoints.\n"
+" - Do a 'mod' first to retrieve relocation info.\n"
" - `h : shows this helptext (without exiting)\n"
" - `q : quits log2lines\n"
" - `R regscan : the output is printed immediately (do a 'bt'
first)\n"
@@ -233,7 +240,14 @@
" | L2L- -l logfile is \"new.log\" (changed)\n"
" kdb:> `l off\n"
" | L2L- -l logfile is "" (changed)\n"
-" kdb:>\n"
+" kdb:>\n\n"
+" Set a breakpoint with help of 'mod' and '`a':\n"
+" <msi.dll:2e35d (dll/win32/msi/msiquery.c:189
(MSI_IterateRecords))>\n"
+" kdb:> mod (for kernel tracing usually only needed once)\n"
+" -- mod output with reloc info\n"
+" kdb:> `a msi.dll:2e35d\n"
+" | L2L- Address: 0x00096ca0\n"
+" kdb:> bpx 0x00096ca0\n\n"
"\n";
void
@@ -246,3 +260,5 @@
else
fprintf(stderr, "Try log2lines -h\n");
}
+
+/* EOF */
Modified: trunk/reactos/tools/log2lines/image.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/log2lines/image.c?re…
==============================================================================
--- trunk/reactos/tools/log2lines/image.c [iso-8859-1] (original)
+++ trunk/reactos/tools/log2lines/image.c [iso-8859-1] Mon Mar 15 18:03:37 2010
@@ -4,11 +4,12 @@
*
* - Image functions for symbol info
*/
-#include <sys/stat.h>
+
#include <errno.h>
#include <string.h>
#include <rsym.h>
+#include "compat.h"
#include "util.h"
#include "options.h"
#include "log2lines.h"
@@ -163,3 +164,5 @@
fclose(fr);
return 0;
}
+
+/* EOF */
Modified: trunk/reactos/tools/log2lines/list.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/log2lines/list.c?rev…
==============================================================================
--- trunk/reactos/tools/log2lines/list.c [iso-8859-1] (original)
+++ trunk/reactos/tools/log2lines/list.c [iso-8859-1] Mon Mar 15 18:03:37 2010
@@ -9,6 +9,7 @@
#include <string.h>
#include <stdlib.h>
+#include "config.h"
#include "compat.h"
#include "list.h"
#include "util.h"
@@ -162,6 +163,8 @@
l2l_dbg(1, "ImageBase field missing\n");
return entry_delete(pentry);
}
+ pentry->RelBase = INVALID_BASE;
+ pentry->Size = 0;
return pentry;
}
@@ -212,3 +215,5 @@
return pentry;
}
+
+/* EOF */
Modified: trunk/reactos/tools/log2lines/list.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/log2lines/list.h?rev…
==============================================================================
--- trunk/reactos/tools/log2lines/list.h [iso-8859-1] (original)
+++ trunk/reactos/tools/log2lines/list.h [iso-8859-1] Mon Mar 15 18:03:37 2010
@@ -6,14 +6,16 @@
char *name;
char *path;
size_t ImageBase;
+ size_t RelBase;
+ size_t Size;
struct entry_struct *pnext;
-} LIST_MEMBER,*PLIST_MEMBER;
+} LIST_MEMBER, *PLIST_MEMBER;
typedef struct list_struct
{
PLIST_MEMBER phead;
PLIST_MEMBER ptail;
-} LIST,*PLIST;
+} LIST, *PLIST;
PLIST_MEMBER entry_lookup(PLIST list, char *name);
PLIST_MEMBER entry_delete(PLIST_MEMBER pentry);
Modified: trunk/reactos/tools/log2lines/log2lines.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/log2lines/log2lines.…
==============================================================================
--- trunk/reactos/tools/log2lines/log2lines.c [iso-8859-1] (original)
+++ trunk/reactos/tools/log2lines/log2lines.c [iso-8859-1] Mon Mar 15 18:03:37 2010
@@ -19,10 +19,13 @@
#include "log2lines.h"
#include "help.h"
#include "cmd.h"
-
-
-static FILE *stdIn = NULL;
-static FILE *stdOut = NULL;
+#include "match.h"
+
+
+static FILE *dbgIn = NULL;
+static FILE *dbgOut = NULL;
+static FILE *conIn = NULL;
+static FILE *conOut = NULL;
static const char *kdbg_prompt = KDBG_PROMPT;
static const char *kdbg_cont = KDBG_CONT;
@@ -443,15 +446,18 @@
{
if (p == p_eos)
{
- //kdbg prompt, so already echoed char by char
+ // kdbg prompt, so already echoed char by char
memset(Line, '\0', LINESIZE);
translate_char(c, outFile);
}
else
{
- translate_line(outFile, Line, path, LineOut);
- translate_char(c, outFile);
- report(outFile);
+ if (match_line(outFile, Line))
+ {
+ translate_line(outFile, Line, path, LineOut);
+ translate_char(c, outFile);
+ report(outFile);
+ }
}
}
}
@@ -562,8 +568,10 @@
int res = 0;
int optCount = 0;
- stdIn = stdin;
- stdOut = stdout;
+ dbgIn = stdin;
+ conOut = stdout;
+ (void)conIn;
+ (void)dbgOut;
memset(&cache, 0, sizeof(LIST));
memset(&sources, 0, sizeof(LIST));
@@ -596,7 +604,7 @@
read_cache();
l2l_dbg(4, "Cache read complete\n");
- if (set_LogFile(logFile))
+ if (set_LogFile(&logFile))
return 2;
l2l_dbg(4, "opt_logFile processed\n");
@@ -604,9 +612,9 @@
{
l2l_dbg(3, "Command line: \"%s\"\n",opt_Pipe);
- if (!(stdIn = POPEN(opt_Pipe, "r")))
- {
- stdIn = stdin; //restore
+ if (!(dbgIn = POPEN(opt_Pipe, "r")))
+ {
+ dbgIn = stdin; //restore
l2l_dbg(0, "Could not popen '%s' (%s)\n", opt_Pipe,
strerror(errno));
free(opt_Pipe); opt_Pipe = NULL;
}
@@ -631,7 +639,7 @@
l2l_dbg(2, "translating %s %s\n", exefile, offset);
translate_file(exefile, my_atoi(offset), Line);
printf("%s\n", Line);
- report(stdOut);
+ report(conOut);
}
else
{
@@ -649,14 +657,16 @@
}
else
{ // translate logging from stdin
- translate_files(stdIn, stdOut);
+ translate_files(dbgIn, conOut);
}
if (logFile)
fclose(logFile);
if (opt_Pipe)
- PCLOSE(stdIn);
+ PCLOSE(dbgIn);
return res;
}
+
+/* EOF */
Modified: trunk/reactos/tools/log2lines/log2lines.mak
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/log2lines/log2lines.…
==============================================================================
--- trunk/reactos/tools/log2lines/log2lines.mak [iso-8859-1] (original)
+++ trunk/reactos/tools/log2lines/log2lines.mak [iso-8859-1] Mon Mar 15 18:03:37 2010
@@ -31,6 +31,7 @@
$(LOG2LINES_BASE_)stat.c \
$(LOG2LINES_BASE_)revision.c \
$(LOG2LINES_BASE_)cmd.c \
+ $(LOG2LINES_BASE_)match.c \
$(LOG2LINES_BASE_)log2lines.c \
$(RSYM_BASE_)rsym_common.c
@@ -88,6 +89,10 @@
$(ECHO_HOSTCC)
${host_gcc} $(LOG2LINES_HOST_CFLAGS) -c $< -o $@
+$(LOG2LINES_INT_)match.o: $(LOG2LINES_BASE_)match.c | $(LOG2LINES_INT)
+ $(ECHO_HOSTCC)
+ ${host_gcc} $(LOG2LINES_HOST_CFLAGS) -c $< -o $@
+
.PHONY: log2lines_clean
log2lines_clean:
-@$(rm) $(LOG2LINES_TARGET) $(LOG2LINES_OBJECTS) 2>$(NUL)
Added: trunk/reactos/tools/log2lines/match.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/log2lines/match.c?re…
==============================================================================
--- trunk/reactos/tools/log2lines/match.c (added)
+++ trunk/reactos/tools/log2lines/match.c [iso-8859-1] Mon Mar 15 18:03:37 2010
@@ -1,0 +1,91 @@
+/*
+ * ReactOS log2lines
+ * Written by Jan Roeloffzen
+ *
+ * - Custom match routines
+ */
+
+#include <string.h>
+
+#include "config.h"
+#include "log2lines.h"
+#include "match.h"
+
+// break pattern: show source+line
+static int match_break(FILE *outFile, char *Line, int processed)
+{
+ static int state = 0;
+
+ if ( processed ) return processed;
+ switch (state)
+ {
+ case 1:
+ state = 0;
+ break;
+ default:
+ state = 0;
+ }
+ return 1;
+}
+// "mod" command: update relocated addresses
+static int match_mod(FILE *outFile, char *Line, int processed)
+{
+ static int state = 0;
+ char Image[NAMESIZE];
+ DWORD Base;
+ DWORD Size;
+ PLIST_MEMBER plm;
+
+ int cnt;
+
+ if ( processed ) return processed;
+ if ( (cnt = sscanf(Line," Base Size %5s", Image)) == 1 )
+ {
+ l2l_dbg(1, "Module relocate list:\n");
+ state = 1;
+ return 0;
+ }
+ switch (state)
+ {
+ case 1:
+ if ( (cnt = sscanf(Line,"%lx %lx %20s", &Base, &Size, Image))
== 3 )
+ {
+ if (( plm = entry_lookup(&cache, Image) ))
+ {
+ plm->RelBase = Base;
+ plm->Size = Size;
+ l2l_dbg(1, "Relocated: %s %08x -> %08x\n", Image,
plm->ImageBase, plm->RelBase);
+ }
+ return 0;
+ }
+ else
+ {
+ state = 0;
+ }
+ break;
+ default:
+ state = 0;
+ }
+ return 1;
+}
+
+int match_line(FILE *outFile, char *Line)
+{
+ int processed = 1;
+
+ if ( *Line == '\n' || *Line == '\0' )
+ return 1;
+ if ( strncmp(Line, KDBG_CONT, sizeof(KDBG_CONT)-1 ) == 0 )
+ return 1;
+
+ processed = match_mod(outFile, Line, processed);
+ processed = match_break(outFile, Line, processed);
+ /* more to be appended here:
+ * processed = match_xxx(outFile, Line, processed );
+ * ...
+ */
+
+ return (int)(Line[0]);
+}
+
+/* EOF */
Propchange: trunk/reactos/tools/log2lines/match.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/tools/log2lines/match.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/log2lines/match.h?re…
==============================================================================
--- trunk/reactos/tools/log2lines/match.h (added)
+++ trunk/reactos/tools/log2lines/match.h [iso-8859-1] Mon Mar 15 18:03:37 2010
@@ -1,0 +1,5 @@
+#include "util.h"
+
+int match_line(FILE *outFile, char *Line);
+
+/* EOF */
Propchange: trunk/reactos/tools/log2lines/match.h
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/tools/log2lines/options.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/log2lines/options.c?…
==============================================================================
--- trunk/reactos/tools/log2lines/options.c [iso-8859-1] (original)
+++ trunk/reactos/tools/log2lines/options.c [iso-8859-1] Mon Mar 15 18:03:37 2010
@@ -4,6 +4,7 @@
*
* - Option init and parsing
*/
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -16,7 +17,7 @@
#include "log2lines.h"
#include "options.h"
-char *optchars = "bcd:fFhl:mMP:rR:sS:tTuUvz:";
+char *optchars = "bcd:fFhl:L:mMP:rR:sS:tTuUvz:";
int opt_buffered = 0; // -b
int opt_help = 0; // -h
int opt_force = 0; // -f
@@ -37,8 +38,10 @@
int opt_undo = 0; // -u
int opt_redo = 0; // -U
char *opt_Revision = NULL; // -R
+int opt_Revision_check = 0; // -R check
char opt_dir[MAX_PATH]; // -d <opt_dir>
-char opt_logFile[MAX_PATH]; // -l <opt_logFile>
+char opt_logFile[MAX_PATH]; // -l|L <opt_logFile>
+char *opt_mod = NULL; // -mod for opt_logFile
char opt_7z[MAX_PATH]; // -z <opt_7z>
char opt_scanned[LINESIZE]; // all scanned options
char opt_SourcesPath[LINESIZE]; //sources path
@@ -48,6 +51,7 @@
int i;
char *s;
+ opt_mod = "a";
strcpy(opt_dir, "");
strcpy(opt_logFile, "");
strcpy(opt_7z, CMD_7Z);
@@ -70,6 +74,9 @@
case 'd':
strcpy(opt_dir, argv[i+1]);
break;
+ case 'L':
+ opt_mod = "w";
+ //fall through
case 'l':
strcpy(opt_logFile, argv[i+1]);
break;
@@ -146,6 +153,8 @@
free(opt_Revision);
opt_Revision = malloc(LINESIZE);
sscanf(optarg, "%s", opt_Revision);
+ if (strcmp(opt_Revision, "check") == 0)
+ opt_Revision_check ++;
break;
case 's':
opt_stats++;
@@ -161,6 +170,7 @@
/* need to retranslate for source info: */
opt_undo++;
opt_redo++;
+ opt_Revision_check ++;
}
break;
case 't':
@@ -208,3 +218,5 @@
return optCount;
}
+
+/* EOF */
Modified: trunk/reactos/tools/log2lines/options.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/log2lines/options.h?…
==============================================================================
--- trunk/reactos/tools/log2lines/options.h [iso-8859-1] (original)
+++ trunk/reactos/tools/log2lines/options.h [iso-8859-1] Mon Mar 15 18:03:37 2010
@@ -28,8 +28,10 @@
extern int opt_undo ; // -u
extern int opt_redo ; // -U
extern char *opt_Revision; // -R
+extern int opt_Revision_check; // -R check
extern char opt_dir[]; // -d <opt_dir>
extern char opt_logFile[]; // -l <opt_logFile>
+extern char *opt_mod; // mod for opt_logFile
extern char opt_7z[]; // -z <opt_7z>
extern char opt_scanned[]; // all scanned options
Modified: trunk/reactos/tools/log2lines/revision.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/log2lines/revision.c…
==============================================================================
--- trunk/reactos/tools/log2lines/revision.c [iso-8859-1] (original)
+++ trunk/reactos/tools/log2lines/revision.c [iso-8859-1] Mon Mar 15 18:03:37 2010
@@ -29,7 +29,7 @@
if (revinfo.opt_verbose)
log(outFile, "| R--- %s Last Changed Rev: %d\n", s, rev);
- if (rev && opt_Revision)
+ if (rev && opt_Revision_check)
{
if (revinfo.rev < revinfo.buildrev)
{
@@ -128,9 +128,7 @@
void
reportRevision(FILE *outFile)
{
- if (!opt_Revision)
- return;
- if (strcmp(opt_Revision, "check") == 0)
+ if (opt_Revision_check)
{
if (lastLine.valid)
logRevCheck(outFile);
@@ -297,3 +295,5 @@
return res;
}
+
+/* EOF */
Modified: trunk/reactos/tools/log2lines/stat.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/log2lines/stat.c?rev…
==============================================================================
--- trunk/reactos/tools/log2lines/stat.c [iso-8859-1] (original)
+++ trunk/reactos/tools/log2lines/stat.c [iso-8859-1] Mon Mar 15 18:03:37 2010
@@ -42,3 +42,5 @@
{
memset(psumm, 0, sizeof(SUMM));
}
+
+/* EOF */
Modified: trunk/reactos/tools/log2lines/util.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/log2lines/util.c?rev…
==============================================================================
--- trunk/reactos/tools/log2lines/util.c [iso-8859-1] (original)
+++ trunk/reactos/tools/log2lines/util.c [iso-8859-1] Mon Mar 15 18:03:37 2010
@@ -16,25 +16,25 @@
#include "options.h"
int
-set_LogFile(FILE *logFile)
+set_LogFile(FILE **plogFile)
{
if (*opt_logFile)
{
- if (logFile)
- fclose(logFile);
- logFile = NULL;
+ if (*plogFile)
+ fclose(*plogFile);
+ *plogFile = NULL;
if (strcmp(opt_logFile,"none") == 0)
return 0; //just close
- logFile = fopen(opt_logFile, "a");
- if (logFile)
+ *plogFile = fopen(opt_logFile, opt_mod ? opt_mod : "a");
+ if (*plogFile)
{
// disable buffering so fflush is not needed
if (!opt_buffered)
{
l2l_dbg(1, "Disabling log buffering on %s\n", opt_logFile);
- setbuf(logFile, NULL);
+ setbuf(*plogFile, NULL);
}
else
l2l_dbg(1, "Enabling log buffering on %s\n", opt_logFile);
@@ -186,3 +186,5 @@
}
return 0;
}
+
+/* EOF */
Modified: trunk/reactos/tools/log2lines/util.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/log2lines/util.h?rev…
==============================================================================
--- trunk/reactos/tools/log2lines/util.h [iso-8859-1] (original)
+++ trunk/reactos/tools/log2lines/util.h [iso-8859-1] Mon Mar 15 18:03:37 2010
@@ -10,6 +10,7 @@
#include <stdio.h>
#include "cmd.h"
+#include "options.h"
#define log(outFile, fmt, ...) \
{ \
@@ -44,6 +45,6 @@
long my_atoi(const char *a);
int isOffset(const char *a);
int copy_file(char *src, char *dst);
-int set_LogFile(FILE *logFile);
+int set_LogFile(FILE **plogFile);
/* EOF */
Modified: trunk/reactos/tools/log2lines/version.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/log2lines/version.h?…
==============================================================================
--- trunk/reactos/tools/log2lines/version.h [iso-8859-1] (original)
+++ trunk/reactos/tools/log2lines/version.h [iso-8859-1] Mon Mar 15 18:03:37 2010
@@ -7,6 +7,6 @@
#pragma once
-#define LOG2LINES_VERSION "2.1"
+#define LOG2LINES_VERSION "2.2"
/* EOF */