[Pkg-clamav-commits] [SCM] Debian repository for ClamAV branch, debian/unstable, updated. debian/0.95+dfsg-1-6156-g094ec9b

Török Edvin edwin at clamav.net
Sun Apr 4 01:11:25 UTC 2010


The following commit has been merged in the debian/unstable branch:
commit acb53e3a4109366fbd6f9227d81ecffddfa8d0e9
Author: Török Edvin <edwin at clamav.net>
Date:   Thu Dec 10 15:17:40 2009 +0200

    Allow controlling trace level from cmdline.

diff --git a/clambc/bcrun.c b/clambc/bcrun.c
index 5c9c6e6..4fca539 100644
--- a/clambc/bcrun.c
+++ b/clambc/bcrun.c
@@ -47,6 +47,8 @@ static void help(void)
     printf("clambc <file> [function] [param1 ...]\n\n");
     printf("    --help                 -h         Show help\n");
     printf("    --version              -V         Show version\n");
+    printf("    --trace <level>                   Set bytecode trace level 0..7 (default 7)\n");
+    printf("    --no-trace-showsource             Don't show source line during tracing\n");
     printf("    file                              file to test\n");
     printf("\n");
     return;
@@ -120,6 +122,7 @@ int main(int argc, char *argv[])
     unsigned funcid=0, i;
     struct cli_all_bc bcs;
     unsigned int fd = -1;
+    unsigned tracelevel;
 
     opts = optparse(NULL, argc, argv, 1, OPT_CLAMBC, 0, NULL);
     if (!opts) {
@@ -203,8 +206,9 @@ int main(int argc, char *argv[])
     dbg_state.file = "<libclamav>";
     dbg_state.line = 0;
     dbg_state.col = 0;
-    dbg_state.showline = 1;
-    cli_bytecode_context_set_trace(ctx, trace_val,
+    dbg_state.showline = !optget(opts, "no-trace-showsource")->enabled;
+    tracelevel = optget(opts, "trace")->numarg;
+    cli_bytecode_context_set_trace(ctx, tracelevel,
 				   tracehook,
 				   tracehook_op,
 				   tracehook_val);
diff --git a/shared/optparser.c b/shared/optparser.c
index b181f15..2947af7 100644
--- a/shared/optparser.c
+++ b/shared/optparser.c
@@ -121,6 +121,8 @@ const struct clam_option __clam_options[] = {
 
     { NULL, "force-interpreter", 'f', TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_CLAMBC, "Force using the interpreter instead of the JIT", "" },
     { NULL, "input", 'i', TYPE_STRING, NULL, -1, NULL, 0, OPT_CLAMBC, "Input file to run the bytecode n", ""},
+    { NULL, "trace", 't', TYPE_NUMBER, MATCH_NUMBER, 7, NULL, 0, OPT_CLAMBC, "bytecode trace level",""},
+    { NULL, "no-trace-showsource", 's', TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_CLAMBC, "Don't show source line during tracing",""},
 
     /* cmdline only - deprecated */
     { NULL, "http-proxy", 0, TYPE_STRING, NULL, 0, NULL, 0, OPT_FRESHCLAM | OPT_DEPRECATED, "", "" },

-- 
Debian repository for ClamAV



More information about the Pkg-clamav-commits mailing list