From b226c2a761abc0d498027bc92029e13e1b8795ff Mon Sep 17 00:00:00 2001 From: "K.Kosako" Date: Fri, 2 Jun 2017 10:57:10 +0900 Subject: [PATCH] add output of bytecode execution counter --- src/regexec.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/regexec.c b/src/regexec.c index 7c6d303..0e02ff6 100644 --- a/src/regexec.c +++ b/src/regexec.c @@ -1341,9 +1341,13 @@ match_at(regex_t* reg, const UChar* str, const UChar* end, while (1) { #ifdef ONIG_DEBUG_MATCH { + static unsigned int counter = 1; + UChar *q, *bp, buf[50]; int len; - fprintf(stderr, "%4d> \"", (int )(s - str)); + fprintf(stderr, "%7u: %4d> \"", counter, (int )(s - str)); + counter++; + bp = buf; for (i = 0, q = s; i < 7 && q < end; i++) { len = enclen(encode, q); -- 2.40.0