diff options
author | João Valverde <j@v6e.pt> | 2021-09-26 16:28:39 +0100 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2021-09-30 16:29:11 +0100 |
commit | 3ea2a61f2a1f8d621c423236ca46cc388c079a39 (patch) | |
tree | 7cb7c128951e9fc7fac92820202ce01ded9842af /epan/dfilter/sttype-string.c | |
parent | 188348724183c7c235ec0f3b279cf4a5479b71a0 (diff) |
dfilter: Display syntax tree for debugging
Use wslog to output debug information. Being able to control
it at runtime is a big advantage.
We extend the syntax tree nodes with a method to return a
canonical string representation.
Add a routine to walk the tree and return an textual representation
for debugging purposes.
Diffstat (limited to 'epan/dfilter/sttype-string.c')
-rw-r--r-- | epan/dfilter/sttype-string.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/epan/dfilter/sttype-string.c b/epan/dfilter/sttype-string.c index 00ffda5181..bc65e26381 100644 --- a/epan/dfilter/sttype-string.c +++ b/epan/dfilter/sttype-string.c @@ -27,6 +27,12 @@ string_free(gpointer value) g_free(value); } +static char * +string_tostr(const void *data) +{ + return g_strdup(data); +} + void sttype_register_string(void) @@ -36,7 +42,8 @@ sttype_register_string(void) "STRING", string_new, string_free, - string_dup + string_dup, + string_tostr }; static sttype_t charconst_type = { @@ -44,7 +51,8 @@ sttype_register_string(void) "CHARCONST", string_new, string_free, - string_dup + string_dup, + string_tostr }; static sttype_t unparsed_type = { @@ -52,7 +60,8 @@ sttype_register_string(void) "UNPARSED", string_new, string_free, - string_dup + string_dup, + string_tostr }; sttype_register(&string_type); |