From 31131323ee211aed77d01bdac61ad371524620a2 Mon Sep 17 00:00:00 2001
From: Cyrille Bagard <nocbos@gmail.com>
Date: Tue, 12 Sep 2023 23:55:01 +0200
Subject: Delete lots of debug output.

---
 src/analysis/scan/context.c                      |  4 ----
 src/analysis/scan/matches/pending.c              | 14 --------------
 src/analysis/scan/patterns/token.c               |  2 --
 src/analysis/scan/patterns/tokens/node.c         |  8 --------
 src/analysis/scan/patterns/tokens/nodes/any.c    |  3 ++-
 src/analysis/scan/patterns/tokens/nodes/masked.c |  7 -------
 src/analysis/scan/rule.c                         |  4 ----
 7 files changed, 2 insertions(+), 40 deletions(-)

diff --git a/src/analysis/scan/context.c b/src/analysis/scan/context.c
index 9dd41cf..c016f7e 100644
--- a/src/analysis/scan/context.c
+++ b/src/analysis/scan/context.c
@@ -529,8 +529,6 @@ void g_scan_context_register_atom_match(GScanContext *context, patid_t id, phys_
         tracker->matches = realloc(tracker->matches, tracker->allocated * sizeof(phys_t));
     }
 
-    printf("++ register pat=%llu @ %llu\n", (unsigned long long)id, (unsigned long long)offset); // REMME
-
     tracker->matches[tracker->used++] = offset;
 
 }
