summaryrefslogtreecommitdiff
path: root/preproc.c
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2011-06-26 23:33:56 +0400
committerCyrill Gorcunov <gorcunov@gmail.com>2011-06-26 23:33:56 +0400
commit2e04600e3d0984d099072cf71767df969c3cd76d (patch)
treeaceb4523c719471bbd12c5c2a2f38597e7a9b9ea /preproc.c
parent9d1141aea901f626c248e17c7adee6e17f806c59 (diff)
downloadnasm-2e04600e3d0984d099072cf71767df969c3cd76d.tar.gz
nasm-2e04600e3d0984d099072cf71767df969c3cd76d.tar.bz2
nasm-2e04600e3d0984d099072cf71767df969c3cd76d.zip
preproc: Some more tracing calls
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Diffstat (limited to 'preproc.c')
-rw-r--r--preproc.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/preproc.c b/preproc.c
index 30d618a..cb565b4 100644
--- a/preproc.c
+++ b/preproc.c
@@ -505,6 +505,7 @@ static ExpInv *new_ExpInv(int exp_type, ExpDef *ed);
#define nasm_trace(msg, ...) printf("(%s:%d): " msg "\n", __func__, __LINE__, ##__VA_ARGS__)
#define nasm_dump_token(t) nasm_raw_dump_token(t, __FILE__, __LINE__, __func__);
+#define nasm_dump_stream(t) nasm_raw_dump_stream(t, __FILE__, __LINE__, __func__);
/* FIXME: we really need some compound type here instead of inplace code */
static const char *nasm_get_tok_type_str(enum pp_token_type type)
@@ -550,9 +551,21 @@ static void nasm_raw_dump_token(Token *token, const char *file, int line, const
}
}
+static void nasm_raw_dump_stream(Token *token, const char *file, int line, const char *func)
+{
+ printf("---[%s (%s:%d): %p]---\n", func, file, line, (void *)token);
+ if (token) {
+ Token *t;
+ list_for_each(t, token)
+ printf("%s", t->text ? t->text : " ");
+ printf("\n\n");
+ }
+}
+
#else
#define nasm_trace(msg, ...)
#define nasm_dump_token(t)
+#define nasm_dump_stream(t)
#endif
/*
@@ -4197,6 +4210,8 @@ static Token *expand_mmac_params(Token * tline)
tail = &thead;
thead = NULL;
+ nasm_dump_stream(tline);
+
while (tline) {
if (tline->type == TOK_PREPROC_ID &&
(((tline->text[1] == '+' || tline->text[1] == '-') && tline->text[2]) ||
@@ -4362,6 +4377,8 @@ static Token *expand_mmac_params(Token * tline)
ARRAY_SIZE(pp_concat_match),
false);
+ nasm_dump_token(thead);
+
return thead;
}