From 78b2ea64f3dc9eeef3195d50c5848fc39b0d9d35 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Fri, 15 Jul 2016 17:17:19 +0300 Subject: [PATCH] debug: add a __smatch_absolute() It prints the absolute range. I wonder how long I've had this change... I should probably update it to print the "real" absolute as well. Signed-off-by: Dan Carpenter --- check_debug.c | 15 +++++++++++++++ check_debug.h | 1 + 2 files changed, 16 insertions(+) diff --git a/check_debug.c b/check_debug.c index d7ded327..c62ff746 100644 --- a/check_debug.c +++ b/check_debug.c @@ -244,6 +244,21 @@ static void match_print_fuzzy_max(const char *fn, struct expression *expr, void free_string(name); } +static void match_print_absolute(const char *fn, struct expression *expr, void *info) +{ + struct expression *arg; + struct range_list *rl; + char *name; + + arg = get_argument_from_call_expr(expr->args, 0); + name = expr_to_str(arg); + + get_absolute_rl(arg, &rl); + sm_msg("absolute: %s = %s", name, show_rl(rl)); + + free_string(name); +} + static void match_print_absolute_min(const char *fn, struct expression *expr, void *info) { struct expression *arg; diff --git a/check_debug.h b/check_debug.h index 2cc36efd..0a2e9eb4 100644 --- a/check_debug.h +++ b/check_debug.h @@ -17,6 +17,7 @@ static inline void __smatch_user_rl(long long val){} static inline void __smatch_hard_max(long long val){} static inline void __smatch_fuzzy_max(long long val){} +static inline void __smatch_absolute(long long val){} static inline void __smatch_absolute_min(long long val){} static inline void __smatch_absolute_max(long long val){} static inline void __smatch_real_absolute(long long val){} -- 2.11.4.GIT