@@ -587,8 +585,6 @@ void g_scan_context_register_full_match(GScanContext *context, GScanMatch *match
 
     pattern = g_scan_match_get_source(match);
 
-    printf("// register match=%p for pattern=%p\n", pattern, match); // REMME
-
     key.pattern = pattern;
 
     found = bsearch((full_match_tracker_t *[]) { &key }, context->full_trackers, context->full_count,
diff --git a/src/analysis/scan/matches/pending.c b/src/analysis/scan/matches/pending.c
index 03cf3f2..9ed4de3 100644
--- a/src/analysis/scan/matches/pending.c
+++ b/src/analysis/scan/matches/pending.c
@@ -293,10 +293,6 @@ void add_pending_match(pending_matches_t *matches, phys_t start, phys_t length)
 
     area->ttl = 1;
 
-    printf("[i] new match: from %llx to %llx\n",
-           (unsigned long long)area->start,
-           (unsigned long long)area->end);
-
 }
 
 
@@ -368,11 +364,6 @@ void extend_pending_match_ending(pending_matches_t *matches, size_t target, phys
     {
         assert(end <= matches->content_end);
 
-        printf(" -- extend same (%llu - %llu) -> new end: %llu\n",
-               (unsigned long long)area->start,
-               (unsigned long long)area->end,
-               (unsigned long long)end);
-
         area->end = end;
 
         area->ttl = 1;
@@ -382,11 +373,6 @@ void extend_pending_match_ending(pending_matches_t *matches, size_t target, phys
     {
         assert(area->ttl == 1);
 
-        printf(" -- extend (%llu - %llu) -> new end: %llu\n",
-               (unsigned long long)area->start,
-               (unsigned long long)area->end,
-               (unsigned long long)end);
-
         add_pending_match(matches, area->start, end - area->start);
 
     }
diff --git a/src/analysis/scan/patterns/token.c b/src/analysis/scan/patterns/token.c
index 1b2ee8a..f44680c 100644
--- a/src/analysis/scan/patterns/token.c
+++ b/src/analysis/scan/patterns/token.c
@@ -265,8 +265,6 @@ bool g_string_token_enroll(GStringToken *token, GScanContext *context, GEngineBa
 
     result = g_scan_token_node_enroll(token->root, context, backend, maxsize, &token->slow);
 
-    printf("need backward? %d\n", token->need_backward);
-
     return result;
 
 }
diff --git a/src/analysis/scan/patterns/tokens/node.c b/src/analysis/scan/patterns/tokens/node.c
index 1354fff..cdbad4f 100644
--- a/src/analysis/scan/patterns/tokens/node.c
+++ b/src/analysis/scan/patterns/tokens/node.c
@@ -267,8 +267,6 @@ bool g_scan_token_node_setup_tree(GScanTokenNode *node)
 
     g_scan_token_node_set_flags(main, STNF_MAIN);
 
-    printf("main : %p (%s)\n", main, G_OBJECT_TYPE_NAME(main));
-
     result = (main != node/*points.first_node*/);
 
     return result;
@@ -365,9 +363,6 @@ void _g_scan_token_node_check_forward(const GScanTokenNode *node, GScanContext *
         *skip = false;
     }
 
-    printf("Checking forward... node=%p / %s skip=%d main=%u\n",
-           node, G_OBJECT_TYPE_NAME(node), *skip, (node->flags & STNF_MAIN) == STNF_MAIN);
-
     class = G_SCAN_TOKEN_NODE_GET_CLASS(node);
 
     class->check_forward(node, context, content, matches, offset, not, skip);
@@ -484,9 +479,6 @@ void _g_scan_token_node_check_backward(const GScanTokenNode *node, GScanContext
 {
     GScanTokenNodeClass *class;             /* Classe de l'instance        */
 
-    printf("Checking backward... node=%p / %s skip=%d main=%u\n",
-           node, G_OBJECT_TYPE_NAME(node), *skip, (node->flags & STNF_MAIN) == STNF_MAIN);
-
     class = G_SCAN_TOKEN_NODE_GET_CLASS(node);
 
     class->check_backward(node, context, content, matches, offset, not, skip);
diff --git a/src/analysis/scan/patterns/tokens/nodes/any.c b/src/analysis/scan/patterns/tokens/nodes/any.c
index af2ae29..e5fb1d7 100644
--- a/src/analysis/scan/patterns/tokens/nodes/any.c
+++ b/src/analysis/scan/patterns/tokens/nodes/any.c
@@ -333,10 +333,11 @@ static void g_scan_token_node_any_check_forward(const GScanTokenNodeAny *node, G
         // TODO : compléter les intervales éventuels déjà en place
 
 
+        /*
         printf("[i] create hole: %llx <-> %llx\n",
                (unsigned long long)node->min,
                (unsigned long long)node->max);
-
+        */
 
 
         if (node->has_max)
diff --git a/src/analysis/scan/patterns/tokens/nodes/masked.c b/src/analysis/scan/patterns/tokens/nodes/masked.c
index 25f0315..8765b1d 100644
--- a/src/analysis/scan/patterns/tokens/nodes/masked.c
+++ b/src/analysis/scan/patterns/tokens/nodes/masked.c
@@ -721,9 +721,6 @@ static void g_scan_token_node_masked_check_backward(const GScanTokenNodeMasked *
 
         before = pending->start - matches->content_start;
 
-        printf(" (masked) pending: %u - len=%u\n",
-               (unsigned int)pending->start, (unsigned int)node->len);
-
         new_begin = pending->start - node->len;
 
         if (ocount > 0)
@@ -796,10 +793,6 @@ static void g_scan_token_node_masked_check_backward(const GScanTokenNodeMasked *
 
             status = check_scan_token_node_masked_content(node->bytes, node->len, new_begin, content);
 
-            printf(" (masked) found new @ %llx ? %d\n",
-                   (unsigned long long)new_begin, status);
-
-
             if ((status && !not) || (!status && not))
                 extend_pending_match_beginning(matches, p, new_begin);
 
diff --git a/src/analysis/scan/rule.c b/src/analysis/scan/rule.c
index a1fcfcb..a7d7765 100644
--- a/src/analysis/scan/rule.c
+++ b/src/analysis/scan/rule.c
@@ -333,8 +333,6 @@ GSearchPattern **g_scan_rule_get_local_variables(GScanRule *rule, const char *ta
         regex = strprep(regex, "^");
         regex = stradd(regex, "$");
 
-        printf("regex: %s\n", regex);
-
         ret = regcomp(&preg, regex, REG_NOSUB);
 
         if (ret != 0)
@@ -362,8 +360,6 @@ GSearchPattern **g_scan_rule_get_local_variables(GScanRule *rule, const char *ta
 
         }
 
-        printf(" ==> found: %zu patterns for '%s'\n", *count, target);
-
         if (*count == 0)
         {
             free(result);
-- 
cgit v0.11.2-87-g4458